Skip to content

Commit f4cd7af

Browse files
committed
Update specs for W3C-capable Chrome
1 parent b5a27ad commit f4cd7af

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
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
@@ -150,7 +150,7 @@ module WebDriver
150150
expect(text).to eq('Dropped!')
151151
end
152152

153-
it 'double clicks an element' do
153+
it 'double clicks an element', except: {browser: :chrome} do
154154
driver.navigate.to url_for('javascriptPage.html')
155155
element = driver.find_element(id: 'doubleClickField')
156156

rb/spec/integration/selenium/webdriver/chrome/options_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
module Chrome
25-
describe Options, only: {driver: :chrome} do
25+
describe Options, only: {browser: :chrome} do
2626
subject(:options) { described_class.new }
2727

2828
it 'passes emulated device correctly' do

rb/spec/integration/selenium/webdriver/manage_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 Manager do
25-
describe 'logs', only: {browser: %i[chrome]} do
25+
describe 'logs', except: {browser: %i[chrome firefox ie safari safari_preview]} do
2626
it 'can fetch remote log types', only: {driver: :remote} do
2727
expect(driver.manage.logs.available_types).to include(:server, :browser, :driver)
2828
end

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ def create_remote_driver(opt = {})
209209
opt[:url] ||= ENV['WD_REMOTE_URL'] || remote_server.webdriver_url
210210
opt[:http_client] ||= keep_alive_client || http_client
211211

212+
# https://bugs.chromium.org/p/chromedriver/issues/detail?id=2536
213+
# Current status can be found here (70% as of February 2019)
214+
# https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
215+
# TODO: remove before Selenium 4 release
216+
opt[:options] ||= WebDriver::Chrome::Options.new(options: {w3c: true}) if browser == :chrome
217+
212218
WebDriver::Driver.for(:remote, opt)
213219
end
214220

@@ -235,7 +241,11 @@ def create_chrome_driver(opt = {})
235241
# Current status can be found here (70% as of February 2019)
236242
# https://chromium.googlesource.com/chromium/src/+/master/docs/chromedriver_status.md
237243
# TODO: remove before Selenium 4 release
238-
opt[:options] = WebDriver::Chrome::Options.new(options: {w3c: true}) unless opt[:options]
244+
if opt[:options]
245+
opt[:options].add_option(:w3c, true)
246+
else
247+
opt[:options] = WebDriver::Chrome::Options.new(options: {w3c: true})
248+
end
239249

240250
WebDriver::Driver.for :chrome, opt
241251
end

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module WebDriver
7575
expect(new_pos.y).to eq(target_y)
7676
end
7777

78-
it 'gets the rect of the current window', only: {browser: %i[firefox ie]} do
78+
it 'gets the rect of the current window', only: {browser: %i[firefox ie chrome]} do
7979
rect = window.rect
8080

8181
expect(rect).to be_a(Rectangle)
@@ -86,7 +86,7 @@ module WebDriver
8686
expect(rect.height).to be >= 0
8787
end
8888

89-
it 'sets the rect of the current window', only: {browser: %i[firefox ie]} do
89+
it 'sets the rect of the current window', only: {browser: %i[firefox ie chrome]} do
9090
rect = window.rect
9191

9292
target_x = rect.x + 10
@@ -118,7 +118,7 @@ module WebDriver
118118

119119
# Edge: Not Yet - https://dev.windows.com/en-us/microsoft-edge/platform/status/webdriver/details/
120120
# https://github.com/mozilla/geckodriver/issues/1281
121-
it 'can make window full screen', only: {window_manager: true, browser: %i[ie firefox]},
121+
it 'can make window full screen', only: {window_manager: true, browser: %i[chrome ie firefox]},
122122
exclude: {driver: :remote, browser: :firefox, platform: :linux} do
123123
window.size = old_size = Dimension.new(200, 200)
124124

0 commit comments

Comments
 (0)