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] [bidi] Second round of BiDi implementation #14566

Merged
merged 69 commits into from
Oct 27, 2024

Conversation

nvborisenko
Copy link
Member

@nvborisenko nvborisenko commented Oct 4, 2024

User description

Description

This is implementation of new core concepts in BiDi world mapped to .Net. Including new unit tests.

Motivation and Context

Addresses #14530

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement, Tests


Description

  • Implemented new core concepts in the BiDi world mapped to .Net, including enabling nullable reference types across various modules.
  • Added extensive unit tests covering functionalities such as context creation, navigation, network intercepts, script command parameters, and more.
  • Refactored and enhanced type handling for RemoteValue, LocalValue, and other related classes.
  • Updated method signatures and return types to improve consistency and support new features.
  • Introduced new JSON converters for handling serialization and deserialization of complex types.

Changes walkthrough 📝

Relevant files
Enhancement
148 files
RemoteValue.cs
Refactor and enhance RemoteValue type handling                     

dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs

  • Enabled nullable reference types.
  • Updated JsonDerivedType attributes to use simplified type names.
  • Modified implicit operators and type conversion logic.
  • Refactored record definitions for various RemoteValue types.
  • +161/-145
    BrowsingContext.cs
    Update BrowsingContext method calls and types                       

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContext.cs

  • Enabled nullable reference types.
  • Updated method calls to use BiDi.BrowsingContext instead of
    BiDi.BrowsingContextModule.
  • Changed return type of LocateNodesAsync.
  • +29/-27 
    SequentialSourceActions.cs
    Implement SequentialSourceActions for input handling         

    dotnet/src/webdriver/BiDi/Modules/Input/SequentialSourceActions.cs

  • Added interface and record definitions for sequential source actions.
  • Implemented methods for various input actions like pause and type.
  • +161/-0 
    ScriptModule.cs
    Enhance ScriptModule with nullable types and events           

    dotnet/src/webdriver/BiDi/Modules/Script/ScriptModule.cs

  • Enabled nullable reference types.
  • Updated method signatures for EvaluateAsync and CallFunctionAsync.
  • Added subscription methods for script events.
  • +55/-10 
    SourceActions.cs
    Define input SourceActions for various input types             

    dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs

  • Added abstract records and interfaces for input source actions.
  • Defined specific actions for keys, pointers, and wheels.
  • +155/-0 
    LocalValue.cs
    Refactor LocalValue types and conversion logic                     

    dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs

  • Enabled nullable reference types.
  • Refactored LocalValue and its derived types.
  • Simplified type conversion and record definitions.
  • +54/-35 
    BiDi.cs
    Enable nullable types and update module properties             

    dotnet/src/webdriver/BiDi/BiDi.cs

  • Enabled nullable reference types.
  • Updated property names for module access.
  • +4/-53   
    RemoteValueConverter.cs
    Update RemoteValueConverter for nullable types                     

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs

  • Enabled nullable reference types.
  • Updated deserialization logic for RemoteValue types.
  • +32/-23 
    RealmInfo.cs
    Refactor RealmInfo types with nullable support                     

    dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs

  • Enabled nullable reference types.
  • Refactored RealmInfo and its derived types.
  • +23/-22 
    BrowsingContextScriptModule.cs
    Update BrowsingContextScriptModule for nullable types       

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs

  • Enabled nullable reference types.
  • Updated method signatures for script evaluation and function calls.
  • +16/-7   
    NetworkModule.cs
    Enhance NetworkModule with nullable types and auth handling

    dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.cs

  • Enabled nullable reference types.
  • Updated method names and parameters for authentication handling.
  • +12/-5   
    Intercept.cs
    Refactor Intercept class with nullable support                     

    dotnet/src/webdriver/BiDi/Modules/Network/Intercept.cs

  • Enabled nullable reference types.
  • Refactored subscription handling for network intercepts.
  • +13/-11 
    Locator.cs
    Refactor Locator types with nullable support                         

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs

  • Enabled nullable reference types.
  • Refactored Locator and its derived types.
  • +21/-29 
    Broker.cs
    Update Broker with nullable types and serialization           

    dotnet/src/webdriver/BiDi/Communication/Broker.cs

  • Enabled nullable reference types.
  • Updated Broker constructor and serializer options.
  • +12/-2   
    PerformActionsCommand.cs
    Simplify PerformActionsCommandParameters definition           

    dotnet/src/webdriver/BiDi/Modules/Input/PerformActionsCommand.cs

    • Simplified PerformActionsCommandParameters definition.
    +4/-66   
    GetCookiesCommand.cs
    Refactor GetCookiesCommand for nullable types                       

    dotnet/src/webdriver/BiDi/Modules/Storage/GetCookiesCommand.cs

  • Enabled nullable reference types.
  • Refactored GetCookiesResult to implement IReadOnlyList.
  • +33/-10 
    RealmInfoConverter.cs
    Update RealmInfoConverter for nullable types                         

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs

  • Enabled nullable reference types.
  • Updated deserialization logic for RealmInfo types.
  • +10/-8   
    BrowsingContextModule.cs
    Update BrowsingContextModule for nullable types                   

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs

  • Enabled nullable reference types.
  • Updated LocateNodesAsync return type.
  • +4/-4     
    BrowsingContextNetworkModule.cs
    Update BrowsingContextNetworkModule for nullable and method renaming.

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextNetworkModule.cs

  • Enabled nullable reference types.
  • Renamed InterceptAuthenticationAsync to InterceptAuthAsync.
  • Changed OnAuthRequiredAsync method to be public.
  • Added an overload for OnAuthRequiredAsync with an Action parameter.
  • +9/-2     
    ProxyConfiguration.cs
    Simplify and update ProxyConfiguration with nullable types.

    dotnet/src/webdriver/BiDi/Modules/Session/ProxyConfiguration.cs

  • Enabled nullable reference types.
  • Simplified proxy configuration class names.
  • Converted proxy configuration classes to nested records.
  • +22/-19 
    InputSourceActionsConverter.cs
    Implement InputSourceActionsConverter for JSON serialization.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs

  • Added a new JSON converter for SourceActions.
  • Implemented serialization logic for different action types.
  • +61/-0   
    UrlPattern.cs
    Simplify UrlPattern class and enable nullable types.         

    dotnet/src/webdriver/BiDi/Modules/Network/UrlPattern.cs

  • Enabled nullable reference types.
  • Simplified class names for URL pattern types.
  • Added implicit conversion from string to UrlPattern.
  • +17/-17 
    LogEntryConverter.cs
    Update LogEntryConverter for new log entry types.               

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs

  • Enabled nullable reference types.
  • Updated LogEntryConverter to use new log entry types.
  • +7/-5     
    ContinueWithAuthCommand.cs
    Simplify ContinueWithAuthCommand and enable nullable types.

    dotnet/src/webdriver/BiDi/Modules/Network/ContinueWithAuthCommand.cs

  • Enabled nullable reference types.
  • Simplified class names for authentication continuation parameters.
  • +11/-8   
    AddPreloadScriptCommand.cs
    Update AddPreloadScriptCommand for nullable types.             

    dotnet/src/webdriver/BiDi/Modules/Script/AddPreloadScriptCommand.cs

  • Enabled nullable reference types.
  • Updated types for Arguments property in preload script command.
  • +5/-3     
    BrowsingContextLogModule.cs
    Update BrowsingContextLogModule for new Entry type.           

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs

  • Enabled nullable reference types.
  • Updated OnEntryAddedAsync method to use new Entry type.
  • +4/-2     
    BrowsingContextStorageModule.cs
    Update BrowsingContextStorageModule for partition descriptor.

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextStorageModule.cs

  • Enabled nullable reference types.
  • Updated partition descriptor usage in cookie methods.
  • +5/-3     
    RealmTypeConverter.cs
    Implement Write method in RealmTypeConverter.                       

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs

  • Enabled nullable reference types.
  • Implemented Write method for RealmTypeConverter.
  • +16/-1   
    EvaluateCommand.cs
    Update EvaluateCommand for nullable and realm inclusion. 

    dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs

  • Enabled nullable reference types.
  • Updated EvaluateResult to include Realm.
  • +12/-6   
    WebSocketTransport.cs
    Update WebSocketTransport for nullable and logging.           

    dotnet/src/webdriver/BiDi/Communication/Transport/WebSocketTransport.cs

  • Enabled nullable reference types.
  • Removed buffer length logging in trace.
  • +4/-2     
    InputModule.cs
    Update InputModule for nullable and actions parameter.     

    dotnet/src/webdriver/BiDi/Modules/Input/InputModule.cs

  • Enabled nullable reference types.
  • Updated PerformActionsAsync to accept IEnumerable.
  • +6/-8     
    BrowserModule.cs
    Update BrowserModule for nullable and user contexts result.

    dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs

  • Enabled nullable reference types.
  • Updated GetUserContextsAsync to return GetUserContextsResult.
  • +4/-4     
    Entry.cs
    Add Entry record and Level enum for logs.                               

    dotnet/src/webdriver/BiDi/Modules/Log/Entry.cs

  • Added new Entry record with Console and Javascript types.
  • Defined Level enum for log levels.
  • +30/-0   
    CaptureScreenshotCommand.cs
    Simplify CaptureScreenshotCommand and enable nullable types.

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs

  • Enabled nullable reference types.
  • Simplified class names for clip rectangle types.
  • +9/-6     
    LocateNodesCommand.cs
    Update LocateNodesCommand for nullable and list implementation.

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs

  • Enabled nullable reference types.
  • Updated LocateNodesResult to implement IReadOnlyList.
  • +20/-1   
    GetRealmsCommand.cs
    Update GetRealmsCommand for nullable and list implementation.

    dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs

  • Enabled nullable reference types.
  • Updated GetRealmsResult to implement IReadOnlyList.
  • +20/-1   
    InputOriginConverter.cs
    Implement InputOriginConverter for JSON serialization.     

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs

  • Added new JSON converter for Origin.
  • Implemented serialization logic for different origin types.
  • +36/-0   
    EvaluateResultConverter.cs
    Update EvaluateResultConverter for new result types.         

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs

  • Enabled nullable reference types.
  • Updated EvaluateResultConverter to use new result types.
  • +4/-2     
    GetUserContextsCommand.cs
    Update GetUserContextsCommand for nullable and list implementation.

    dotnet/src/webdriver/BiDi/Modules/Browser/GetUserContextsCommand.cs

  • Enabled nullable reference types.
  • Updated GetUserContextsResult to implement IReadOnlyList.
  • +20/-1   
    GetCookiesResultConverter.cs
    Implement GetCookiesResultConverter for JSON deserialization.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs

  • Added new JSON converter for GetCookiesResult.
  • Implemented deserialization logic for cookies and partition key.
  • +26/-0   
    NodeProperties.cs
    Update NodeProperties for nullable and type changes.         

    dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs

  • Enabled nullable reference types.
  • Updated types for Children and ShadowRoot properties.
  • +4/-2     
    UserContext.cs
    Update UserContext for nullable and equality methods.       

    dotnet/src/webdriver/BiDi/Modules/Browser/UserContext.cs

  • Enabled nullable reference types.
  • Made Id property internal.
  • Added Equals and GetHashCode methods.
  • +15/-1   
    GetUserContextsResultConverter.cs
    Implement GetUserContextsResultConverter for JSON deserialization.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs

  • Added new JSON converter for GetUserContextsResult.
  • Implemented deserialization logic for user contexts.
  • +25/-0   
    LocateNodesResultConverter.cs
    Implement LocateNodesResultConverter for JSON deserialization.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs

  • Added new JSON converter for LocateNodesResult.
  • Implemented deserialization logic for nodes.
  • +26/-0   
    GetRealmsResultConverter.cs
    Implement GetRealmsResultConverter for JSON deserialization.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs

  • Added new JSON converter for GetRealmsResult.
  • Implemented deserialization logic for realms.
  • +25/-0   
    LogModule.cs
    Update LogModule for new Entry type.                                         

    dotnet/src/webdriver/BiDi/Modules/Log/LogModule.cs

  • Enabled nullable reference types.
  • Updated OnEntryAddedAsync method to use new Entry type.
  • +4/-2     
    Target.cs
    Simplify Target class and enable nullable types.                 

    dotnet/src/webdriver/BiDi/Modules/Script/Target.cs

  • Enabled nullable reference types.
  • Simplified class names for target types.
  • +11/-8   
    BytesValue.cs
    Simplify BytesValue class and enable nullable types.         

    dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs

  • Enabled nullable reference types.
  • Simplified class names for bytes value types.
  • +8/-6     
    ChannelConverter.cs
    Update ChannelConverter for nullable and remove BiDi dependency.

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs

  • Enabled nullable reference types.
  • Removed dependency on BiDi in ChannelConverter.
  • +3/-8     
    BrowsingContextInputModule.cs
    Update BrowsingContextInputModule for nullable and actions parameter.

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInputModule.cs

  • Enabled nullable reference types.
  • Updated PerformActionsAsync to accept IEnumerable.
  • +7/-4     
    Subscription.cs
    Update Subscription for nullable and field renaming.         

    dotnet/src/webdriver/BiDi/Subscription.cs

  • Enabled nullable reference types.
  • Renamed Broker field to _broker.
  • +5/-3     
    AuthCredentials.cs
    Simplify AuthCredentials class and enable nullable types.

    dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs

  • Enabled nullable reference types.
  • Simplified class names for authentication credentials.
  • +5/-3     
    PreloadScript.cs
    Update PreloadScript for nullable and method update.         

    dotnet/src/webdriver/BiDi/Modules/Script/PreloadScript.cs

  • Enabled nullable reference types.
  • Updated RemoveAsync method to use Script module.
  • +3/-1     
    ScriptEvaluateException.cs
    Update ScriptEvaluateException for nullable and exception handling.

    dotnet/src/webdriver/BiDi/Modules/Script/ScriptEvaluateException.cs

  • Enabled nullable reference types.
  • Updated exception handling for EvaluateResult.Exception.
  • +4/-2     
    Origin.cs
    Add Origin record for input actions.                                         

    dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs

  • Added new Origin record with Viewport, Pointer, and Element types.
  • +17/-0   
    Channel.cs
    Convert Channel to record and enable nullable types.         

    dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs

  • Enabled nullable reference types.
  • Converted Channel class to a record.
  • +3/-12   
    BrowsingContextInfo.cs
    Enable nullable types in BrowsingContextInfo.                       

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInfo.cs

    • Enabled nullable reference types.
    +2/-0     
    ITransport.cs
    Update ITransport for nullable and visibility change.       

    dotnet/src/webdriver/BiDi/Communication/Transport/ITransport.cs

  • Enabled nullable reference types.
  • Changed interface visibility to internal.
  • +3/-1     
    BeforeRequestSentEventArgs.cs
    Enable nullable types in BeforeRequestSentEventArgs.         

    dotnet/src/webdriver/BiDi/Modules/Network/BeforeRequestSentEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    FetchErrorEventArgs.cs
    Enable nullable types in FetchErrorEventArgs.                       

    dotnet/src/webdriver/BiDi/Modules/Network/FetchErrorEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    ResponseCompletedEventArgs.cs
    Enable nullable types in ResponseCompletedEventArgs.         

    dotnet/src/webdriver/BiDi/Modules/Network/ResponseCompletedEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    ResponseStartedEventArgs.cs
    Enable nullable types in ResponseStartedEventArgs.             

    dotnet/src/webdriver/BiDi/Modules/Network/ResponseStartedEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    MessageConverter.cs
    Enable nullable types in MessageConverter.                             

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/MessageConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    PrintPageRangeConverter.cs
    Enable nullable types in PrintPageRangeConverter.               

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/PrintPageRangeConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    BaseParametersEventArgs.cs
    Enable nullable types in BaseParametersEventArgs.               

    dotnet/src/webdriver/BiDi/Modules/Network/BaseParametersEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    BrowsingContextConverter.cs
    Enable nullable types in BrowsingContextConverter.             

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowsingContextConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    PreloadScriptConverter.cs
    Enable nullable types in PreloadScriptConverter.                 

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/PreloadScriptConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    AuthRequiredEventArgs.cs
    Enable nullable types in AuthRequiredEventArgs.                   

    dotnet/src/webdriver/BiDi/Modules/Network/AuthRequiredEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    BrowserUserContextConverter.cs
    Enable nullable types in BrowserUserContextConverter.       

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/BrowserUserContextConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    RequestData.cs
    Enable nullable types in RequestData.                                       

    dotnet/src/webdriver/BiDi/Modules/Network/RequestData.cs

    • Enabled nullable reference types.
    +2/-0     
    PartitionKey.cs
    Update PartitionKey for nullable and user context type.   

    dotnet/src/webdriver/BiDi/Modules/Storage/PartitionKey.cs

  • Enabled nullable reference types.
  • Updated UserContext type to Browser.UserContext.
  • +3/-1     
    EventHandler.cs
    Enable nullable types in EventHandler.                                     

    dotnet/src/webdriver/BiDi/Communication/EventHandler.cs

    • Enabled nullable reference types.
    +2/-0     
    InterceptConverter.cs
    Enable nullable types in InterceptConverter.                         

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/InterceptConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    InternalIdConverter.cs
    Enable nullable types in InternalIdConverter.                       

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/InternalIdConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    NavigationConverter.cs
    Enable nullable types in NavigationConverter.                       

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/NavigationConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    RemovePreloadScriptCommand.cs
    Enable nullable types in RemovePreloadScriptCommand.         

    dotnet/src/webdriver/BiDi/Modules/Script/RemovePreloadScriptCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    AddInterceptCommand.cs
    Enable nullable types in AddInterceptCommand.                       

    dotnet/src/webdriver/BiDi/Modules/Network/AddInterceptCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    HandleConverter.cs
    Enable nullable types in HandleConverter.                               

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/HandleConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    RealmConverter.cs
    Enable nullable types in RealmConverter.                                 

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    RequestConverter.cs
    Enable nullable types in RequestConverter.                             

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/RequestConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    RemoveUserContextCommand.cs
    Enable nullable types in RemoveUserContextCommand.             

    dotnet/src/webdriver/BiDi/Modules/Browser/RemoveUserContextCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    GetTreeCommand.cs
    Enable nullable types in GetTreeCommand.                                 

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/GetTreeCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    TraverseHistoryCommand.cs
    Enable nullable types in TraverseHistoryCommand.                 

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/TraverseHistoryCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    HandleUserPromptCommand.cs
    Enable nullable types in HandleUserPromptCommand.               

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/HandleUserPromptCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ContinueRequestCommand.cs
    Enable nullable types in ContinueRequestCommand.                 

    dotnet/src/webdriver/BiDi/Modules/Network/ContinueRequestCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ContinueResponseCommand.cs
    Enable nullable types in ContinueResponseCommand.               

    dotnet/src/webdriver/BiDi/Modules/Network/ContinueResponseCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ProvideResponseCommand.cs
    Enable nullable types in ProvideResponseCommand.                 

    dotnet/src/webdriver/BiDi/Modules/Network/ProvideResponseCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    RemoveInterceptCommand.cs
    Enable nullable types in RemoveInterceptCommand.                 

    dotnet/src/webdriver/BiDi/Modules/Network/RemoveInterceptCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    DisownCommand.cs
    Enable nullable types in DisownCommand.                                   

    dotnet/src/webdriver/BiDi/Modules/Script/DisownCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    Cookie.cs
    Enable nullable types in Cookie.                                                 

    dotnet/src/webdriver/BiDi/Modules/Network/Cookie.cs

    • Enabled nullable reference types.
    +2/-0     
    CallFunctionCommand.cs
    Enable nullable types in CallFunctionCommand.                       

    dotnet/src/webdriver/BiDi/Modules/Script/CallFunctionCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    SetViewportCommand.cs
    Enable nullable types in SetViewportCommand.                         

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/SetViewportCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    SubscribeCommand.cs
    Enable nullable types in SubscribeCommand.                             

    dotnet/src/webdriver/BiDi/Modules/Session/SubscribeCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    SetCookieCommand.cs
    Enable nullable types in SetCookieCommand.                             

    dotnet/src/webdriver/BiDi/Modules/Storage/SetCookieCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ActivateCommand.cs
    Enable nullable types in ActivateCommand.                               

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ActivateCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    UserPromptOpenedEventArgs.cs
    Enable nullable types in UserPromptOpenedEventArgs.           

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptOpenedEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    FailRequestCommand.cs
    Enable nullable types in FailRequestCommand.                         

    dotnet/src/webdriver/BiDi/Modules/Network/FailRequestCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    CloseCommand.cs
    Enable nullable types in CloseCommand.                                     

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CloseCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    NavigateCommand.cs
    Enable nullable types in NavigateCommand.                               

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigateCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ReloadCommand.cs
    Enable nullable types in ReloadCommand.                                   

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/ReloadCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    ReleaseActionsCommand.cs
    Enable nullable types in ReleaseActionsCommand.                   

    dotnet/src/webdriver/BiDi/Modules/Input/ReleaseActionsCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    DeleteCookiesCommand.cs
    Enable nullable types in DeleteCookiesCommand.                     

    dotnet/src/webdriver/BiDi/Modules/Storage/DeleteCookiesCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    DateTimeOffsetConverter.cs
    Enable nullable types in DateTimeOffsetConverter.               

    dotnet/src/webdriver/BiDi/Communication/Json/Converters/DateTimeOffsetConverter.cs

    • Enabled nullable reference types.
    +2/-0     
    UnsubscribeCommand.cs
    Enable nullable types in UnsubscribeCommand.                         

    dotnet/src/webdriver/BiDi/Modules/Session/UnsubscribeCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    CreateCommand.cs
    Enable nullable types in CreateCommand.                                   

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CreateCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    Key.cs
    Add Key record for special key constants.                               

    dotnet/src/webdriver/BiDi/Modules/Input/Key.cs

    • Added new Key record with constants for special keys.
    +8/-0     
    PrintCommand.cs
    Enable nullable types in PrintCommand.                                     

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/PrintCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    Message.cs
    Enable nullable types in Message.                                               

    dotnet/src/webdriver/BiDi/Communication/Message.cs

    • Enabled nullable reference types.
    +2/-0     
    NavigationInfo.cs
    Enable nullable types in NavigationInfo.                                 

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/NavigationInfo.cs

    • Enabled nullable reference types.
    +2/-0     
    UserPromptClosedEventArgs.cs
    Enable nullable types in UserPromptClosedEventArgs.           

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/UserPromptClosedEventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    CreateUserContextCommand.cs
    Enable nullable types in CreateUserContextCommand.             

    dotnet/src/webdriver/BiDi/Modules/Browser/CreateUserContextCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    NewCommand.cs
    Enable nullable types in NewCommand.                                         

    dotnet/src/webdriver/BiDi/Modules/Session/NewCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    StorageModule.cs
    Enable nullable types in StorageModule.                                   

    dotnet/src/webdriver/BiDi/Modules/Storage/StorageModule.cs

    • Enabled nullable reference types.
    +2/-0     
    CloseCommand.cs
    Enable nullable types in CloseCommand.                                     

    dotnet/src/webdriver/BiDi/Modules/Browser/CloseCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    MessageEventArgs.cs
    Add MessageEventArgs for script messages.                               

    dotnet/src/webdriver/BiDi/Modules/Script/MessageEventArgs.cs

    • Added new MessageEventArgs record for script messages.
    +5/-0     
    EndCommand.cs
    Enable nullable types in EndCommand.                                         

    dotnet/src/webdriver/BiDi/Modules/Session/EndCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    StatusCommand.cs
    Enable nullable types in StatusCommand.                                   

    dotnet/src/webdriver/BiDi/Modules/Session/StatusCommand.cs

    • Enabled nullable reference types.
    +2/-0     
    SessionModule.cs
    Enable nullable types in SessionModule.                                   

    dotnet/src/webdriver/BiDi/Modules/Session/SessionModule.cs

    • Enabled nullable reference types.
    +2/-0     
    EventArgs.cs
    Enable nullable types in EventArgs.                                           

    dotnet/src/webdriver/BiDi/EventArgs.cs

    • Enabled nullable reference types.
    +2/-0     
    RealmDestroyedEventArgs.cs
    Add RealmDestroyedEventArgs for realm destruction events.

    dotnet/src/webdriver/BiDi/Modules/Script/RealmDestroyedEventArgs.cs

  • Added new RealmDestroyedEventArgs record for realm destruction events.

  • +5/-0     
    ResponseData.cs
    Enable nullable types in ResponseData.                                     

    dotnet/src/webdriver/BiDi/Modules/Network/ResponseData.cs

    • Enabled nullable reference types.
    +2/-0     
    StackFrame.cs
    Enable nullable types in StackFrame.                                         

    dotnet/src/webdriver/BiDi/Modules/Script/StackFrame.cs

    • Enabled nullable reference types.
    +2/-0     
    StackTrace.cs
    Enable nullable types in StackTrace.                                         

    dotnet/src/webdriver/BiDi/Modules/Script/StackTrace.cs

    • Enabled nullable reference types.
    +2/-0     
    Command.cs
    Enable nullable types in Command.                                               

    dotnet/src/webdriver/BiDi/Communication/Command.cs

    • Enabled nullable reference types.
    +2/-0     
    WebDriver.Extensions.cs
    Enable nullable types in WebDriver.Extensions.                     

    dotnet/src/webdriver/BiDi/WebDriver.Extensions.cs

    • Enabled nullable reference types.
    +2/-0     
    Module.cs
    Enable nullable types in Module.                                                 

    dotnet/src/webdriver/BiDi/Modules/Module.cs

    • Enabled nullable reference types.
    +2/-0     
    CapabilitiesRequest.cs
    Enable nullable types in CapabilitiesRequest.                       

    dotnet/src/webdriver/BiDi/Modules/Session/CapabilitiesRequest.cs

    • Enabled nullable reference types.
    +2/-0     
    UserContextInfo.cs
    Enable nullable types in UserContextInfo.                               

    dotnet/src/webdriver/BiDi/Modules/Browser/UserContextInfo.cs

    • Enabled nullable reference types.
    +2/-0     
    SetCookieHeader.cs
    Enable nullable types in SetCookieHeader.                               

    dotnet/src/webdriver/BiDi/Modules/Network/SetCookieHeader.cs

    • Enabled nullable reference types.
    +2/-0     
    CookieHeader.cs
    Enable nullable types in CookieHeader.                                     

    dotnet/src/webdriver/BiDi/Modules/Network/CookieHeader.cs

    • Enabled nullable reference types.
    +2/-0     
    FetchTimingInfo.cs
    Enable nullable types in FetchTimingInfo.                               

    dotnet/src/webdriver/BiDi/Modules/Network/FetchTimingInfo.cs

    • Enabled nullable reference types.
    +2/-0     
    Initiator.cs
    Enable nullable types in Initiator.                                           

    dotnet/src/webdriver/BiDi/Modules/Network/Initiator.cs

    • Enabled nullable reference types.
    +2/-0     
    BiDiException.cs
    Enable nullable types in BiDiException.                                   

    dotnet/src/webdriver/BiDi/BiDiException.cs

    • Enabled nullable reference types.
    +2/-0     
    CommandOptions.cs
    Enable nullable types in CommandOptions.                                 

    dotnet/src/webdriver/BiDi/Communication/CommandOptions.cs

    • Enabled nullable reference types.
    +2/-0     
    AuthChallenge.cs
    Enable nullable types in AuthChallenge.                                   

    dotnet/src/webdriver/BiDi/Modules/Network/AuthChallenge.cs

    • Enabled nullable reference types.
    +2/-0     
    Request.cs
    Enable nullable types in Request.                                               

    dotnet/src/webdriver/BiDi/Modules/Network/Request.cs

    • Enabled nullable reference types.
    +2/-0     
    RemoteReference.cs
    Enable nullable types in RemoteReference.                               

    dotnet/src/webdriver/BiDi/Modules/Script/RemoteReference.cs

    • Enabled nullable reference types.
    +2/-0     
    Navigation.cs
    Enable nullable types in Navigation.                                         

    dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Navigation.cs

    • Enabled nullable reference types.
    +2/-0     
    Header.cs
    Enable nullable types in Header.                                                 

    dotnet/src/webdriver/BiDi/Modules/Network/Header.cs

    • Enabled nullable reference types.
    +2/-0     
    ResponseContent.cs
    Enable nullable types in ResponseContent.                               

    dotnet/src/webdriver/BiDi/Modules/Network/ResponseContent.cs

    • Enabled nullable reference types.
    +2/-0     
    Source.cs
    Enable nullable types in Source.                                                 

    dotnet/src/webdriver/BiDi/Modules/Script/Source.cs

    • Enabled nullable reference types.
    +2/-0     
    CapabilityRequest.cs
    Enable nullable types in CapabilityRequest.                           

    dotnet/src/webdriver/BiDi/Modules/Session/CapabilityRequest.cs

    • Enabled nullable reference types.
    +2/-0     
    RealmType.cs
    Enable nullable types in RealmType.                                           

    dotnet/src/webdriver/BiDi/Modules/Script/RealmType.cs

    • Enabled nullable reference types.
    +2/-0     
    ResultOwnership.cs
    Enable nullable types in ResultOwnership.                               

    dotnet/src/webdriver/BiDi/Modules/Script/ResultOwnership.cs

    • Enabled nullable reference types.
    +2/-0     
    SerializationOptions.cs
    Enable nullable types in SerializationOptions.                     

    dotnet/src/webdriver/BiDi/Modules/Script/SerializationOptions.cs

    • Enabled nullable reference types.
    +2/-0     
    InternalId.cs
    Enable nullable types in InternalId.                                         

    dotnet/src/webdriver/BiDi/Modules/Script/InternalId.cs

    • Enabled nullable reference types.
    +2/-0     
    Handle.cs
    Enable nullable types in Handle.                                                 

    dotnet/src/webdriver/BiDi/Modules/Script/Handle.cs

    • Enabled nullable reference types.
    +2/-0     
    Realm.cs
    Enable nullable types in Realm.                                                   

    dotnet/src/webdriver/BiDi/Modules/Script/Realm.cs

    • Enabled nullable reference types.
    +2/-0     
    Tests
    14 files
    BrowsingContextTest.cs
    Add unit tests for BrowsingContext functionalities             

    dotnet/test/common/BiDi/BrowsingContext/BrowsingContextTest.cs

  • Added new unit tests for BrowsingContext functionalities.
  • Tests cover context creation, navigation, and tree retrieval.
  • +301/-0 
    CallFunctionParameterTest.cs
    Add tests for Script function call parameters                       

    dotnet/test/common/BiDi/Script/CallFunctionParameterTest.cs

  • Added tests for calling functions with various parameters.
  • Included tests for user activation and promise handling.
  • +203/-0 
    NetworkTest.cs
    Add network intercept and request handling tests                 

    dotnet/test/common/BiDi/Network/NetworkTest.cs

  • Added tests for network intercept and request handling.
  • Included tests for authentication and response continuation.
  • +195/-0 
    ScriptCommandsTest.cs
    Add tests for Script command functionalities                         

    dotnet/test/common/BiDi/Script/ScriptCommandsTest.cs

  • Added tests for script command functionalities.
  • Included tests for realm retrieval and preload script handling.
  • +150/-0 
    NetworkEventsTest.cs
    Add tests for Network event handling                                         

    dotnet/test/common/BiDi/Network/NetworkEventsTest.cs

  • Added tests for network events like request and response handling.
  • Included tests for authentication and fetch error events.
  • +132/-0 
    StorageTest.cs
    Add tests for Storage module functionalities                         

    dotnet/test/common/BiDi/Storage/StorageTest.cs

  • Added tests for storage module functionalities.
  • Included tests for cookie management and retrieval.
  • +161/-0 
    EvaluateParametersTest.cs
    Add tests for script evaluation parameters                             

    dotnet/test/common/BiDi/Script/EvaluateParametersTest.cs

  • Added tests for evaluating script parameters.
  • Included tests for sandbox and realm evaluations.
  • +109/-0 
    DefaultKeyboardTest.cs
    Add placeholder tests for keyboard input actions                 

    dotnet/test/common/BiDi/Input/DefaultKeyboardTest.cs

    • Added commented-out tests for keyboard input actions.
    +88/-0   
    LogTest.cs
    Add tests for Log module functionalities                                 

    dotnet/test/common/BiDi/Log/LogTest.cs

  • Added tests for log module functionalities.
  • Included tests for console and JavaScript log entries.
  • +75/-0   
    ScriptEventsTest.cs
    Add tests for Script event handling                                           

    dotnet/test/common/BiDi/Script/ScriptEventsTest.cs

  • Added tests for script event handling.
  • Included tests for channel messages and realm events.
  • +63/-0   
    CombinedInputActionsTest.cs
    Add CombinedInputActionsTest for input actions.                   

    dotnet/test/common/BiDi/Input/CombinedInputActionsTest.cs

  • Added new test class CombinedInputActionsTest.
  • Implemented tests for input actions including pointer and key actions.

  • +55/-0   
    DefaultMouseTest.cs
    Add DefaultMouseTest for mouse actions.                                   

    dotnet/test/common/BiDi/Input/DefaultMouseTest.cs

  • Added new test class DefaultMouseTest.
  • Implemented tests for mouse actions, including drag and drop.
  • +49/-0   
    BrowserTest.cs
    Add BrowserTest for user context operations.                         

    dotnet/test/common/BiDi/Browser/BrowserTest.cs

  • Added new test class BrowserTest.
  • Implemented tests for user context creation, retrieval, and removal.
  • +43/-0   
    BiDiFixture.cs
    Add BiDiTestFixture for BiDi test setup.                                 

    dotnet/test/common/BiDi/BiDiFixture.cs

  • Added new fixture class BiDiTestFixture.
  • Set up and tear down logic for BiDi tests.
  • +54/-0   
    Configuration changes
    1 files
    DriverFactory.cs
    Update DriverFactory for WebSocket configuration.               

    dotnet/test/common/Environment/DriverFactory.cs

  • Removed commented-out BiDi configuration code.
  • Added UseWebSocketUrl configuration in driver options.
  • +2/-6     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @nvborisenko nvborisenko marked this pull request as draft October 9, 2024 21:52
    @nvborisenko nvborisenko marked this pull request as ready for review October 26, 2024 21:48
    Copy link
    Contributor

    Persistent review updated to latest commit 56c8e42

    @nvborisenko
    Copy link
    Member Author

    This is a big step forward, including internal unit tests.

    Input module is still not covered by tests, there are many concerns how to make it convenient.

    I would like to let it move further, and continue to improve the current functionality. Given that BiDi implementation is still in Beta, I believe it is OK.

    @nvborisenko
    Copy link
    Member Author

    Thank you, Nikolay!

    @nvborisenko nvborisenko merged commit 635a88a into SeleniumHQ:trunk Oct 27, 2024
    10 checks passed
    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.

    1 participant