Skip to content

Commit 137bc30

Browse files
committed
rb - wrong syntax for edge tests; breaking the tests
1 parent 16d6fb5 commit 137bc30

File tree

3 files changed

+41
-43
lines changed

3 files changed

+41
-43
lines changed

Rakefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ task :test_rb => [
249249
"//rb:firefox-test",
250250
"//rb:remote-test",
251251
"//rb:rc-client-integration-test",
252-
("//rb:ie-test" if windows?),
253-
("//rb:edge-test" if windows?),
254252
"//rb:chrome-test",
255-
("//rb:safari-test" if mac?),
256-
"//rb:phantomjs-test"
257-
].compact
253+
"//rb:phantomjs-test",
254+
("//rb:safari-test" if mac?),
255+
("//rb:ie-test" if windows?),
256+
("//rb:edge-test" if windows?)
257+
].compact
258258

259259
task :test_py => [ :py_prep_for_install_release, "//py:firefox_test:run" ]
260260

rb/spec/integration/selenium/webdriver/keyboard_spec.rb

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,55 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe Keyboard do
2524

26-
not_compliant_on :browser => [:chrome, :android, :iphone, :safari] do
27-
it "sends keys to the active element" do
28-
driver.navigate.to url_for("bodyTypingTest.html")
25+
not_compliant_on({:browser => [:chrome, :android, :iphone, :safari]}) do
26+
describe Keyboard do
27+
it "sends keys to the active element" do
28+
driver.navigate.to url_for("bodyTypingTest.html")
2929

30-
driver.keyboard.send_keys "ab"
30+
driver.keyboard.send_keys "ab"
3131

32-
text = driver.find_element(:id => "body_result").text.strip
33-
expect(text).to eq("keypress keypress")
32+
text = driver.find_element(:id => "body_result").text.strip
33+
expect(text).to eq("keypress keypress")
3434

35-
expect(driver.find_element(:id => "result").text.strip).to be_empty
36-
end
35+
expect(driver.find_element(:id => "result").text.strip).to be_empty
36+
end
3737

38+
it "can send keys with shift pressed" do
39+
driver.navigate.to url_for("javascriptPage.html")
3840

39-
it "can send keys with shift pressed" do
40-
driver.navigate.to url_for("javascriptPage.html")
41+
event_input = driver.find_element(:id => "theworks")
42+
keylogger = driver.find_element(:id => "result")
4143

42-
event_input = driver.find_element(:id => "theworks")
43-
keylogger = driver.find_element(:id => "result")
44+
driver.mouse.click event_input
4445

45-
driver.mouse.click event_input
46+
driver.keyboard.press :shift
47+
driver.keyboard.send_keys "ab"
48+
driver.keyboard.release :shift
4649

47-
driver.keyboard.press :shift
48-
driver.keyboard.send_keys "ab"
49-
driver.keyboard.release :shift
50+
expect(event_input.attribute(:value)).to eq("AB")
51+
expect(keylogger.text.strip).to match(/^(focus )?keydown keydown keypress keyup keydown keypress keyup keyup$/)
52+
end
5053

51-
expect(event_input.attribute(:value)).to eq("AB")
52-
expect(keylogger.text.strip).to match(/^(focus )?keydown keydown keypress keyup keydown keypress keyup keyup$/)
53-
end
54+
it "raises an ArgumentError if the pressed key is not a modifier key" do
55+
expect { driver.keyboard.press :return }.to raise_error(ArgumentError)
56+
end
5457

55-
it "raises an ArgumentError if the pressed key is not a modifier key" do
56-
expect { driver.keyboard.press :return }.to raise_error(ArgumentError)
57-
end
58+
it "can press and release modifier keys" do
59+
driver.navigate.to url_for("javascriptPage.html")
5860

59-
it "can press and release modifier keys" do
60-
driver.navigate.to url_for("javascriptPage.html")
61+
event_input = driver.find_element(:id => "theworks")
62+
keylogger = driver.find_element(:id => "result")
6163

62-
event_input = driver.find_element(:id => "theworks")
63-
keylogger = driver.find_element(:id => "result")
64+
driver.mouse.click event_input
6465

65-
driver.mouse.click event_input
66+
driver.keyboard.press :shift
67+
expect(keylogger.text).to match(/keydown *$/)
6668

67-
driver.keyboard.press :shift
68-
expect(keylogger.text).to match(/keydown *$/)
69-
70-
driver.keyboard.release :shift
71-
expect(keylogger.text).to match(/keyup *$/)
72-
end
73-
end
74-
75-
end # Keyboard
69+
driver.keyboard.release :shift
70+
expect(keylogger.text).to match(/keyup *$/)
71+
end
72+
end # Keyboard
73+
end
7674
end # WebDriver
7775
end # Selenium

rb/spec/integration/selenium/webdriver/mouse_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module WebDriver
4848
end
4949

5050
# Edge BUG - https://connect.microsoft.com/IE/feedback/details/1850023
51-
not_compliant_on :edge do
51+
not_compliant_on :browser => :edge do
5252
it "double clicks an element" do
5353
driver.navigate.to url_for("javascriptPage.html")
5454
element = driver.find_element(:id, 'doubleClickField')

0 commit comments

Comments
 (0)