Skip to content

Commit ba04547

Browse files
committed
Unguard tests passing with standalone 3.5
1 parent 81d261b commit ba04547

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe ActionBuilder, except: [{browser: :safari}, {browser: %i[firefox ff_nightly], driver: :remote}] do
25-
after { driver.action.instance_variable_set(:@actions, []) }
24+
describe ActionBuilder, except: {browser: :safari} do
25+
after { reset_driver! }
2626

2727
describe 'Key actions' do
2828
it 'sends keys to the active element' do
@@ -103,7 +103,7 @@ module WebDriver
103103
expect(input.attribute(:value)).to eq('abcd')
104104
end
105105

106-
it 'can release pressed keys via release action', only: {driver: %i[firefox ff_nightly]} do
106+
it 'can release pressed keys via release action', only: {browser: %i[firefox ff_nightly]} do
107107
driver.navigate.to url_for('javascriptPage.html')
108108

109109
event_input = driver.find_element(id: 'theworks')
@@ -146,7 +146,7 @@ module WebDriver
146146
end
147147

148148
# Pending bug with Firefox
149-
it 'double clicks an element', except: {driver: %i[firefox ff_nightly]} do
149+
it 'double clicks an element', except: {browser: %i[firefox ff_nightly]} do
150150
driver.navigate.to url_for('javascriptPage.html')
151151
element = driver.find_element(id: 'doubleClickField')
152152

@@ -162,7 +162,7 @@ module WebDriver
162162
expect(element.attribute(:value)).to eq('ContextClicked')
163163
end
164164

165-
it 'can release pressed buttons via release action', only: {driver: %i[firefox ff_nightly]} do
165+
it 'can release pressed buttons via release action', only: {browser: %i[firefox ff_nightly]} do
166166
driver.navigate.to url_for('javascriptPage.html')
167167

168168
event_input = driver.find_element(id: 'clickField')

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
module Selenium
2323
module WebDriver
2424
describe Firefox, only: {browser: %i[ff_esr firefox ff_nightly]} do
25-
it 'creates default capabilities (W3C)', except: [{driver: :remote}, {browser: :ff_esr}] do
25+
it 'creates default capabilities (W3C)', except: {browser: :ff_esr} do
2626
create_driver! do |driver|
2727
caps = driver.capabilities
2828
expect(caps.proxy).to be_nil

rb/spec/integration/selenium/webdriver/options_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ module WebDriver
7272
end
7373

7474
# IE - Command not implemented
75-
it 'should get named cookie', except: {driver: :ie} do
75+
it 'should get named cookie', except: [{driver: :ie}, {browser: :firefox}] do
7676
driver.navigate.to url_for('xhtmlTest.html')
7777
driver.manage.add_cookie name: 'foo', value: 'bar'
7878

7979
expect(driver.manage.cookie_named('foo')[:value]).to eq('bar')
8080
end
8181

8282
# Edge BUG - https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/5751773/
83-
it 'should delete one', except: {browser: :edge} do
83+
it 'should delete one', except: [{browser: :edge}, [driver: :firefox]] do
8484
driver.navigate.to url_for('xhtmlTest.html')
8585
driver.manage.add_cookie name: 'foo', value: 'bar'
8686

@@ -98,7 +98,7 @@ module WebDriver
9898
end
9999

100100
# IE - Command not implemented
101-
it 'should use DateTime for expires', except: {browser: :ie} do
101+
it 'should use DateTime for expires', except: {browser: %i[firefox ie]} do
102102
driver.navigate.to url_for('xhtmlTest.html')
103103

104104
expected = DateTime.new(2039)

rb/spec/integration/selenium/webdriver/remote/element_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module WebDriver
3030
driver.file_detector = nil
3131
end
3232

33-
it 'uses the file detector', only: {browser: %i[chrome ff_esr firefox ff_nightly]} do
33+
it 'uses the file detector' do
3434
driver.navigate.to url_for('upload.html')
3535

3636
driver.find_element(id: 'upload').send_keys('random string')

rb/spec/integration/selenium/webdriver/storage_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
module Selenium
2323
module WebDriver
2424
module DriverExtensions
25-
# TODO - Find out what settings for turning on web storage in remote server
26-
describe HasWebStorage, only: {browser: %i[chrome firefox ff_nightly]}, except: {driver: :remote} do
25+
describe HasWebStorage, only: {browser: %i[chrome firefox ff_nightly]} do
2726
shared_examples_for 'web storage' do
2827
before do
2928
driver.navigate.to url_for('clicks.html')

rb/spec/integration/selenium/webdriver/w3c_action_builder_spec.rb

+10-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121

2222
module Selenium
2323
module WebDriver
24-
describe W3CActionBuilder, only: {driver: :ff_nightly} do
25-
after { driver.action.clear_all_actions }
24+
describe W3CActionBuilder, only: {browser: %i[firefox ff_nightly]} do
25+
after do
26+
if driver.action.respond_to?(:clear_all_actions)
27+
driver.action.clear_all_actions
28+
else
29+
driver.action.instance_variable_set(:@actions, [])
30+
end
31+
end
2632

2733
describe 'Key actions' do
2834
it 'can release pressed keys via release action' do
@@ -44,12 +50,12 @@ module WebDriver
4450
end # Key actions
4551

4652
describe 'Pointer actions' do
47-
it 'can release pressed buttons via release action', except: {driver: :ff_nightly} do
53+
it 'can release pressed buttons via release action', except: {browser: :ff_nightly} do
4854
driver.navigate.to url_for('javascriptPage.html')
4955

5056
event_input = driver.find_element(id: 'clickField')
5157

52-
driver.action.pointer_down(event_input).perform
58+
driver.action.move_to(event_input).pointer_down(:left).perform
5359
expect(event_input.attribute(:value)).to eq('Hello')
5460

5561
driver.action.release_actions

rb/spec/integration/selenium/webdriver/window_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ module WebDriver
7272
expect(new_pos.y).to eq(target_y)
7373
end
7474

75-
# remote responds to OSS protocol which doesn't support rect commands
76-
context 'window rect', except: {driver: :remote}, only: {browser: %i[firefox ff_nightly]} do
75+
context 'window rect', only: {browser: %i[firefox ff_nightly]} do
7776
it 'gets the rect of the current window' do
7877
rect = driver.manage.window.rect
7978

0 commit comments

Comments
 (0)