Skip to content

Commit

Permalink
[rb] update guards for Firefox implementation of scroll wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Oct 26, 2022
1 parent d78c5e8 commit cb0aa85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 11 additions & 8 deletions rb/spec/integration/selenium/webdriver/action_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,9 @@ module WebDriver
end
end

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

Expand All @@ -314,11 +315,11 @@ module WebDriver
end
end

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

driver.action.scroll_by(0, delta_y).perform
sleep 0.5
Expand All @@ -327,8 +328,9 @@ module WebDriver
end
end

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

it 'scrolls from element by given amount with offset' do
it 'scrolls from element by given amount with offset',
except: {browser: :firefox, reason: 'incorrect MoveTargetOutOfBoundsError'} do
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
footer = driver.find_element(tag_name: 'footer')
scroll_origin = WheelActions::ScrollOrigin.element(footer, 0, -50)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def create_firefox_nightly_driver(**opts)
def create_firefox_options(options)
options ||= WebDriver::Options.firefox
options.web_socket_url = true
options.log_level = 'TRACE' if WebDriver.logger.level == :debug
options.add_argument('--headless') if ENV['HEADLESS']
options.binary ||= ENV['FIREFOX_BINARY'] if ENV.key?('FIREFOX_BINARY')
options
Expand Down

0 comments on commit cb0aa85

Please sign in to comment.