Skip to content

Commit cb0aa85

Browse files
committed
[rb] update guards for Firefox implementation of scroll wheel
1 parent d78c5e8 commit cb0aa85

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ module WebDriver
301301
end
302302
end
303303

304-
describe '#scroll_to', only: {browser: %i[chrome edge]} do
305-
it 'scrolls to element' do
304+
describe '#scroll_to', only: {browser: %i[chrome edge firefox]} do
305+
it 'scrolls to element',
306+
except: {browser: :firefox, reason: 'incorrect MoveTargetOutOfBoundsError'} do
306307
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
307308
iframe = driver.find_element(tag_name: 'iframe')
308309

@@ -314,11 +315,11 @@ module WebDriver
314315
end
315316
end
316317

317-
describe '#scroll_by', only: {browser: %i[chrome edge]} do
318-
it 'scrolls by given amount' do
318+
describe '#scroll_by', only: {browser: %i[chrome edge firefox]} do
319+
it 'scrolls by given amount', except: {browser: :firefox, reason: 'scrolls insufficient number of pixels'} do
319320
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
320321
footer = driver.find_element(tag_name: 'footer')
321-
delta_y = footer.rect.y
322+
delta_y = footer.rect.y.round
322323

323324
driver.action.scroll_by(0, delta_y).perform
324325
sleep 0.5
@@ -327,8 +328,9 @@ module WebDriver
327328
end
328329
end
329330

330-
describe '#scroll_from', only: {browser: %i[chrome edge]} do
331-
it 'scrolls from element by given amount' do
331+
describe '#scroll_from', only: {browser: %i[chrome edge firefox]} do
332+
it 'scrolls from element by given amount',
333+
except: {browser: :firefox, reason: 'incorrect MoveTargetOutOfBoundsError'} do
332334
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
333335
iframe = driver.find_element(tag_name: 'iframe')
334336
scroll_origin = WheelActions::ScrollOrigin.element(iframe)
@@ -341,7 +343,8 @@ module WebDriver
341343
expect(in_viewport?(checkbox)).to eq true
342344
end
343345

344-
it 'scrolls from element by given amount with offset' do
346+
it 'scrolls from element by given amount with offset',
347+
except: {browser: :firefox, reason: 'incorrect MoveTargetOutOfBoundsError'} do
345348
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
346349
footer = driver.find_element(tag_name: 'footer')
347350
scroll_origin = WheelActions::ScrollOrigin.element(footer, 0, -50)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def create_firefox_nightly_driver(**opts)
208208
def create_firefox_options(options)
209209
options ||= WebDriver::Options.firefox
210210
options.web_socket_url = true
211+
options.log_level = 'TRACE' if WebDriver.logger.level == :debug
211212
options.add_argument('--headless') if ENV['HEADLESS']
212213
options.binary ||= ENV['FIREFOX_BINARY'] if ENV.key?('FIREFOX_BINARY')
213214
options

0 commit comments

Comments
 (0)