Skip to content
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

[rb] create user-friendly method for enabling bidi #14284

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

titusfortner
Copy link
Member

@titusfortner titusfortner commented Jul 19, 2024

User description

This matches what is being done in other languages (#13991)

In general it isn't user friendly that that web_socket_url value to the driver is a boolean, but the response is a string. This provides a more obvious name for users to set the property.

This allows Options class to use #enable_bidi! and #bidi? as the booleans for the options.
Capabilities will return driver.capabilities[:web_socket_url] with either nil or the value of the url.

We ok with my use of bang and predicate here?


PR Type

Enhancement, Tests


Description

  • Added enable_bidi! method to Selenium::WebDriver::Options to set web_socket_url to true.
  • Added bidi? method to check if web_socket_url is enabled.
  • Added integration test for enabling bidi in Chrome options, verifying web_socket_url and bidi? method behavior.
  • Added unit test for enable_bidi! method, verifying setting and querying of bidi option.

Changes walkthrough 📝

Relevant files
Enhancement
options.rb
Add methods to enable and check bidi in options                   

rb/lib/selenium/webdriver/common/options.rb

  • Added enable_bidi! method to set web_socket_url to true.
  • Added bidi? method to check if web_socket_url is enabled.
  • +8/-0     
    Tests
    options_spec.rb
    Add integration test for enabling bidi in Chrome options 

    rb/spec/integration/selenium/webdriver/chrome/options_spec.rb

  • Added integration test for enabling bidi in Chrome options.
  • Verified web_socket_url and bidi? method behavior.
  • +18/-0   
    options_spec.rb
    Add unit test for enable_bidi! method in Chrome options   

    rb/spec/unit/selenium/webdriver/chrome/options_spec.rb

  • Added unit test for enable_bidi! method.
  • Verified setting and querying of bidi option.
  • +12/-0   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Key issues to review

    Code Clarity
    The use of the bang (!) in enable_bidi! suggests that the method could raise an exception or has a dangerous side effect, which does not seem to be the case here. Consider renaming to enable_bidi if there are no such implications.

    Redundant Code
    The double negation in !!@options[:web_socket_url] is redundant. Ruby implicitly treats nil as false in boolean contexts, so @options[:web_socket_url] is sufficient.

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Update the enable_bidi! method to accept and set a URL instead of a boolean

    The method enable_bidi! sets @options[:web_socket_url] to true, which seems
    incorrect as it should likely store a WebSocket URL string instead of a boolean.
    Consider updating this method to accept a URL parameter or fetch it from a
    configuration.

    rb/lib/selenium/webdriver/common/options.rb [95]

    -def enable_bidi!
    -  @options[:web_socket_url] = true
    +def enable_bidi!(url)
    +  @options[:web_socket_url] = url
     end
     
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: This suggestion addresses a potential bug by ensuring that the enable_bidi! method sets a WebSocket URL instead of a boolean, which aligns with the expected behavior of handling a URL.

    9
    Enhancement
    Modify the bidi? method to correctly handle URL strings

    The bidi? method uses a double negation (!!) to convert the value to a boolean. This
    is unnecessary if @options[:web_socket_url] is always a boolean. If
    @options[:web_socket_url] is intended to be a URL string, adjust the method to check
    for nil or an empty string instead.

    rb/lib/selenium/webdriver/common/options.rb [99]

     def bidi?
    -  !!@options[:web_socket_url]
    +  !@options[:web_socket_url].nil? && !@options[:web_socket_url].empty?
     end
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This enhancement ensures that the bidi? method correctly checks for the presence of a WebSocket URL, improving the robustness of the code.

    8
    Possible issue
    Update the test to check for a valid WebSocket URL format

    The test case for enable_bidi! assumes web_socket_url to be a boolean, which
    contradicts the expected behavior of handling a URL. Update the test to check for a
    valid URL format instead of a boolean.

    rb/spec/integration/selenium/webdriver/chrome/options_spec.rb [56]

    -expect(options.web_socket_url).to be true
    +expect(options.web_socket_url).to match(/\Aws:\/\/.+/)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion improves the test case by ensuring it checks for a valid WebSocket URL format, which aligns with the expected behavior of the enable_bidi! method.

    8
    Adjust the unit test to validate that web_socket_url is a properly formatted URL

    Similar to the integration test, the unit test for enable_bidi! should verify that
    web_socket_url is set to a valid URL, not just a boolean. Adjust the expectation to
    validate the format of the URL.

    rb/spec/unit/selenium/webdriver/chrome/options_spec.rb [152]

    -expect(options.web_socket_url).to be true
    +expect(options.web_socket_url).to match(/\Aws:\/\/.+/)
     
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: This suggestion enhances the unit test by verifying that web_socket_url is a valid URL, ensuring consistency with the expected behavior of the enable_bidi! method.

    8

    Copy link

    codiumai-pr-agent-pro bot commented Jul 19, 2024

    CI Failure Feedback 🧐

    (Checks updated until commit 8dc3ccb)

    Action: Ruby / Local Tests (chrome, windows) / Local Tests (chrome, windows)

    Failed stage: Run Bazel [❌]

    Failed test name: Selenium::WebDriver::Chrome::Options enables bidi

    Failure summary:

    The action failed because the test Selenium::WebDriver::Chrome::Options enables bidi failed. The
    test failed due to a LoadError when attempting to create a new Chrome WebDriver instance with the
    specified options. This error occurred in the following sequence of method calls:

  • Selenium::WebDriver.for :chrome, options: options
  • Selenium::WebDriver::Common::Driver.for
  • Selenium::WebDriver::Common::Driver.new
  • Selenium::WebDriver::Chrome::Driver.initialize
  • Selenium::WebDriver::Common::Driver.initialize
  • Selenium::WebDriver::Common::Driver.create_bridge

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Microsoft Windows Server 2022
    ...
    
    542:  �[32mAnalyzing:�[0m 29 targets (353 packages loaded, 10653 targets configured)
    543:  �[32m[1 / 1]�[0m checking cached actions
    544:  �[32mAnalyzing:�[0m 29 targets (354 packages loaded, 10653 targets configured)
    545:  �[32m[1 / 1]�[0m checking cached actions
    546:  �[32mAnalyzing:�[0m 29 targets (354 packages loaded, 37684 targets configured)
    547:  �[32m[1 / 21]�[0m [Prepa] Writing repo mapping manifest for //rb/spec/integration/selenium/webdriver:window-chrome
    548:  �[32mINFO: �[0mAnalyzed 29 targets (354 packages loaded, 37684 targets configured).
    549:  �[32m[9 / 33]�[0m [Prepa] Writing repo mapping manifest for //rb/spec/integration/selenium/webdriver:target_locator-chrome
    550:  �[32m[22 / 48]�[0m Creating source manifest for //rb/spec/integration/selenium/webdriver:error-chrome; 0s local ... (3 actions, 2 running)
    ...
    
    683:  �[32m[1,873 / 1,893]�[0m 4 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:service-chrome; 10s disk-cache ... (4 actions, 1 running)
    684:  �[32m[1,873 / 1,893]�[0m 4 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:service-chrome; 15s disk-cache ... (4 actions, 1 running)
    685:  �[32m[1,874 / 1,893]�[0m 5 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:target_locator-chrome; 12s disk-cache ... (4 actions, 1 running)
    686:  �[32m[1,874 / 1,893]�[0m 5 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:target_locator-chrome; 17s disk-cache ... (4 actions, 1 running)
    687:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:target_locator-chrome; 19s disk-cache ... (4 actions, 0 running)
    688:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:profile-chrome; 15s disk-cache ... (4 actions, 0 running)
    689:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:profile-chrome; 16s disk-cache ... (4 actions, 1 running)
    690:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:profile-chrome; 23s disk-cache ... (4 actions, 1 running)
    691:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:error-chrome; 19s disk-cache ... (4 actions, 1 running)
    692:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:shadow_root-chrome; 16s disk-cache ... (4 actions, 1 running)
    693:  �[32m[1,875 / 1,893]�[0m 6 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:shadow_root-chrome; 17s disk-cache ... (4 actions, 2 running)
    694:  �[32m[1,876 / 1,893]�[0m 7 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver:shadow_root-chrome; 19s disk-cache ... (4 actions, 1 running)
    695:  �[32m[1,876 / 1,893]�[0m 7 / 29 tests;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver:error-chrome ... (4 actions, 1 running)
    ...
    
    724:  �[32m[1,882 / 1,893]�[0m 13 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 55s local, disk-cache ... (4 actions, 3 running)
    725:  �[32m[1,883 / 1,893]�[0m 14 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 57s local, disk-cache ... (4 actions, 2 running)
    726:  �[32m[1,883 / 1,893]�[0m 14 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 62s local, disk-cache ... (4 actions, 2 running)
    727:  �[32m[1,884 / 1,893]�[0m 15 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 64s local, disk-cache ... (4 actions, 1 running)
    728:  �[32m[1,884 / 1,893]�[0m 15 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 69s local, disk-cache ... (4 actions, 1 running)
    729:  �[32m[1,884 / 1,893]�[0m 15 / 29 tests;�[0m Testing //rb/spec/integration/selenium/webdriver/chrome:options-chrome; 73s local, disk-cache ... (4 actions, 2 running)
    730:  �[31m�[1mFAIL: �[0m//rb/spec/integration/selenium/webdriver/chrome:options-chrome (see D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/integration/selenium/webdriver/chrome/options-chrome/test.log)
    731:  ==================== Test output for //rb/spec/integration/selenium/webdriver/chrome:options-chrome:
    732:  �[31m�[1mFAILED: �[0m//rb/spec/integration/selenium/webdriver/chrome:options-chrome (Summary)
    ...
    
    741:  platform: windows
    742:  ci: github
    743:  rbe: false
    744:  ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x64-mingw32]
    745:  Selenium::WebDriver::Chrome::Options
    746:  passes emulated device correctly
    747:  passes emulated user agent correctly
    748:  passes args correctly
    749:  enables bidi (FAILED - 1)
    750:  Failures:
    751:  1) Selenium::WebDriver::Chrome::Options enables bidi
    752:  Failure/Error: driver = Selenium::WebDriver.for :chrome, options: options
    753:  LoadError:
    ...
    
    758:  # ./rb/lib/selenium/webdriver/common/driver.rb:322:in `create_bridge'
    759:  # ./rb/lib/selenium/webdriver/common/driver.rb:73:in `initialize'
    760:  # ./rb/lib/selenium/webdriver/chrome/driver.rb:35:in `initialize'
    761:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `new'
    762:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `for'
    763:  # ./rb/lib/selenium/webdriver.rb:89:in `for'
    764:  # ./rb/spec/integration/selenium/webdriver/chrome/options_spec.rb:58:in `block (2 levels) in <module:Chrome>'
    765:  Finished in 8.67 seconds (files took 0.62253 seconds to load)
    766:  4 examples, 1 failure
    767:  Failed examples:
    ...
    
    775:  platform: windows
    776:  ci: github
    777:  rbe: false
    778:  ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x64-mingw32]
    779:  Selenium::WebDriver::Chrome::Options
    780:  passes emulated device correctly
    781:  passes emulated user agent correctly
    782:  passes args correctly
    783:  enables bidi (FAILED - 1)
    784:  Failures:
    785:  1) Selenium::WebDriver::Chrome::Options enables bidi
    786:  Failure/Error: driver = Selenium::WebDriver.for :chrome, options: options
    787:  LoadError:
    ...
    
    792:  # ./rb/lib/selenium/webdriver/common/driver.rb:322:in `create_bridge'
    793:  # ./rb/lib/selenium/webdriver/common/driver.rb:73:in `initialize'
    794:  # ./rb/lib/selenium/webdriver/chrome/driver.rb:35:in `initialize'
    795:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `new'
    796:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `for'
    797:  # ./rb/lib/selenium/webdriver.rb:89:in `for'
    798:  # ./rb/spec/integration/selenium/webdriver/chrome/options_spec.rb:58:in `block (2 levels) in <module:Chrome>'
    799:  Finished in 8.43 seconds (files took 0.6376 seconds to load)
    800:  4 examples, 1 failure
    801:  Failed examples:
    ...
    
    809:  platform: windows
    810:  ci: github
    811:  rbe: false
    812:  ruby: ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x64-mingw32]
    813:  Selenium::WebDriver::Chrome::Options
    814:  passes emulated device correctly
    815:  passes emulated user agent correctly
    816:  passes args correctly
    817:  enables bidi (FAILED - 1)
    818:  Failures:
    819:  1) Selenium::WebDriver::Chrome::Options enables bidi
    820:  Failure/Error: driver = Selenium::WebDriver.for :chrome, options: options
    821:  LoadError:
    ...
    
    826:  # ./rb/lib/selenium/webdriver/common/driver.rb:322:in `create_bridge'
    827:  # ./rb/lib/selenium/webdriver/common/driver.rb:73:in `initialize'
    828:  # ./rb/lib/selenium/webdriver/chrome/driver.rb:35:in `initialize'
    829:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `new'
    830:  # ./rb/lib/selenium/webdriver/common/driver.rb:47:in `for'
    831:  # ./rb/lib/selenium/webdriver.rb:89:in `for'
    832:  # ./rb/spec/integration/selenium/webdriver/chrome/options_spec.rb:58:in `block (2 levels) in <module:Chrome>'
    833:  ================================================================================
    834:  �[32m[1,885 / 1,893]�[0m 16 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:listener-chrome; 12s disk-cache ... (4 actions, 1 running)
    835:  �[32m[1,885 / 1,893]�[0m 16 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver/remote:driver-chrome; 8s ... (4 actions, 1 running)
    836:  �[32m[1,885 / 1,893]�[0m 16 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:manager-chrome; 5s local, disk-cache ... (4 actions, 2 running)
    837:  �[32m[1,886 / 1,893]�[0m 17 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:select-chrome; 5s disk-cache ... (4 actions, 1 running)
    838:  �[32m[1,886 / 1,893]�[0m 17 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:select-chrome; 8s disk-cache ... (4 actions, 2 running)
    839:  �[32m[1,887 / 1,893]�[0m 18 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:select-chrome; 9s disk-cache ... (4 actions, 1 running)
    840:  �[32m[1,887 / 1,893]�[0m 18 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:select-chrome; 15s disk-cache ... (4 actions, 1 running)
    841:  �[32m[1,888 / 1,893]�[0m 19 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:select-chrome; 16s disk-cache ... (4 actions, 0 running)
    842:  �[32m[1,888 / 1,893]�[0m 19 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/remote:element-chrome; 11s disk-cache ... (4 actions, 1 running)
    843:  �[32m[1,888 / 1,893]�[0m 19 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/remote:element-chrome; 20s disk-cache ... (4 actions, 1 running)
    844:  �[32m[1,888 / 1,893]�[0m 19 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:zipper-chrome; 20s disk-cache ... (4 actions, 1 running)
    845:  �[32m[1,889 / 1,893]�[0m 20 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:zipper-chrome; 21s disk-cache ... (4 actions, 1 running)
    846:  �[32m[1,889 / 1,893]�[0m 20 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:timeout-chrome; 17s disk-cache ... (4 actions, 1 running)
    847:  �[32m[1,889 / 1,893]�[0m 20 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/remote:element-chrome; 7s local, disk-cache ... (4 actions, 1 running)
    848:  �[32m[1,890 / 1,893]�[0m 21 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:storage-chrome; 7s disk-cache ... (3 actions, 1 running)
    849:  �[32m[1,890 / 1,893]�[0m 21 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:storage-chrome; 10s disk-cache ... (3 actions, 2 running)
    850:  �[32m[1,891 / 1,893]�[0m 22 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:storage-chrome; 11s disk-cache ... (2 actions, 1 running)
    851:  �[32m[1,891 / 1,893]�[0m 22 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:timeout-chrome; 3s local, disk-cache ... (2 actions, 1 running)
    852:  �[32m[1,891 / 1,893]�[0m 22 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:timeout-chrome; 11s local, disk-cache ... (2 actions running)
    853:  �[32m[1,892 / 1,893]�[0m 23 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:storage-chrome; 1s local, disk-cache
    854:  �[32m[1,892 / 1,893]�[0m 23 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:storage-chrome; 6s local, disk-cache
    855:  �[32m[1,893 / 1,894]�[0m 24 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:script-chrome; 0s disk-cache
    856:  �[32m[1,893 / 1,894]�[0m 24 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver/bidi:script-chrome
    857:  �[32m[1,893 / 1,894]�[0m 24 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:script-chrome; 1s local, disk-cache
    858:  �[32m[1,893 / 1,894]�[0m 24 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:script-chrome; 3s local, disk-cache
    859:  �[32m[1,894 / 1,895]�[0m 25 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:bidi-chrome; 0s disk-cache
    860:  �[32m[1,894 / 1,895]�[0m 25 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver:bidi-chrome
    861:  �[32m[1,894 / 1,895]�[0m 25 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:bidi-chrome; 1s local, disk-cache
    862:  �[32m[1,894 / 1,895]�[0m 25 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:bidi-chrome; 3s local, disk-cache
    863:  �[32m[1,895 / 1,896]�[0m 26 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:browsing_context-chrome; 0s disk-cache
    864:  �[32m[1,895 / 1,896]�[0m 26 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver/bidi:browsing_context-chrome
    865:  �[32m[1,895 / 1,896]�[0m 26 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:browsing_context-chrome; 1s local, disk-cache
    866:  �[32m[1,895 / 1,896]�[0m 26 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:browsing_context-chrome; 3s local, disk-cache
    867:  �[32m[1,896 / 1,897]�[0m 27 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:devtools-chrome; 0s disk-cache
    868:  �[32m[1,896 / 1,897]�[0m 27 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver:devtools-chrome
    869:  �[32m[1,896 / 1,897]�[0m 27 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:devtools-chrome; 1s local, disk-cache
    870:  �[32m[1,896 / 1,897]�[0m 27 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver:devtools-chrome; 140s local, disk-cache
    871:  �[32m[1,897 / 1,898]�[0m 28 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:log_inspector-chrome; 0s disk-cache
    872:  �[32m[1,897 / 1,898]�[0m 28 / 29 tests, �[31m�[1m1 failed�[0m;�[0m [Sched] Testing //rb/spec/integration/selenium/webdriver/bidi:log_inspector-chrome
    873:  �[32m[1,897 / 1,898]�[0m 28 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:log_inspector-chrome; 1s local, disk-cache
    874:  �[32m[1,897 / 1,898]�[0m 28 / 29 tests, �[31m�[1m1 failed�[0m;�[0m Testing //rb/spec/integration/selenium/webdriver/bidi:log_inspector-chrome; 3s local, disk-cache
    875:  �[32mINFO: �[0mFound 29 test targets...
    876:  �[32mINFO: �[0mElapsed time: 807.039s, Critical Path: 349.71s
    877:  �[32mINFO: �[0m1898 processes: 983 disk cache hit, 841 internal, 74 local.
    878:  �[32mINFO: �[0mBuild completed, 1 test FAILED, 1898 total actions
    879:  //rb/spec/integration/selenium/webdriver:action_builder-chrome           �[0m�[32mPASSED�[0m in 16.7s
    880:  //rb/spec/integration/selenium/webdriver:bidi-chrome                     �[0m�[32mPASSED�[0m in 3.1s
    881:  //rb/spec/integration/selenium/webdriver:devtools-chrome                 �[0m�[32mPASSED�[0m in 140.0s
    882:  //rb/spec/integration/selenium/webdriver:driver-chrome                   �[0m�[32mPASSED�[0m in 16.1s
    883:  //rb/spec/integration/selenium/webdriver:element-chrome                  �[0m�[32mPASSED�[0m in 34.2s
    884:  //rb/spec/integration/selenium/webdriver:error-chrome                    �[0m�[32mPASSED�[0m in 4.6s
    ...
    
    899:  //rb/spec/integration/selenium/webdriver/bidi:browsing_context-chrome    �[0m�[32mPASSED�[0m in 3.0s
    900:  //rb/spec/integration/selenium/webdriver/bidi:log_inspector-chrome       �[0m�[32mPASSED�[0m in 3.0s
    901:  //rb/spec/integration/selenium/webdriver/bidi:script-chrome              �[0m�[32mPASSED�[0m in 3.1s
    902:  //rb/spec/integration/selenium/webdriver/chrome:driver-chrome            �[0m�[32mPASSED�[0m in 33.3s
    903:  //rb/spec/integration/selenium/webdriver/chrome:profile-chrome           �[0m�[32mPASSED�[0m in 4.1s
    904:  //rb/spec/integration/selenium/webdriver/chrome:service-chrome           �[0m�[32mPASSED�[0m in 6.0s
    905:  //rb/spec/integration/selenium/webdriver/remote:driver-chrome            �[0m�[32mPASSED�[0m in 3.8s
    906:  //rb/spec/integration/selenium/webdriver/remote:element-chrome           �[0m�[32mPASSED�[0m in 7.6s
    907:  //rb/spec/integration/selenium/webdriver/chrome:options-chrome           �[0m�[31m�[1mFAILED�[0m in 3 out of 3 in 11.4s
    908:  Stats over 3 runs: max = 11.4s, min = 10.3s, avg = 10.8s, dev = 0.4s
    909:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/integration/selenium/webdriver/chrome/options-chrome/test.log
    910:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/integration/selenium/webdriver/chrome/options-chrome/test_attempts/attempt_1.log
    911:  D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/integration/selenium/webdriver/chrome/options-chrome/test_attempts/attempt_2.log
    912:  Executed 29 out of 29 tests: 28 tests pass and �[0m�[31m�[1m1 fails locally�[0m.
    913:  There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
    914:  �[0m
    915:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    @@ -91,6 +91,14 @@ def add_option(name, value = nil)
    @options[name] = value
    end

    def enable_bidi!
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Can we allow passing it to the constructor as well?

    Selenium::WebDriver::Options.chrome(bidi: true)

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants