From dece61fa4de3dce6880c42d92127fa3d368c729b Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 18 Feb 2025 11:27:04 +0100 Subject: [PATCH 1/5] skip test for rubocop --- rb/spec/integration/selenium/webdriver/bidi/network_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb b/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb index 2819b0eafc0ab..fc8056ff24106 100644 --- a/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb +++ b/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb @@ -145,7 +145,8 @@ class BiDi end end - it 'provides response' do + it 'provides response', except: {browser: :firefox, + reason: 'Provide response parameters are not supported in Firefox'} do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver.bidi) network.add_intercept(phases: [described_class::PHASES[:response_started]]) From 420fc7ba0e3b4b4b9df90c09ecdf239e8f3b271a Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 18 Feb 2025 12:00:38 +0100 Subject: [PATCH 2/5] Add github issue to the reason of skipped tests --- .../selenium/webdriver/bidi/network_spec.rb | 4 ++-- .../selenium/webdriver/network_spec.rb | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb b/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb index fc8056ff24106..e83328dcd33dd 100644 --- a/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb +++ b/rb/spec/integration/selenium/webdriver/bidi/network_spec.rb @@ -145,8 +145,8 @@ class BiDi end end - it 'provides response', except: {browser: :firefox, - reason: 'Provide response parameters are not supported in Firefox'} do + it 'provides response', except: { browser: :firefox, + reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver.bidi) network.add_intercept(phases: [described_class::PHASES[:response_started]]) diff --git a/rb/spec/integration/selenium/webdriver/network_spec.rb b/rb/spec/integration/selenium/webdriver/network_spec.rb index 210e2d2e9d229..c19ec0c94df99 100644 --- a/rb/spec/integration/selenium/webdriver/network_spec.rb +++ b/rb/spec/integration/selenium/webdriver/network_spec.rb @@ -21,8 +21,8 @@ module Selenium module WebDriver - describe Network, exclusive: {bidi: true, reason: 'only executed when bidi is enabled'}, - only: {browser: %i[chrome edge firefox]} do + describe Network, exclusive: { bidi: true, reason: 'only executed when bidi is enabled' }, + only: { browser: %i[chrome edge firefox] } do let(:username) { SpecSupport::RackServer::TestApp::BASIC_AUTH_CREDENTIALS.first } let(:password) { SpecSupport::RackServer::TestApp::BASIC_AUTH_CREDENTIALS.last } @@ -160,7 +160,7 @@ module WebDriver sameSite: 'Strict', expiry: 1234 }) - request.body = ({test: 'example'}) + request.body = ({ test: 'example' }) request.continue end driver.navigate.to url_for('formPage.html') @@ -262,7 +262,9 @@ module WebDriver end end - it 'adds a response handler that provides a response' do + it 'adds a response handler that provides a response', + except: { browser: :firefox, + reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver) network.add_response_handler do |response| @@ -278,7 +280,9 @@ module WebDriver end end - it 'removes a response handler' do + it 'removes a response handler', + except: { browser: :firefox, + reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver) id = network.add_response_handler(&:continue) @@ -288,7 +292,9 @@ module WebDriver end end - it 'clears all response handlers' do + it 'clears all response handlers', + except: { browser: :firefox, + reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver) 2.times { network.add_response_handler(&:continue) } From 1b1bc7692b64f332d0dc21646f94904e32991dd5 Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 18 Feb 2025 14:17:20 +0100 Subject: [PATCH 3/5] Remove guard --- rb/spec/integration/selenium/webdriver/network_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/network_spec.rb b/rb/spec/integration/selenium/webdriver/network_spec.rb index c19ec0c94df99..947fb25a3db85 100644 --- a/rb/spec/integration/selenium/webdriver/network_spec.rb +++ b/rb/spec/integration/selenium/webdriver/network_spec.rb @@ -292,9 +292,7 @@ module WebDriver end end - it 'clears all response handlers', - except: { browser: :firefox, - reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do + it 'clears all response handlers' do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver) 2.times { network.add_response_handler(&:continue) } From ce6a156384cbe8d25428114704a81dd9965a8ba6 Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 18 Feb 2025 16:42:07 +0100 Subject: [PATCH 4/5] Update tests --- rb/spec/integration/selenium/webdriver/network_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/network_spec.rb b/rb/spec/integration/selenium/webdriver/network_spec.rb index 947fb25a3db85..fb08967da3b46 100644 --- a/rb/spec/integration/selenium/webdriver/network_spec.rb +++ b/rb/spec/integration/selenium/webdriver/network_spec.rb @@ -280,9 +280,7 @@ module WebDriver end end - it 'removes a response handler', - except: { browser: :firefox, - reason: 'https://github.com/w3c/webdriver-bidi/issues/747' } do + it 'removes a response handler' do reset_driver!(web_socket_url: true) do |driver| network = described_class.new(driver) id = network.add_response_handler(&:continue) From 917046226131cf30982683926a62ebb9564f48f2 Mon Sep 17 00:00:00 2001 From: aguspe Date: Tue, 18 Feb 2025 19:13:13 +0100 Subject: [PATCH 5/5] Guard firefox test --- rb/spec/integration/selenium/webdriver/action_builder_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rb/spec/integration/selenium/webdriver/action_builder_spec.rb b/rb/spec/integration/selenium/webdriver/action_builder_spec.rb index a997b52fad285..b1edeb6a3a193 100644 --- a/rb/spec/integration/selenium/webdriver/action_builder_spec.rb +++ b/rb/spec/integration/selenium/webdriver/action_builder_spec.rb @@ -317,7 +317,7 @@ module WebDriver end describe '#scroll_by' do - it 'scrolls by given amount' do + it 'scrolls by given amount', except: {browser: :firefox, reason: 'returns false on firefox'} 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.round