Skip to content

Commit 042c363

Browse files
committed
WIP maybe this does it
1 parent bea296f commit 042c363

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

rb/spec/integration/selenium/webdriver/driver_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
module Selenium
2323
module WebDriver
2424
describe Driver, exclusive: {bidi: false, reason: 'Not yet implemented with BiDi'} do
25+
after { reset_driver! if GlobalTestEnv.rbe? && GlobalTestEnv.browser == :chrome }
26+
2527
it_behaves_like 'driver that can be started concurrently', exclude: [
2628
{browser: %i[safari safari_preview]},
27-
{browser: :firefox, rbe: true, reason: 'https://github.com/mozilla/geckodriver/issues/2219'},
28-
{driver: :remote, rbe: true, reason: 'Cannot start 2+ drivers at once.' }
29+
{browser: :firefox, reason: 'https://github.com/SeleniumHQ/selenium/issues/15451'},
30+
{driver: :remote, rbe: true, reason: 'Cannot start 2+ drivers at once.'}
2931
]
3032

31-
after { reset_driver! if GlobalTestEnv.rbe? && GlobalTestEnv.browser == :chrome }
32-
33-
it 'creates default capabilities', exclude: { browser: %i[safari safari_preview] } do
33+
it 'creates default capabilities', exclude: {browser: %i[safari safari_preview]} do
3434
reset_driver! do |driver|
3535
caps = driver.capabilities
3636
expect(caps.proxy).to be_nil

rb/spec/integration/selenium/webdriver/target_locator_spec.rb

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module WebDriver
3131
(handles - [driver.window_handle]).each do |handle|
3232
driver.switch_to.window(handle) { driver.close }
3333
end
34+
rescue Selenium::WebDriver::Error::WebDriverError
35+
# https://issues.chromium.org/issues/400087471
36+
reset_driver!
3437
end
3538

3639
let(:new_window) { driver.window_handles.find { |handle| handle != driver.window_handle } }
@@ -310,25 +313,25 @@ module WebDriver
310313
wait_for_no_alert
311314
end
312315

313-
it 'raises when calling #text on a closed alert' do
314-
driver.navigate.to url_for('alerts.html')
315-
wait_for_element(id: 'alert')
316+
describe 'errors' do
317+
after { |example| reset_driver!(example: example) }
316318

317-
driver.find_element(id: 'alert').click
319+
it 'raises when calling #text on a closed alert' do
320+
driver.navigate.to url_for('alerts.html')
321+
wait_for_element(id: 'alert')
318322

319-
alert = wait_for_alert
320-
alert.accept
323+
driver.find_element(id: 'alert').click
321324

322-
wait_for_no_alert
323-
expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
324-
end
325+
alert = wait_for_alert
326+
alert.accept
325327

326-
it 'raises NoAlertOpenError if no alert is present' do
327-
expect { driver.switch_to.alert }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
328-
end
328+
wait_for_no_alert
329+
expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
330+
end
329331

330-
describe 'unhandled alert error' do
331-
after { |example| reset_driver!(example: example) }
332+
it 'raises NoAlertOpenError if no alert is present' do
333+
expect { driver.switch_to.alert }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
334+
end
332335

333336
it 'raises an UnexpectedAlertOpenError if an alert has not been dealt with' do
334337
driver.navigate.to url_for('alerts.html')

0 commit comments

Comments
 (0)