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

[dotnet] implement WebDriver BiDi with WebDriverBiDi dependency #14052

Draft
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

titusfortner
Copy link
Member

@titusfortner titusfortner commented May 29, 2024

This PR is to evaluate the high level API

Status

This is in draft because:

  • We haven't committed to using WebDriver BiDi package
  • WebDriver BiDi package might be changing its implementation

Description

  • Adds the WebDriver BiDi package dependency
  • BiDi is disabled in tests by default
  • Starts a BiDi session if webSocketUrl is set
  • Implements all the Navigation commands with conditionals for whether BiDi is present
  • Implements PageLoadStrategy waits
  • Bazel pieces are all properly wired up now

Motivation and Context

.NET implementation of #13995
The conditionals in each method are not the most elegant, but they are straightforward, and I think that's preferred.
It'll be easy enough to just remove the conditionals (and probably the Sync methods as well) when we remove support for WebDriver classic (likely Selenium 6)

Considerations

This sidesteps updating browsingContextId from context changes; we'll handle that separately
Still need to sort out creating new bidi bazel targets properly

attn: @YevgeniyShunevych

@titusfortner titusfortner added C-dotnet C-devtools BiDi or Chrome DevTools related issues labels May 29, 2024
Copy link

codiumai-pr-agent-pro bot commented May 29, 2024

CI Failure Feedback 🧐

(Checks updated until commit 69c568e)

Action: .NET / Build / Build

Failed stage: Run Bazel [❌]

Failure summary:

The action failed due to an error in generating the Descriptor Set for the proto_library target
@@protobuf~//:wrappers_proto. The specific error encountered was:

  • protoc.exe failed with exit code -1073741819 while executing the GenProtoDescriptorSet command.
  • This error occurred in the file D:/_bazel/external/protobuf~/BUILD.bazel at line 334.
  • The same error was also reported in the file D:/a/selenium/selenium/dotnet/BUILD.bazel at line 16.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Microsoft Windows Server 2022
    ...
    
    645:  �[32m[998 / 1,818]�[0m Compiling src/google/protobuf/compiler/csharp/csharp_message_field.cc [for tool]; 1s local ... (4 actions running)
    646:  �[32m[999 / 1,818]�[0m Compiling src/google/protobuf/compiler/csharp/csharp_message.cc [for tool]; 2s local ... (4 actions, 3 running)
    647:  �[32m[1,002 / 1,818]�[0m Compiling src/google/protobuf/compiler/csharp/csharp_generator.cc [for tool]; 1s local ... (4 actions running)
    648:  �[32m[1,008 / 1,818]�[0m Compiling src/google/protobuf/compiler/csharp/csharp_field_base.cc [for tool]; 2s local ... (3 actions running)
    649:  �[32m[1,010 / 1,818]�[0m Building Python zip: //common/devtools:pdl_to_json [for tool]; 2s local ... (3 actions running)
    650:  �[32m[1,011 / 1,818]�[0m Building Python zip: //common/devtools:pdl_to_json [for tool]; 4s local ... (4 actions, 2 running)
    651:  �[32m[1,012 / 1,818]�[0m Building Python zip: @rules_pkg//pkg/private/zip:build_zip [for tool]; 4s local ... (4 actions, 3 running)
    652:  �[32m[1,013 / 1,818]�[0m Generating Descriptor Set proto_library @@protobuf~//:wrappers_proto [for tool]; 2s local ... (4 actions running)
    653:  �[31m�[1mERROR: �[0mD:/_bazel/external/protobuf~/BUILD.bazel:334:14: Generating Descriptor Set proto_library @@protobuf~//:wrappers_proto [for tool] failed: (Exit -1073741819): protoc.exe failed: error executing GenProtoDescriptorSet command (from target @@protobuf~//:wrappers_proto) 
    654:  cd /d D:/_bazel/execroot/_main
    655:  SET PATH=C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0
    656:  bazel-out\x64_windows-opt-exec-ST-4eedf4a3b688\bin\external\protobuf~\protoc.exe --direct_dependencies google/protobuf/wrappers.proto --direct_dependencies_violation_msg=%s is imported, but @@protobuf~//:wrappers_proto doesn't directly depend on a proto_library that 'srcs' it. --descriptor_set_out=bazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/wrappers_proto-descriptor-set.proto.bin -Ibazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/_virtual_imports/wrappers_proto -I. bazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/_virtual_imports/wrappers_proto/google/protobuf/wrappers.proto
    657:  # Configuration: 1075c357ba75bcaba7126b237c516e8d71025d7ae1776dfec5e4ad27ad637ebb
    658:  # Execution platform: @@local_config_platform//:host
    659:  �[31m�[1mERROR: �[0mD:/a/selenium/selenium/dotnet/BUILD.bazel:16:8 PackageZip dotnet/release.zip failed: (Exit -1073741819): protoc.exe failed: error executing GenProtoDescriptorSet command (from target @@protobuf~//:wrappers_proto) 
    660:  cd /d D:/_bazel/execroot/_main
    661:  SET PATH=C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0
    662:  bazel-out\x64_windows-opt-exec-ST-4eedf4a3b688\bin\external\protobuf~\protoc.exe --direct_dependencies google/protobuf/wrappers.proto --direct_dependencies_violation_msg=%s is imported, but @@protobuf~//:wrappers_proto doesn't directly depend on a proto_library that 'srcs' it. --descriptor_set_out=bazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/wrappers_proto-descriptor-set.proto.bin -Ibazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/_virtual_imports/wrappers_proto -I. bazel-out/x64_windows-opt-exec-ST-4eedf4a3b688/bin/external/protobuf~/_virtual_imports/wrappers_proto/google/protobuf/wrappers.proto
    663:  # Configuration: 1075c357ba75bcaba7126b237c516e8d71025d7ae1776dfec5e4ad27ad637ebb
    664:  # Execution platform: @@local_config_platform//:host
    665:  �[32mINFO: �[0mElapsed time: 246.612s, Critical Path: 36.75s
    666:  �[32mINFO: �[0m1017 processes: 809 internal, 204 local, 4 worker.
    667:  �[31m�[1mERROR: �[0mBuild did NOT complete successfully
    668:  �[0m
    669:  ##[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.

    Copy link
    Member

    @nvborisenko nvborisenko left a comment

    Choose a reason for hiding this comment

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

    We should not introduce new external dependencies.

    Base automatically changed from dotnet_async_new to trunk June 6, 2024 19:28
    @titusfortner titusfortner changed the base branch from trunk to dotnet_bidi_depend June 7, 2024 13:05
    @titusfortner titusfortner changed the base branch from dotnet_bidi_depend to trunk June 7, 2024 13:07
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    C-devtools BiDi or Chrome DevTools related issues C-dotnet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    None yet

    2 participants