diff --git a/examples/ruby/Gemfile b/examples/ruby/Gemfile index 17d408f72607..dd23c86ad048 100644 --- a/examples/ruby/Gemfile +++ b/examples/ruby/Gemfile @@ -7,5 +7,5 @@ gem 'rake', '~> 13.0' gem 'rspec', '~> 3.0' gem 'rubocop', '~> 1.35' gem 'rubocop-rspec', '~> 3.0' -gem 'selenium-devtools', '= 0.133.0' -gem 'selenium-webdriver', '= 4.29.1' +gem 'selenium-devtools', '= 0.134.0' +gem 'selenium-webdriver', '= 4.30.0' diff --git a/examples/ruby/spec/actions_api/keys_spec.rb b/examples/ruby/spec/actions_api/keys_spec.rb index 62acfb00e650..50d21b70c662 100644 --- a/examples/ruby/spec/actions_api/keys_spec.rb +++ b/examples/ruby/spec/actions_api/keys_spec.rb @@ -6,7 +6,7 @@ let(:driver) { start_session } let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) } - it 'key down' do + it 'key down', except: {platforn: :linux, reason: 'it only fails on the linux pipeline'} do driver.get 'https://www.selenium.dev/selenium/web/single_text_input.html' wait.until { driver.find_element(id: 'textInput').attribute('autofocus') } @@ -56,8 +56,7 @@ expect(text_field.attribute('value')).to eq 'Selenium!' end - it 'copy and paste', except: {browser: :chrome, - reason: 'https://bugs.chromium.org/p/chromedriver/issues/detail?id=4264'} do + it 'copy and paste' do driver.get 'https://www.selenium.dev/selenium/web/single_text_input.html' wait.until { driver.find_element(id: 'textInput').attribute('autofocus') } diff --git a/examples/ruby/spec/actions_api/mouse_spec.rb b/examples/ruby/spec/actions_api/mouse_spec.rb index 38b2811db0ad..3e3e0b838455 100644 --- a/examples/ruby/spec/actions_api/mouse_spec.rb +++ b/examples/ruby/spec/actions_api/mouse_spec.rb @@ -108,7 +108,7 @@ expect(y_coord).to be_within(1).of(center_y + 11) end - it 'offset from viewport' do + it 'offset from viewport', {platforn: :linux, reason: 'it only fails on the linux pipeline'} do driver.get 'https://www.selenium.dev/selenium/web/mouse_interaction.html' driver.action diff --git a/examples/ruby/spec/bidi/logging_spec.rb b/examples/ruby/spec/bidi/logging_spec.rb index b07b93342628..b60b81a2fc86 100644 --- a/examples/ruby/spec/bidi/logging_spec.rb +++ b/examples/ruby/spec/bidi/logging_spec.rb @@ -1,6 +1,7 @@ require 'spec_helper' -RSpec.describe 'Logging' do +RSpec.describe 'Logging', exclusive: {bidi: true, reason: 'only executed when bidi is enabled'}, + only: {browser: %i[chrome edge firefox]} do let(:driver) { start_bidi_session } let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) } diff --git a/examples/ruby/spec/bidi/network_spec.rb b/examples/ruby/spec/bidi/network_spec.rb new file mode 100644 index 000000000000..660de01030c5 --- /dev/null +++ b/examples/ruby/spec/bidi/network_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +RSpec.describe 'Network', exclusive: {bidi: true, reason: 'only executed when bidi is enabled'}, + only: {browser: %i[chrome edge firefox]} do + let(:driver) { start_bidi_session } + let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) } + + it 'adds an auth handler', skip: 'Do not execute BiDi test' do + driver.network.add_authentication_handler('test', 'test') + driver.navigate.to url_for('basicAuth') + expect(driver.find_element(tag_name: 'h1').text).to eq('authorized') + end +end diff --git a/examples/ruby/spec/drivers/remote_webdriver_spec.rb b/examples/ruby/spec/drivers/remote_webdriver_spec.rb index cc517c421330..96bf44d3cf6c 100644 --- a/examples/ruby/spec/drivers/remote_webdriver_spec.rb +++ b/examples/ruby/spec/drivers/remote_webdriver_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' require 'selenium/server' -RSpec.describe 'Remote WebDriver' do +RSpec.describe 'Remote WebDriver', except: {platform: :macosx, + reason: 'it only fail due to the server in the mac pipeline'} do let(:target_directory) { File.join(Dir.tmpdir, SecureRandom.uuid) } let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) } let(:server) do diff --git a/website_and_docs/content/documentation/webdriver/bidi/network.en.md b/website_and_docs/content/documentation/webdriver/bidi/network.en.md index 989ec39ca556..1cb55e097150 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/network.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/network.en.md @@ -17,6 +17,101 @@ For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Authentication Handlers +Authentication handlers enable you to intercept authentication requests that occur during a network interaction. +These handlers are useful for automating scenarios involving authentication prompts, such as Basic Auth or Digest Auth. +They allow you to programmatically provide credentials or modify the authentication flow. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< gh-codeblock path="examples/ruby/spec/bidi/network_spec.rb#L7-L11" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Request Handlers +Request handlers allow you to intercept and manipulate outgoing network requests before they are sent to the server. +This can be used to modify request headers, change the request body, or block specific requests. +Request handlers are essential for testing and debugging scenarios where you need control over outgoing traffic. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Response Handlers + +Response handlers enable you to intercept and manipulate incoming responses from the server. +They are particularly useful for testing scenarios involving response data, such as verifying or modifying response headers, status codes, or content before it reaches the browser. + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Remove Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Clear Handlers + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/network.ja.md b/website_and_docs/content/documentation/webdriver/bidi/network.ja.md index da4e2d7eb0ee..95a81f748645 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/network.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidi/network.ja.md @@ -5,7 +5,7 @@ weight: 1 description: > These features are related to networking, and are made available via a "network" namespace. aliases: [ - "/documentation/ja/webdriver/bidirectional/bidirectional_w3c/network", + "/documentation/en/webdriver/bidirectional/bidirectional_w3c/network", "/documentation/webdriver/bidirectional/webdriver_bidi/network" ] --- @@ -17,6 +17,101 @@ For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Authentication Handlers +Authentication handlers enable you to intercept authentication requests that occur during a network interaction. +These handlers are useful for automating scenarios involving authentication prompts, such as Basic Auth or Digest Auth. +They allow you to programmatically provide credentials or modify the authentication flow. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< gh-codeblock path="examples/ruby/spec/bidi/network_spec.rb#L7-L11" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Request Handlers +Request handlers allow you to intercept and manipulate outgoing network requests before they are sent to the server. +This can be used to modify request headers, change the request body, or block specific requests. +Request handlers are essential for testing and debugging scenarios where you need control over outgoing traffic. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Response Handlers + +Response handlers enable you to intercept and manipulate incoming responses from the server. +They are particularly useful for testing scenarios involving response data, such as verifying or modifying response headers, status codes, or content before it reaches the browser. + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Remove Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Clear Handlers + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/network.pt-br.md b/website_and_docs/content/documentation/webdriver/bidi/network.pt-br.md index 60338930f815..95a81f748645 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/network.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidi/network.pt-br.md @@ -5,7 +5,7 @@ weight: 1 description: > These features are related to networking, and are made available via a "network" namespace. aliases: [ - "/documentation/pt-br/webdriver/bidirectional/bidirectional_w3c/network", + "/documentation/en/webdriver/bidirectional/bidirectional_w3c/network", "/documentation/webdriver/bidirectional/webdriver_bidi/network" ] --- @@ -17,6 +17,101 @@ For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Authentication Handlers +Authentication handlers enable you to intercept authentication requests that occur during a network interaction. +These handlers are useful for automating scenarios involving authentication prompts, such as Basic Auth or Digest Auth. +They allow you to programmatically provide credentials or modify the authentication flow. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< gh-codeblock path="examples/ruby/spec/bidi/network_spec.rb#L7-L11" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Request Handlers +Request handlers allow you to intercept and manipulate outgoing network requests before they are sent to the server. +This can be used to modify request headers, change the request body, or block specific requests. +Request handlers are essential for testing and debugging scenarios where you need control over outgoing traffic. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Response Handlers + +Response handlers enable you to intercept and manipulate incoming responses from the server. +They are particularly useful for testing scenarios involving response data, such as verifying or modifying response headers, status codes, or content before it reaches the browser. + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Remove Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Clear Handlers + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/network.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/network.zh-cn.md index 4b97ed012af8..95a81f748645 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/network.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/network.zh-cn.md @@ -5,7 +5,7 @@ weight: 1 description: > These features are related to networking, and are made available via a "network" namespace. aliases: [ - "/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/network", + "/documentation/en/webdriver/bidirectional/bidirectional_w3c/network", "/documentation/webdriver/bidirectional/webdriver_bidi/network" ] --- @@ -17,6 +17,101 @@ For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) ## Authentication Handlers +Authentication handlers enable you to intercept authentication requests that occur during a network interaction. +These handlers are useful for automating scenarios involving authentication prompts, such as Basic Auth or Digest Auth. +They allow you to programmatically provide credentials or modify the authentication flow. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< gh-codeblock path="examples/ruby/spec/bidi/network_spec.rb#L7-L11" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Request Handlers +Request handlers allow you to intercept and manipulate outgoing network requests before they are sent to the server. +This can be used to modify request headers, change the request body, or block specific requests. +Request handlers are essential for testing and debugging scenarios where you need control over outgoing traffic. + +### Add Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + ## Response Handlers + +Response handlers enable you to intercept and manipulate incoming responses from the server. +They are particularly useful for testing scenarios involving response data, such as verifying or modifying response headers, status codes, or content before it reaches the browser. + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Remove Handler + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}} + +## Clear Handlers + +{{< tabpane text=true >}} +{{< tab header="Java" >}} +{{< /tab >}} +{{< tab header="Python" >}} +{{< /tab >}} +{{< tab header="CSharp" >}} +{{< /tab >}} +{{< tab header="Ruby" >}} +{{< /tab >}} +{{< tab header="JavaScript" >}} +{{< /tab >}} +{{< tab header="Kotlin" >}} +{{< /tab >}} +{{< /tabpane >}}