Skip to content

Commit 8cd0635

Browse files
committed
trying to see if it is the actions in the previous tests causing the tabs to crash
1 parent 88b44ee commit 8cd0635

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

rb/spec/integration/selenium/webdriver/action_builder_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ module WebDriver
172172
.pointer_down(:left).pointer_up(:left)
173173
.perform
174174
expect(element.attribute(:value)).to eq('DoubleClicked')
175+
ensure
176+
# https://issues.chromium.org/issues/400087471
177+
reset_driver! if GlobalTestEnv.browser == :chrome
175178
end
176179
end
177180

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ module WebDriver
157157
expect {
158158
driver.find_element(xpath: '*?//-')
159159
}.to raise_error(Error::InvalidSelectorError, /errors#invalid-selector-exception/)
160+
ensure
161+
# https://issues.chromium.org/issues/400087471
162+
reset_driver! if GlobalTestEnv.browser == :chrome
160163
end
161164
end
162165

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ module WebDriver
8989
expect {
9090
driver.switch_to.new_window(:unknown)
9191
}.to raise_error(ArgumentError)
92+
ensure
93+
# https://issues.chromium.org/issues/400087471
94+
reset_driver! if GlobalTestEnv.browser == :chrome
9295
end
9396

9497
it 'switches to the new window then close it when given a block' do
@@ -307,25 +310,25 @@ module WebDriver
307310
wait_for_no_alert
308311
end
309312

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

314-
driver.find_element(id: 'alert').click
316+
it 'raises when calling #text on a closed alert' do
317+
driver.navigate.to url_for('alerts.html')
318+
wait_for_element(id: 'alert')
315319

316-
alert = wait_for_alert
317-
alert.accept
320+
driver.find_element(id: 'alert').click
318321

319-
wait_for_no_alert
320-
expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
321-
end
322+
alert = wait_for_alert
323+
alert.accept
322324

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

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

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

0 commit comments

Comments
 (0)