Skip to content

Commit

Permalink
rb - wrong syntax for edge tests; breaking the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 3, 2015
1 parent 16d6fb5 commit 137bc30
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 43 deletions.
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ task :test_rb => [
"//rb:firefox-test",
"//rb:remote-test",
"//rb:rc-client-integration-test",
("//rb:ie-test" if windows?),
("//rb:edge-test" if windows?),
"//rb:chrome-test",
("//rb:safari-test" if mac?),
"//rb:phantomjs-test"
].compact
"//rb:phantomjs-test",
("//rb:safari-test" if mac?),
("//rb:ie-test" if windows?),
("//rb:edge-test" if windows?)
].compact

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

Expand Down
72 changes: 35 additions & 37 deletions rb/spec/integration/selenium/webdriver/keyboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,55 @@

module Selenium
module WebDriver
describe Keyboard do

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

driver.keyboard.send_keys "ab"
driver.keyboard.send_keys "ab"

text = driver.find_element(:id => "body_result").text.strip
expect(text).to eq("keypress keypress")
text = driver.find_element(:id => "body_result").text.strip
expect(text).to eq("keypress keypress")

expect(driver.find_element(:id => "result").text.strip).to be_empty
end
expect(driver.find_element(:id => "result").text.strip).to be_empty
end

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

it "can send keys with shift pressed" do
driver.navigate.to url_for("javascriptPage.html")
event_input = driver.find_element(:id => "theworks")
keylogger = driver.find_element(:id => "result")

event_input = driver.find_element(:id => "theworks")
keylogger = driver.find_element(:id => "result")
driver.mouse.click event_input

driver.mouse.click event_input
driver.keyboard.press :shift
driver.keyboard.send_keys "ab"
driver.keyboard.release :shift

driver.keyboard.press :shift
driver.keyboard.send_keys "ab"
driver.keyboard.release :shift
expect(event_input.attribute(:value)).to eq("AB")
expect(keylogger.text.strip).to match(/^(focus )?keydown keydown keypress keyup keydown keypress keyup keyup$/)
end

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

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

it "can press and release modifier keys" do
driver.navigate.to url_for("javascriptPage.html")
event_input = driver.find_element(:id => "theworks")
keylogger = driver.find_element(:id => "result")

event_input = driver.find_element(:id => "theworks")
keylogger = driver.find_element(:id => "result")
driver.mouse.click event_input

driver.mouse.click event_input
driver.keyboard.press :shift
expect(keylogger.text).to match(/keydown *$/)

driver.keyboard.press :shift
expect(keylogger.text).to match(/keydown *$/)

driver.keyboard.release :shift
expect(keylogger.text).to match(/keyup *$/)
end
end

end # Keyboard
driver.keyboard.release :shift
expect(keylogger.text).to match(/keyup *$/)
end
end # Keyboard
end
end # WebDriver
end # Selenium
2 changes: 1 addition & 1 deletion rb/spec/integration/selenium/webdriver/mouse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module WebDriver
end

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

0 comments on commit 137bc30

Please sign in to comment.