Skip to content

Commit 0f125f1

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

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ module WebDriver
172172
.pointer_down(:left).pointer_up(:left)
173173
.perform
174174
expect(element.attribute(:value)).to eq('DoubleClicked')
175+
ensure
176+
reset_driver!
175177
end
176178
end
177179

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ module WebDriver
157157
expect {
158158
driver.find_element(xpath: '*?//-')
159159
}.to raise_error(Error::InvalidSelectorError, /errors#invalid-selector-exception/)
160+
ensure
161+
reset_driver!
160162
end
161163
end
162164

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -307,25 +307,25 @@ module WebDriver
307307
wait_for_no_alert
308308
end
309309

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')
310+
describe 'errors' do
311+
after { |example| reset_driver!(example: example) }
313312

314-
driver.find_element(id: 'alert').click
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')
315316

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

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

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
322+
wait_for_no_alert
323+
expect { alert.text }.to raise_error(Selenium::WebDriver::Error::NoSuchAlertError)
324+
end
326325

327-
describe 'unhandled alert error' do
328-
after { |example| reset_driver!(example: example) }
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
329329

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

0 commit comments

Comments
 (0)