-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add preference to enable CDP in Firefox by default #14091
Conversation
PR Review 🔍
|
PR Code Suggestions ✨
|
443a7f7
to
ff112bc
Compare
cd4adff
to
91aee8f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #14091 +/- ##
==========================================
- Coverage 58.48% 57.87% -0.61%
==========================================
Files 86 87 +1
Lines 5270 5403 +133
Branches 220 228 +8
==========================================
+ Hits 3082 3127 +45
- Misses 1968 2048 +80
- Partials 220 228 +8 ☔ View full report in Codecov by Sentry. |
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
@whimboo if we send this command on an old version of Firefox will it fail? Are we creating a new minimum supported version of Firefox with this addition? |
No. Setting this preference for an older version of Firefox is a no-op because |
This pull request supports selenium-webdriver 4.22.0 that enables CDP in Firefox by default. because Firefox 129 deprecates Chrome DevTools Protocol (CDP). selenium-webdriver 4.22.0 enables CDP explicitly by adding "remote.active-protocols"=>3 . - Steps to reproduce and this commit addresses these failures. ```ruby $ bundle update selenium-webdriver --conservative $ git diff main ../Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock index 4e1c049ac0..e05f4b3b3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -512,8 +512,9 @@ GEM google-protobuf (~> 3.25) sass-embedded (1.69.6-x86_64-linux-gnu) google-protobuf (~> 3.25) - selenium-webdriver (4.20.1) + selenium-webdriver (4.22.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) $ cd actionpack $ bin/test test/dispatch/system_testing/driver_test.rb test/dispatch/system_testing/driver_test.rb Running 18 tests in a single process (parallelization threshold is 50) Run options: --seed 58668 .....F Failure: DriverTest#test_define_extra_capabilities_using_firefox [test/dispatch/system_testing/driver_test.rb:127]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:113 .F Failure: DriverTest#test_define_extra_capabilities_using_headless_firefox [test/dispatch/system_testing/driver_test.rb:144]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:130 .......... Finished in 0.007717s, 2332.3654 runs/s, 4794.3066 assertions/s. 18 runs, 37 assertions, 2 failures, 0 errors, 0 skips ``` - Planned Deprecation of CDP in Firefox https://groups.google.com/a/mozilla.org/g/dev-platform/c/Z6Qu3ZT1MJ0?pli=1 - Add preference to enable CDP in Firefox by default SeleniumHQ/selenium#14091 - [rb] Add logger gem as a runtime dependency rails#14082 SeleniumHQ/selenium#14082
This pull request supports selenium-webdriver 4.22.0 that enables CDP in Firefox by default. because Firefox 129 deprecates Chrome DevTools Protocol (CDP). selenium-webdriver 4.22.0 enables CDP explicitly by adding "remote.active-protocols"=>3 . - Steps to reproduce and this commit addresses these failures. ```ruby $ bundle update selenium-webdriver --conservative $ git diff main ../Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock index 4e1c049ac0..e05f4b3b3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -512,8 +512,9 @@ GEM google-protobuf (~> 3.25) sass-embedded (1.69.6-x86_64-linux-gnu) google-protobuf (~> 3.25) - selenium-webdriver (4.20.1) + selenium-webdriver (4.22.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) $ cd actionpack $ bin/test test/dispatch/system_testing/driver_test.rb test/dispatch/system_testing/driver_test.rb Running 18 tests in a single process (parallelization threshold is 50) Run options: --seed 58668 .....F Failure: DriverTest#test_define_extra_capabilities_using_firefox [test/dispatch/system_testing/driver_test.rb:127]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:113 .F Failure: DriverTest#test_define_extra_capabilities_using_headless_firefox [test/dispatch/system_testing/driver_test.rb:144]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:130 .......... Finished in 0.007717s, 2332.3654 runs/s, 4794.3066 assertions/s. 18 runs, 37 assertions, 2 failures, 0 errors, 0 skips ``` - Planned Deprecation of CDP in Firefox https://groups.google.com/a/mozilla.org/g/dev-platform/c/Z6Qu3ZT1MJ0?pli=1 - Add preference to enable CDP in Firefox by default SeleniumHQ/selenium#14091 - [rb] Add logger gem as a runtime dependency rails#14082 SeleniumHQ/selenium#14082
This pull request supports selenium-webdriver 4.22.0 that enables CDP in Firefox by default. because Firefox 129 deprecates Chrome DevTools Protocol (CDP). selenium-webdriver 4.22.0 enables CDP explicitly by adding "remote.active-protocols"=>3 . - Steps to reproduce and this commit addresses these failures. ```ruby $ bundle update selenium-webdriver --conservative $ git diff main ../Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock index 4e1c049ac0..e05f4b3b3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -512,8 +512,9 @@ GEM google-protobuf (~> 3.25) sass-embedded (1.69.6-x86_64-linux-gnu) google-protobuf (~> 3.25) - selenium-webdriver (4.20.1) + selenium-webdriver (4.22.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) $ cd actionpack $ bin/test test/dispatch/system_testing/driver_test.rb test/dispatch/system_testing/driver_test.rb Running 18 tests in a single process (parallelization threshold is 50) Run options: --seed 58668 .....F Failure: DriverTest#test_define_extra_capabilities_using_firefox [test/dispatch/system_testing/driver_test.rb:127]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:113 .F Failure: DriverTest#test_define_extra_capabilities_using_headless_firefox [test/dispatch/system_testing/driver_test.rb:144]: --- expected +++ actual @@ -1 +1 @@ -{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} +{"moz:firefoxOptions"=>{"args"=>["-headless", "--host=127.0.0.1"], "prefs"=>{"remote.active-protocols"=>3, "browser.startup.homepage"=>"http://www.seleniumhq.com/"}}, "browserName"=>"firefox"} bin/test test/dispatch/system_testing/driver_test.rb:130 .......... Finished in 0.007717s, 2332.3654 runs/s, 4794.3066 assertions/s. 18 runs, 37 assertions, 2 failures, 0 errors, 0 skips ``` - Planned Deprecation of CDP in Firefox https://groups.google.com/a/mozilla.org/g/dev-platform/c/Z6Qu3ZT1MJ0?pli=1 - Add preference to enable CDP in Firefox by default SeleniumHQ/selenium#14091 - [rb] Add logger gem as a runtime dependency rails#14082 SeleniumHQ/selenium#14082
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Related to #11736. Ensuring CDP is enabled by default in Firefox.
Motivation and Context
CDP is going to be deprecated in Firefox. Setting this preference will ensure it is enabled by default until its removal. Enabling this will not force Selenium users to pass this preference and avoid any breaking changes.
Types of changes
Checklist
PR Type
Enhancement, Tests
Description
Changes walkthrough 📝
5 files
FirefoxOptions.java
Enable CDP and WebDriver BiDi by default in FirefoxOptions
java/src/org/openqa/selenium/firefox/FirefoxOptions.java
FirefoxOptions.cs
Enable CDP and WebDriver BiDi by default in FirefoxOptions
dotnet/src/webdriver/Firefox/FirefoxOptions.cs
firefox.js
Enable CDP and WebDriver BiDi by default in Firefox Options
javascript/node/selenium-webdriver/firefox.js
options.rb
Enable CDP and WebDriver BiDi by default in Firefox Options
rb/lib/selenium/webdriver/firefox/options.rb
options.py
Enable CDP and WebDriver BiDi by default in Firefox Options
py/selenium/webdriver/firefox/options.py
5 files
options_test.js
Update tests for CDP and WebDriver BiDi preference
javascript/node/selenium-webdriver/test/firefox/options_test.js
driver_spec.rb
Update tests for CDP and WebDriver BiDi preference
rb/spec/unit/selenium/webdriver/firefox/driver_spec.rb
options_spec.rb
Update tests for CDP and WebDriver BiDi preference
rb/spec/unit/selenium/webdriver/firefox/options_spec.rb
firefox_options_tests.py
Update tests for CDP and WebDriver BiDi preference
py/test/unit/selenium/webdriver/firefox/firefox_options_tests.py
new_session_tests.py
Update tests for CDP and WebDriver BiDi preference
py/test/unit/selenium/webdriver/remote/new_session_tests.py
1 files
workspace.xml
Add IntelliJ IDEA workspace configuration
java/.idea/workspace.xml