-
-
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
[dotnet] [bidi] Second round of BiDi implementation #14566
Draft
nvborisenko
wants to merge
65
commits into
SeleniumHQ:trunk
Choose a base branch
from
nvborisenko:dotnet-bidi-second-round
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[dotnet] [bidi] Second round of BiDi implementation #14566
nvborisenko
wants to merge
65
commits into
SeleniumHQ:trunk
from
nvborisenko:dotnet-bidi-second-round
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Checklist
PR Type
Enhancement, Tests
Description
SourceActions
and related converters.Entry
records and log level enums.Changes walkthrough 📝
55 files
RemoteValue.cs
Refactor and Update RemoteValue Type Handling
dotnet/src/webdriver/BiDi/Modules/Script/RemoteValue.cs
JsonDerivedType
attributes.RemoteValue
.BrowsingContext.cs
Refactor BrowsingContext Method Calls and Return Types
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContext.cs
BiDi.BrowsingContext
instead ofBiDi.BrowsingContextModule
.LocateNodesAsync
.ScriptModule.cs
Update ScriptModule Methods and Add Event Subscriptions
dotnet/src/webdriver/BiDi/Modules/Script/ScriptModule.cs
EvaluateAsync
andCallFunctionAsync
.SourceActions.cs
Add SourceActions for Input Handling
dotnet/src/webdriver/BiDi/Modules/Input/SourceActions.cs
SourceActions
and its derived records for input actions.LocalValue.cs
Refactor LocalValue Type Definitions
dotnet/src/webdriver/BiDi/Modules/Script/LocalValue.cs
LocalValue
and its derived records.JsonDerivedType
attributes.BiDi.cs
Rename ScriptModule and BrowsingContextModule Properties
dotnet/src/webdriver/BiDi/BiDi.cs
ScriptModule
toScript
andBrowsingContextModule
toBrowsingContext
.RemoteValueConverter.cs
Update RemoteValueConverter for New Types
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RemoteValueConverter.cs
RemoteValue
types.RealmInfo.cs
Refactor RealmInfo Type Definitions
dotnet/src/webdriver/BiDi/Modules/Script/RealmInfo.cs
RealmInfo
and its derived records.JsonDerivedType
attributes.NetworkModule.cs
Rename and Enhance NetworkModule Authentication Methods
dotnet/src/webdriver/BiDi/Modules/Network/NetworkModule.cs
InterceptAuthenticationAsync
toInterceptAuthAsync
.BrowsingContextScriptModule.cs
Update BrowsingContextScriptModule for Target Context
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextScriptModule.cs
Target.Context
.Locator.cs
Refactor Locator Type Definitions
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/Locator.cs
Locator
and its derived records.JsonDerivedType
attributes.PerformActionsCommand.cs
Simplify PerformActionsCommandParameters Definition
dotnet/src/webdriver/BiDi/Modules/Input/PerformActionsCommand.cs
PerformActionsCommandParameters
definition.GetCookiesCommand.cs
Refactor GetCookiesResult and PartitionDescriptor
dotnet/src/webdriver/BiDi/Modules/Storage/GetCookiesCommand.cs
GetCookiesResult
to implementIReadOnlyList
.PartitionDescriptor
and its derived records.ProxyConfiguration.cs
Refactor ProxyConfiguration Type Definitions
dotnet/src/webdriver/BiDi/Modules/Session/ProxyConfiguration.cs
ProxyConfiguration
and its derived records.JsonDerivedType
attributes.UrlPattern.cs
Refactor UrlPattern Type Definitions
dotnet/src/webdriver/BiDi/Modules/Network/UrlPattern.cs
UrlPattern
and its derived records.JsonDerivedType
attributes.BrowsingContextNetworkModule.cs
Rename and Enhance BrowsingContextNetworkModule Auth Methods
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextNetworkModule.cs
InterceptAuthenticationAsync
toInterceptAuthAsync
.RealmInfoConverter.cs
Update RealmInfoConverter for New Type Names
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/RealmInfoConverter.cs
RealmInfo
types.RealmInfo
.InputSourceActionsConverter.cs
Implement InputSourceActionsConverter for SourceActions
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/InputSourceActionsConverter.cs
InputSourceActionsConverter
for serializingSourceActions
.Broker.cs
Add JSON Converters for BiDi Modules
dotnet/src/webdriver/BiDi/Communication/Broker.cs
ContinueWithAuthCommand.cs
Refactor ContinueWithAuthParameters Type Definitions
dotnet/src/webdriver/BiDi/Modules/Network/ContinueWithAuthCommand.cs
ContinueWithAuthParameters
and its derived records.JsonDerivedType
attributes.AddPreloadScriptCommand.cs
Update AddPreloadScriptCommand for LocalValue.Channel
dotnet/src/webdriver/BiDi/Modules/Script/AddPreloadScriptCommand.cs
AddPreloadScriptCommandParameters
to useLocalValue.Channel
.LogEntryConverter.cs
Update LogEntryConverter for New Type Names
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/LogEntryConverter.cs
LogEntry
types.LogEntry
.MessageEventArgs.cs
Add MessageEventArgs for Script Message Events
dotnet/src/webdriver/BiDi/Modules/Script/MessageEventArgs.cs
MessageEventArgs
record for script message events.BrowsingContextModule.cs
Update LocateNodesAsync to return LocateNodesResult directly.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextModule.cs
LocateNodesAsync
method toLocateNodesResult
.BrowsingContextLogModule.cs
Update log entry handler types in BrowsingContextLogModule.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextLogModule.cs
OnEntryAddedAsync
method signatures to useLog.Entry
insteadof
BaseLogEntry
.InputModule.cs
Modify PerformActionsAsync to accept actions parameter directly.
dotnet/src/webdriver/BiDi/Modules/Input/InputModule.cs
actions
parameter toPerformActionsAsync
method.BrowsingContextStorageModule.cs
Refactor partition assignment in BrowsingContextStorageModule.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextStorageModule.cs
PartitionDescriptor.Context
.EvaluateCommand.cs
Refactor EvaluateResult to use nested records.
dotnet/src/webdriver/BiDi/Modules/Script/EvaluateCommand.cs
EvaluateResult
to include nestedSuccess
andException
records.
LocateNodesCommand.cs
Implement LocateNodesResult as IReadOnlyList.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/LocateNodesCommand.cs
LocateNodesResult
as a class implementingIReadOnlyList
.Entry.cs
Add Entry record and Level enum for logging.
dotnet/src/webdriver/BiDi/Modules/Log/Entry.cs
Entry
record with nestedConsole
andJavascript
records.Level
enum for log levels.InputOriginConverter.cs
Add JSON converter for Input Origin types.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/InputOriginConverter.cs
InputOriginConverter
for serializingOrigin
types.CaptureScreenshotCommand.cs
Refactor ClipRectangle to use nested records.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/CaptureScreenshotCommand.cs
ClipRectangle
to use nestedBox
andElement
records.GetUserContextsCommand.cs
Implement GetUserContextsResult as IReadOnlyList.
dotnet/src/webdriver/BiDi/Modules/Browser/GetUserContextsCommand.cs
GetUserContextsResult
as a class implementingIReadOnlyList
.GetRealmsCommand.cs
Implement GetRealmsResult as IReadOnlyList.
dotnet/src/webdriver/BiDi/Modules/Script/GetRealmsCommand.cs
GetRealmsResult
as a class implementingIReadOnlyList
.RealmTypeConverter.cs
Implement Write method in RealmTypeConverter.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/RealmTypeConverter.cs
Write
method forRealmTypeConverter
.GetCookiesResultConverter.cs
Add JSON converter for GetCookiesResult.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetCookiesResultConverter.cs
GetCookiesResultConverter
for deserializingGetCookiesResult
.Target.cs
Refactor Target to use nested records.
dotnet/src/webdriver/BiDi/Modules/Script/Target.cs
Target
to use nestedRealm
andContext
records.GetUserContextsResultConverter.cs
Add JSON converter for GetUserContextsResult.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetUserContextsResultConverter.cs
GetUserContextsResultConverter
for deserializingGetUserContextsResult
.LocateNodesResultConverter.cs
Add JSON converter for LocateNodesResult.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/LocateNodesResultConverter.cs
LocateNodesResultConverter
for deserializingLocateNodesResult
.GetRealmsResultConverter.cs
Add JSON converter for GetRealmsResult.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Enumerable/GetRealmsResultConverter.cs
GetRealmsResultConverter
for deserializingGetRealmsResult
.BrowserModule.cs
Update GetUserContextsAsync to return GetUserContextsResult directly.
dotnet/src/webdriver/BiDi/Modules/Browser/BrowserModule.cs
GetUserContextsAsync
toGetUserContextsResult
.NodeProperties.cs
Update NodeProperties to use RemoteValue.Node types.
dotnet/src/webdriver/BiDi/Modules/Script/NodeProperties.cs
Children
andShadowRoot
properties toRemoteValue.Node
.LogModule.cs
Update log entry handler types in LogModule.
dotnet/src/webdriver/BiDi/Modules/Log/LogModule.cs
OnEntryAddedAsync
method signatures to useEntry
instead ofBaseLogEntry
.BytesValue.cs
Refactor BytesValue to use nested records.
dotnet/src/webdriver/BiDi/Modules/Network/BytesValue.cs
BytesValue
to use nestedString
andBase64
records.UserContext.cs
Update UserContext with internal Id and equality methods.
dotnet/src/webdriver/BiDi/Modules/Browser/UserContext.cs
Id
property to internal.Equals
andGetHashCode
methods.EvaluateResultConverter.cs
Update EvaluateResultConverter for nested result types.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/Polymorphic/EvaluateResultConverter.cs
EvaluateResult.Success
andEvaluateResult.Exception
.ChannelConverter.cs
Simplify ChannelConverter by removing BiDi dependency.
dotnet/src/webdriver/BiDi/Communication/Json/Converters/ChannelConverter.cs
BiDi
dependency fromChannelConverter
.BrowsingContextInputModule.cs
Simplify PerformActionsAsync in BrowsingContextInputModule.
dotnet/src/webdriver/BiDi/Modules/BrowsingContext/BrowsingContextInputModule.cs
PerformActionsAsync
by removing redundant optionsassignment.
AuthCredentials.cs
Refactor AuthCredentials to use nested Basic record.
dotnet/src/webdriver/BiDi/Modules/Network/AuthCredentials.cs
AuthCredentials
to use nestedBasic
record.Origin.cs
Add Origin record with nested types for input.
dotnet/src/webdriver/BiDi/Modules/Input/Origin.cs
Origin
record with nestedViewport
,Pointer
, andElement
records.
ScriptEvaluateException.cs
Update ScriptEvaluateException to use nested exception type.
dotnet/src/webdriver/BiDi/Modules/Script/ScriptEvaluateException.cs
ScriptEvaluateException
to useEvaluateResult.Exception
.PreloadScript.cs
Update PreloadScript to call RemovePreloadScriptAsync.
dotnet/src/webdriver/BiDi/Modules/Script/PreloadScript.cs
RemovePreloadScriptAsync
.Channel.cs
Refactor Channel to a simple record with Id.
dotnet/src/webdriver/BiDi/Modules/Script/Channel.cs
Channel
to a record with a singleId
property.PartitionKey.cs
Update PartitionKey to use Browser.UserContext type.
dotnet/src/webdriver/BiDi/Modules/Storage/PartitionKey.cs
UserContext
property type toBrowser.UserContext
.RealmDestroyedEventArgs.cs
Add RealmDestroyedEventArgs record for script module.
dotnet/src/webdriver/BiDi/Modules/Script/RealmDestroyedEventArgs.cs
RealmDestroyedEventArgs
record.13 files
BrowsingContextTest.cs
Add Unit Tests for BrowsingContext Functionalities
dotnet/test/common/BiDi/BrowsingContext/BrowsingContextTest.cs
CallFunctionParameterTest.cs
Add Tests for Script Function Call Parameters
dotnet/test/common/BiDi/Script/CallFunctionParameterTest.cs
NetworkTest.cs
Add Network Request Interception and Auth Tests
dotnet/test/common/BiDi/Network/NetworkTest.cs
NetworkEventsTest.cs
Add Tests for Network Event Listeners
dotnet/test/common/BiDi/Network/NetworkEventsTest.cs
ScriptCommandsTest.cs
Add Tests for Script Command Functionalities
dotnet/test/common/BiDi/Script/ScriptCommandsTest.cs
StorageTest.cs
Add Tests for Storage Cookie Management
dotnet/test/common/BiDi/Storage/StorageTest.cs
EvaluateParametersTest.cs
Add Tests for Script Evaluation Parameters
dotnet/test/common/BiDi/Script/EvaluateParametersTest.cs
LogTest.cs
Add Tests for Logging Functionalities
dotnet/test/common/BiDi/Log/LogTest.cs
ScriptEventsTest.cs
Add Tests for Script Event Listeners
dotnet/test/common/BiDi/Script/ScriptEventsTest.cs
CombinedInputActionsTest.cs
Add Tests for Combined Input Actions
dotnet/test/common/BiDi/Input/CombinedInputActionsTest.cs
BrowserTest.cs
Add Tests for Browser User Context Management
dotnet/test/common/BiDi/Browser/BrowserTest.cs
BiDiFixture.cs
Introduce BiDiFixture for Test Setup and Teardown
dotnet/test/common/BiDi/BiDiFixture.cs
BiDiFixture
for setting up BiDi tests.DefaultMouseTest.cs
Add test for mouse drag and drop actions.
dotnet/test/common/BiDi/Input/DefaultMouseTest.cs
PerformDragAndDropWithMouse
for mouse actions.1 files
DriverFactory.cs
Enable additional Chrome options in DriverFactory.
dotnet/test/common/Environment/DriverFactory.cs
UnhandledPromptBehavior
andUseWebSocketUrl
options forChrome.
1 files
Subscription.cs
Rename Broker to _broker in Subscription class.
dotnet/src/webdriver/BiDi/Subscription.cs
Broker
to_broker
for consistency.