Skip to content

Commit

Permalink
rb - updates for edge support
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 20, 2016
1 parent 9e68025 commit 62ff9d3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions rb/lib/selenium/webdriver/edge/legacy_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module WebDriver
module Edge
module LegacySupport
# These are commands Edge is still using from JSON Wire Protocol
%i[executeScript, executeAsyncScript, submitElement, doubleClick,
mouseDown, mouseUp, mouseMoveTo, click,
sendKeysToActiveElement, getWindowHandles, getCurrentWindowHandle,
getWindowSize, setWindowSize, getWindowPosition, setWindowPosition,
maximizeWindow, getAlertText, acceptAlert, dismissAlert].each do |cmd|
%i[executeScript executeAsyncScript submitElement doubleClick
mouseDown mouseUp mouseMoveTo click
sendKeysToActiveElement getWindowHandles getCurrentWindowHandle
getWindowSize setWindowSize getWindowPosition setWindowPosition
maximizeWindow getAlertText acceptAlert dismissAlert].each do |cmd|
jwp = Remote::Bridge::COMMANDS[cmd]
Remote::W3CBridge.command(cmd, jwp.first, jwp.last)
end
Expand Down
15 changes: 6 additions & 9 deletions rb/spec/integration/selenium/webdriver/mouse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ module WebDriver
expect(text).to eq('Dropped!')
end

# Edge BUG - https://connect.microsoft.com/IE/feedback/details/1850023
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')
it 'double clicks an element' do
driver.navigate.to url_for('javascriptPage.html')
element = driver.find_element(id: 'doubleClickField')

driver.mouse.double_click element
driver.mouse.double_click element

wait(5).until do
element.attribute(:value) == 'DoubleClicked'
end
wait(5).until do
element.attribute(:value) == 'DoubleClicked'
end
end

Expand Down
4 changes: 2 additions & 2 deletions rb/spec/integration/selenium/webdriver/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module WebDriver
expect(cookies.first[:value]).to eq('bar')
end

# Edge BUG - https://connect.microsoft.com/IE/feedbackdetail/view/1864122
# Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/
not_compliant_on browser: :edge do
it 'should delete one' do
driver.navigate.to url_for('xhtmlTest.html')
Expand All @@ -84,7 +84,7 @@ module WebDriver
end
end

# This is not a w3c supported spec
# Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/
not_compliant_on browser: :edge do
it 'should delete all' do
driver.navigate.to url_for('xhtmlTest.html')
Expand Down
29 changes: 16 additions & 13 deletions rb/spec/integration/selenium/webdriver/target_locator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,24 +320,27 @@ module WebDriver
end

compliant_on browser: :ie do
describe 'basic auth alerts' do
after { reset_driver! }
# Windows 10 changed the auth alert
not_compliant_on browser: :ie do
describe 'basic auth alerts' do
after { reset_driver! }

it 'allows the user to send valid credentials to an alert' do
driver.navigate.to url_for('basicAuth')
driver.switch_to.alert.authenticate('test', 'test')
it 'allows the user to send valid credentials to an alert' do
driver.navigate.to url_for('basicAuth')
driver.switch_to.alert.authenticate('test', 'test')

expect(driver.find_element(tag_name: 'h1').text).to eq('authorized')
end
expect(driver.find_element(tag_name: 'h1').text).to eq('authorized')
end

it 'does not raise an error when invalid credentials are used' do
driver.navigate.to url_for('basicAuth')
driver.switch_to.alert.authenticate('invalid', 'invalid')
it 'does not raise an error when invalid credentials are used' do
driver.navigate.to url_for('basicAuth')
driver.switch_to.alert.authenticate('invalid', 'invalid')

wait = Selenium::WebDriver::Wait.new(timeout: 5, ignore: Selenium::WebDriver::Error::NoSuchAlertError)
wait.until { driver.switch_to.alert }
wait = Selenium::WebDriver::Wait.new(timeout: 5, ignore: Selenium::WebDriver::Error::NoSuchAlertError)
wait.until { driver.switch_to.alert }

expect { driver.switch_to.alert.dismiss }.to_not raise_error
expect { driver.switch_to.alert.dismiss }.to_not raise_error
end
end
end
end
Expand Down

0 comments on commit 62ff9d3

Please sign in to comment.