Skip to content

Commit 3214f61

Browse files
committed
revert the workarounds to try again
1 parent 287d839 commit 3214f61

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
module Selenium
2323
module WebDriver
2424
describe ActionBuilder, exclusive: {bidi: false, reason: 'Not yet implemented with BiDi'} do
25-
after { reset_driver! }
25+
after { driver.action.clear_all_actions }
2626

2727
describe '#send_keys' do
2828
it 'sends keys to the active element', except: {browser: %i[safari safari_preview]} do

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ module WebDriver
337337

338338
it 'is able to pass element arguments' do
339339
driver.navigate.to url_for('javascriptPage.html')
340-
short_wait.until { driver.find_element(id: 'plainButton') }
341340
button = driver.find_element(id: 'plainButton')
342341
js = "arguments[0]['flibble'] = arguments[0].getAttribute('id'); return arguments[0]['flibble'];"
343342
expect(driver.execute_script(js, button))

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ module WebDriver
2424
describe TargetLocator, exclusive: {bidi: false, reason: 'Not yet implemented with BiDi'} do
2525
before { @original_window = driver.window_handle }
2626

27-
after { reset_driver! }
27+
after do
28+
handles = driver.window_handles
29+
driver.switch_to.window(@original_window) if handles.include?(@original_window)
30+
31+
(handles - [driver.window_handle]).each do |handle|
32+
driver.switch_to.window(handle) { driver.close }
33+
end
34+
end
2835

2936
let(:new_window) { driver.window_handles.find { |handle| handle != driver.window_handle } }
3037

@@ -82,8 +89,6 @@ module WebDriver
8289
expect {
8390
driver.switch_to.new_window(:unknown)
8491
}.to raise_error(ArgumentError)
85-
ensure
86-
reset_driver!
8792
end
8893

8994
it 'switches to the new window then close it when given a block' do

0 commit comments

Comments
 (0)