diff --git a/dotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs b/dotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs index 70029634ed74b..95379ea111978 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumAndroidOptions.cs @@ -46,8 +46,7 @@ public bool UseRunningApp } /// - /// Gets or sets the process name of the Activity hosting the app. If not given, it - /// is assumed to be the same as . + /// Gets or sets the process name of the Activity hosting the app. /// public string AndroidProcess { diff --git a/dotnet/src/webdriver/Chromium/ChromiumDriver.cs b/dotnet/src/webdriver/Chromium/ChromiumDriver.cs index 2c67598f4990a..ee9e4fd3088ed 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumDriver.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumDriver.cs @@ -131,6 +131,14 @@ protected ChromiumDriver(ChromiumDriverService service, ChromiumOptions options, this.optionsCapabilityName = options.CapabilityName; } + /// + /// Gets the dictionary of custom Chromium commands registered with the driver. + /// + protected static IReadOnlyDictionary ChromiumCustomCommands + { + get { return new ReadOnlyDictionary(chromiumCustomCommands); } + } + /// /// Uses DriverFinder to set Service attributes if necessary when creating the command executor /// @@ -148,11 +156,6 @@ private static ICommandExecutor GenerateDriverServiceCommandExecutor(DriverServi return new DriverServiceCommandExecutor(service, commandTimeout); } - protected static IReadOnlyDictionary ChromiumCustomCommands - { - get { return new ReadOnlyDictionary(chromiumCustomCommands); } - } - /// /// Gets or sets the responsible for detecting /// sequences of keystrokes representing file paths and names. @@ -265,7 +268,6 @@ public object ExecuteCdpCommand(string commandName, Dictionary c /// /// Creates a session to communicate with a browser using the Chromium Developer Tools debugging protocol. /// - /// The version of the Chromium Developer Tools protocol to use. Defaults to autodetect the protocol version. /// The active session to use to communicate with the Chromium Developer Tools debugging protocol. public DevToolsSession GetDevToolsSession() { @@ -435,6 +437,10 @@ public void StopCasting(string deviceName) this.Execute(StopCastingCommand, parameters); } + /// + /// Stops the driver from running + /// + /// if its in the process of disposing protected override void Dispose(bool disposing) { if (disposing) diff --git a/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs b/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs index 072fbb83bfc8c..bb24ab75c7760 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumDriverService.cs @@ -45,6 +45,7 @@ public abstract class ChromiumDriverService : DriverService /// The full path to the ChromeDriver executable. /// The file name of the ChromeDriver executable. /// The port on which the ChromeDriver executable should listen. + /// The URL from which the driver executable can be downloaded. protected ChromiumDriverService(string executablePath, string executableFileName, int port, Uri downloadUrl = null) : base(executablePath, port, executableFileName) { diff --git a/dotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs b/dotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs index 9fe618b26287d..d28ee94ff8d5c 100644 --- a/dotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs +++ b/dotnet/src/webdriver/Chromium/ChromiumNetworkConditions.cs @@ -97,6 +97,11 @@ internal long? SerializableLatency } } + /// + /// Creates a ChromiumNetworkConditions object from a dictionary of key-value pairs. + /// + /// The dictionary to use to create the object. + /// The ChromiumNetworkConditions object created from the dictionary. public static ChromiumNetworkConditions FromDictionary(Dictionary dictionary) { ChromiumNetworkConditions conditions = new ChromiumNetworkConditions(); diff --git a/dotnet/src/webdriver/CommandInfoRepository.cs b/dotnet/src/webdriver/CommandInfoRepository.cs index a734eb5d50f42..b47ec1ebe511e 100644 --- a/dotnet/src/webdriver/CommandInfoRepository.cs +++ b/dotnet/src/webdriver/CommandInfoRepository.cs @@ -64,7 +64,7 @@ public bool IsCommandNameDefined(string commandName) /// Finds a command name for a given . /// /// The object for which to find the command name. - /// The name of the command defined by the command info, or if the command is not defined. + /// The name of the command defined by the command info, or if the command is not defined. public string FindCommandName(CommandInfo commandInfo) { foreach(KeyValuePair pair in this.commandDictionary) diff --git a/dotnet/src/webdriver/DevTools/DevToolsSession.cs b/dotnet/src/webdriver/DevTools/DevToolsSession.cs index 2223517de4a2d..aad579a7b1ed7 100644 --- a/dotnet/src/webdriver/DevTools/DevToolsSession.cs +++ b/dotnet/src/webdriver/DevTools/DevToolsSession.cs @@ -36,6 +36,10 @@ namespace OpenQA.Selenium.DevTools /// public class DevToolsSession : IDevToolsSession { + /// + /// A value indicating that the version of the DevTools protocol in use + /// by the browser should be automatically detected. + /// public const int AutoDetectDevToolsProtocolVersion = 0; private readonly string debuggerEndpoint; @@ -158,9 +162,9 @@ public T GetVersionSpecificDomains() where T : DevToolsSessionDomains /// /// Sends the specified command and returns the associated command response. /// - /// - /// /// A command object implementing the interface. + /// A response object implementing the interface. + /// The command to send. /// A CancellationToken object to allow for cancellation of the command. /// The execution timeout of the command in milliseconds. /// to throw an exception if a response is not received; otherwise, . @@ -262,8 +266,8 @@ public T GetVersionSpecificDomains() where T : DevToolsSessionDomains } /// - /// Disposes of the DevToolsSession and frees all resources. - /// + /// Releases all resources associated with this . + /// public void Dispose() { this.Dispose(true); @@ -296,7 +300,7 @@ internal async Task StartSession(int requestedProtocolVersion) /// Asynchronously stops the session. /// /// to manually detach the session - /// from its attached target; otherswise . + /// from its attached target; otherswise . /// A task that represents the asynchronous operation. internal async Task StopSession(bool manualDetach) { @@ -314,6 +318,10 @@ internal async Task StopSession(bool manualDetach) } } + /// + /// Releases all resources associated with this . + /// + /// if the Dispose method was explicitly called; otherwise, . protected void Dispose(bool disposing) { if (!this.isDisposed) diff --git a/dotnet/src/webdriver/DevTools/IDevToolsSession.cs b/dotnet/src/webdriver/DevTools/IDevToolsSession.cs index 682bbf6316911..b9d1d06191eb4 100644 --- a/dotnet/src/webdriver/DevTools/IDevToolsSession.cs +++ b/dotnet/src/webdriver/DevTools/IDevToolsSession.cs @@ -64,9 +64,9 @@ Task> SendCommand(TCommand command, Cancell /// /// Sends the specified command and returns the associated command response. /// - /// - /// /// A command object implementing the interface. + /// A response object implementing the interface. + /// The command to send. /// A CancellationToken object to allow for cancellation of the command. /// The execution timeout of the command in milliseconds. /// to throw an exception if a response is not received; otherwise, . diff --git a/dotnet/src/webdriver/DevTools/Network.cs b/dotnet/src/webdriver/DevTools/Network.cs index 22ff81d2b21a6..a928b982cab1f 100644 --- a/dotnet/src/webdriver/DevTools/Network.cs +++ b/dotnet/src/webdriver/DevTools/Network.cs @@ -197,6 +197,14 @@ protected virtual void OnResponsePaused(ResponsePausedEventArgs e) } } + /// A task that represents the asynchronous operation. + /// + /// Am asynchrounous delegate for handling network events. + /// + /// The type of event args the event raises. + /// The sender of the event. + /// An object containing information about the event. + /// A task that represents the asynchronous operation. public delegate Task AsyncEventHandler(object sender, TEventArgs e); } } diff --git a/dotnet/src/webdriver/DevTools/v114/V114Domains.cs b/dotnet/src/webdriver/DevTools/v114/V114Domains.cs index 38e7a1425be12..b394dda76acb3 100644 --- a/dotnet/src/webdriver/DevTools/v114/V114Domains.cs +++ b/dotnet/src/webdriver/DevTools/v114/V114Domains.cs @@ -28,6 +28,10 @@ public class V114Domains : DevToolsDomains { private DevToolsSessionDomains domains; + /// + /// Initializes a new instance of the V114Domains class. + /// + /// The DevToolsSession to use with this set of domains. public V114Domains(DevToolsSession session) { this.domains = new DevToolsSessionDomains(session); diff --git a/dotnet/src/webdriver/DevTools/v114/V114Network.cs b/dotnet/src/webdriver/DevTools/v114/V114Network.cs index 2d9980542d3fe..5afc4784a87fe 100644 --- a/dotnet/src/webdriver/DevTools/v114/V114Network.cs +++ b/dotnet/src/webdriver/DevTools/v114/V114Network.cs @@ -64,11 +64,19 @@ public override async Task EnableNetworkCaching() await network.SetCacheDisabled(new SetCacheDisabledCommandSettings() { CacheDisabled = false }); } + /// + /// Asynchronously enables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task EnableNetwork() { await network.Enable(new Network.EnableCommandSettings()); } + /// + /// Asynchronously disables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task DisableNetwork() { await network.Disable(); diff --git a/dotnet/src/webdriver/DevTools/v114/V114Target.cs b/dotnet/src/webdriver/DevTools/v114/V114Target.cs index a135f2e5e42c0..94765fa27e5e4 100644 --- a/dotnet/src/webdriver/DevTools/v114/V114Target.cs +++ b/dotnet/src/webdriver/DevTools/v114/V114Target.cs @@ -97,8 +97,7 @@ public override async Task AttachToTarget(string targetId) /// /// The ID of the session of the target from which to detach. /// The ID of the target from which to detach. - /// - /// A task representing the asynchronous detach operation. + /// A task representing the asynchronous detach operation. public override async Task DetachFromTarget(string sessionId = null, string targetId = null) { await adapter.DetachFromTarget(new DetachFromTargetCommandSettings() diff --git a/dotnet/src/webdriver/DevTools/v115/V115Domains.cs b/dotnet/src/webdriver/DevTools/v115/V115Domains.cs index 10e017364ab80..00033bc264217 100644 --- a/dotnet/src/webdriver/DevTools/v115/V115Domains.cs +++ b/dotnet/src/webdriver/DevTools/v115/V115Domains.cs @@ -28,6 +28,10 @@ public class V115Domains : DevToolsDomains { private DevToolsSessionDomains domains; + /// + /// Initializes a new instance of the V115Domains class. + /// + /// The DevToolsSession to use with this set of domains. public V115Domains(DevToolsSession session) { this.domains = new DevToolsSessionDomains(session); diff --git a/dotnet/src/webdriver/DevTools/v115/V115Network.cs b/dotnet/src/webdriver/DevTools/v115/V115Network.cs index ae1754c4de05c..148702b1188f5 100644 --- a/dotnet/src/webdriver/DevTools/v115/V115Network.cs +++ b/dotnet/src/webdriver/DevTools/v115/V115Network.cs @@ -64,11 +64,19 @@ public override async Task EnableNetworkCaching() await network.SetCacheDisabled(new SetCacheDisabledCommandSettings() { CacheDisabled = false }); } + /// + /// Asynchronously enables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task EnableNetwork() { await network.Enable(new Network.EnableCommandSettings()); } + /// + /// Asynchronously disables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task DisableNetwork() { await network.Disable(); diff --git a/dotnet/src/webdriver/DevTools/v115/V115Target.cs b/dotnet/src/webdriver/DevTools/v115/V115Target.cs index 3dc6853444082..bae2c204717ce 100644 --- a/dotnet/src/webdriver/DevTools/v115/V115Target.cs +++ b/dotnet/src/webdriver/DevTools/v115/V115Target.cs @@ -97,8 +97,7 @@ public override async Task AttachToTarget(string targetId) /// /// The ID of the session of the target from which to detach. /// The ID of the target from which to detach. - /// - /// A task representing the asynchronous detach operation. + /// A task representing the asynchronous detach operation. public override async Task DetachFromTarget(string sessionId = null, string targetId = null) { await adapter.DetachFromTarget(new DetachFromTargetCommandSettings() diff --git a/dotnet/src/webdriver/DevTools/v116/V116Domains.cs b/dotnet/src/webdriver/DevTools/v116/V116Domains.cs index 46b10ebe98f0c..cb40ada1f6828 100644 --- a/dotnet/src/webdriver/DevTools/v116/V116Domains.cs +++ b/dotnet/src/webdriver/DevTools/v116/V116Domains.cs @@ -28,6 +28,10 @@ public class V116Domains : DevToolsDomains { private DevToolsSessionDomains domains; + /// + /// Initializes a new instance of the V115Domains class. + /// + /// The DevToolsSession to use with this set of domains. public V116Domains(DevToolsSession session) { this.domains = new DevToolsSessionDomains(session); diff --git a/dotnet/src/webdriver/DevTools/v116/V116Network.cs b/dotnet/src/webdriver/DevTools/v116/V116Network.cs index 166d37df498e4..b0dcb1d27b973 100644 --- a/dotnet/src/webdriver/DevTools/v116/V116Network.cs +++ b/dotnet/src/webdriver/DevTools/v116/V116Network.cs @@ -64,11 +64,19 @@ public override async Task EnableNetworkCaching() await network.SetCacheDisabled(new SetCacheDisabledCommandSettings() { CacheDisabled = false }); } + /// + /// Asynchronously enables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task EnableNetwork() { await network.Enable(new Network.EnableCommandSettings()); } + /// + /// Asynchronously disables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task DisableNetwork() { await network.Disable(); diff --git a/dotnet/src/webdriver/DevTools/v116/V116Target.cs b/dotnet/src/webdriver/DevTools/v116/V116Target.cs index d438624118a9c..055f35f40c7aa 100644 --- a/dotnet/src/webdriver/DevTools/v116/V116Target.cs +++ b/dotnet/src/webdriver/DevTools/v116/V116Target.cs @@ -97,8 +97,7 @@ public override async Task AttachToTarget(string targetId) /// /// The ID of the session of the target from which to detach. /// The ID of the target from which to detach. - /// - /// A task representing the asynchronous detach operation. + /// A task representing the asynchronous detach operation. public override async Task DetachFromTarget(string sessionId = null, string targetId = null) { await adapter.DetachFromTarget(new DetachFromTargetCommandSettings() diff --git a/dotnet/src/webdriver/DevTools/v85/V85Domains.cs b/dotnet/src/webdriver/DevTools/v85/V85Domains.cs index 88c82f5ef7e37..11fbdb3f99c53 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85Domains.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85Domains.cs @@ -28,6 +28,10 @@ public class V85Domains : DevToolsDomains { private DevToolsSessionDomains domains; + /// + /// Initializes a new instance of the V85Domains class. + /// + /// The DevToolsSession to use with this set of domains. public V85Domains(DevToolsSession session) { this.domains = new DevToolsSessionDomains(session); diff --git a/dotnet/src/webdriver/DevTools/v85/V85JavaScript.cs b/dotnet/src/webdriver/DevTools/v85/V85JavaScript.cs index b56572501cef3..092779b2d743b 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85JavaScript.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85JavaScript.cs @@ -32,7 +32,7 @@ public class V85JavaScript : JavaScript private PageAdapter page; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The DevTools Protocol adapter for the Runtime domain. /// The DevTools Protocol adapter for the Page domain. diff --git a/dotnet/src/webdriver/DevTools/v85/V85Log.cs b/dotnet/src/webdriver/DevTools/v85/V85Log.cs index ceac4cba621e9..4454399224f18 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85Log.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85Log.cs @@ -32,7 +32,7 @@ public class V85Log : DevTools.Log private LogAdapter adapter; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The adapter for the Log domain. public V85Log(LogAdapter adapter) diff --git a/dotnet/src/webdriver/DevTools/v85/V85Network.cs b/dotnet/src/webdriver/DevTools/v85/V85Network.cs index 2f024dcb24831..97e4b4f87d6d8 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85Network.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85Network.cs @@ -64,11 +64,19 @@ public override async Task EnableNetworkCaching() await network.SetCacheDisabled(new SetCacheDisabledCommandSettings() { CacheDisabled = false }); } + /// + /// Asynchronously ensables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task EnableNetwork() { await network.Enable(new Network.EnableCommandSettings()); } + /// + /// Asynchronously disables the Network domain.. + /// + /// A task that represents the asynchronous operation. public override async Task DisableNetwork() { await network.Disable(); diff --git a/dotnet/src/webdriver/DevTools/v85/V85Target.cs b/dotnet/src/webdriver/DevTools/v85/V85Target.cs index 3de3a4a0837e9..933c525c2bd68 100644 --- a/dotnet/src/webdriver/DevTools/v85/V85Target.cs +++ b/dotnet/src/webdriver/DevTools/v85/V85Target.cs @@ -33,7 +33,7 @@ public class V85Target : DevTools.Target private TargetAdapter adapter; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The adapter for the Target domain. public V85Target(TargetAdapter adapter) @@ -92,8 +92,7 @@ public override async Task AttachToTarget(string targetId) /// /// The ID of the session of the target from which to detach. /// The ID of the target from which to detach. - /// - /// A task representing the asynchronous detach operation. + /// A task representing the asynchronous detach operation. public override async Task DetachFromTarget(string sessionId = null, string targetId = null) { await adapter.DetachFromTarget(new DetachFromTargetCommandSettings() diff --git a/dotnet/src/webdriver/DriverCommand.cs b/dotnet/src/webdriver/DriverCommand.cs index 99f36f941fd7a..9cfbf27523cba 100644 --- a/dotnet/src/webdriver/DriverCommand.cs +++ b/dotnet/src/webdriver/DriverCommand.cs @@ -121,11 +121,6 @@ public static class DriverCommand /// public static readonly string FindShadowChildElements = "findShadowChildElements"; - /// - /// Describes an element - /// - //public static readonly string DescribeElement = "describeElement"; - /// /// Represents ClearElement command /// @@ -363,14 +358,44 @@ public static class DriverCommand // Virtual Authenticator API // http://w3c.github.io/webauthn#sctn-automation + /// + /// Represents the AddVirtualAuthenticator command. + /// public static readonly string AddVirtualAuthenticator = "addVirtualAuthenticator"; + + /// + /// Represents the RemoveVirtualAuthenticator command. + /// public static readonly string RemoveVirtualAuthenticator = "removeVirtualAuthenticator"; + + /// + /// Represents the AddCredential command + /// public static readonly string AddCredential = "addCredential"; + + /// + /// Represents the GetCredentials command. + /// public static readonly string GetCredentials = "getCredentials"; + + /// + /// Represents the RemoveCredential command. + /// public static readonly string RemoveCredential = "removeCredential"; + + /// + /// Represents the RemoveAllCredentials command. + /// public static readonly string RemoveAllCredentials = "removeAllCredentials"; + + /// + /// Represents the SetUserVerified command. + /// public static readonly string SetUserVerified = "setUserVerified"; + /// + /// Lists the set of known commands valid for the Selenium library. + /// public static readonly IList KnownCommands = new List() { Status, diff --git a/dotnet/src/webdriver/ElementCoordinates.cs b/dotnet/src/webdriver/ElementCoordinates.cs index 372f23c82c2fc..872d9da725331 100644 --- a/dotnet/src/webdriver/ElementCoordinates.cs +++ b/dotnet/src/webdriver/ElementCoordinates.cs @@ -31,7 +31,7 @@ internal class ElementCoordinates : ICoordinates private WebElement element; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The to be located. public ElementCoordinates(WebElement element) diff --git a/dotnet/src/webdriver/Firefox/FirefoxAndroidOptions.cs b/dotnet/src/webdriver/Firefox/FirefoxAndroidOptions.cs index a87c5680840e8..63532baf55af9 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxAndroidOptions.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxAndroidOptions.cs @@ -48,7 +48,7 @@ public ReadOnlyCollection AndroidIntentArguments /// /// Argument to launch the intent with. The given intent arguments are appended to the "am start" command. /// - /// The argument to add. + /// The argument to add. public void AddIntentArgument(string argument) { this.AddIntentArguments(argument); diff --git a/dotnet/src/webdriver/Firefox/FirefoxDriver.cs b/dotnet/src/webdriver/Firefox/FirefoxDriver.cs index 3c7ec5b34bd50..92d06b59469c4 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxDriver.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxDriver.cs @@ -371,7 +371,6 @@ public Screenshot GetFullPageScreenshot() /// /// Creates a session to communicate with a browser using the Chromium Developer Tools debugging protocol. /// - /// The version of the Chromium Developer Tools protocol to use. Defaults to autodetect the protocol version. /// The active session to use to communicate with the Chromium Developer Tools debugging protocol. public DevToolsSession GetDevToolsSession() { @@ -427,6 +426,12 @@ protected virtual void PrepareEnvironment() // Does nothing, but provides a hook for subclasses to do "stuff" } + /// + /// Disposes of the FirefoxDriver and frees all resources. + /// + /// A value indicating whether the user initiated the + /// disposal of the object. Pass if the user is actively + /// disposing the object; otherwise . protected override void Dispose(bool disposing) { if (disposing) diff --git a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs index 4459f898f80a2..c6ed5894971e7 100644 --- a/dotnet/src/webdriver/Firefox/FirefoxOptions.cs +++ b/dotnet/src/webdriver/Firefox/FirefoxOptions.cs @@ -128,6 +128,9 @@ public FirefoxDriverLogLevel LogLevel set { this.logLevel = value; } } + /// + /// Gets or sets a value indicating whether to enable the DevTools protocol for the launched browser. + /// public bool EnableDevToolsProtocol { get { return this.enableDevToolsProtocol; } diff --git a/dotnet/src/webdriver/ICustomDriverCommandExecutor.cs b/dotnet/src/webdriver/ICustomDriverCommandExecutor.cs index 5e1e8357619f0..b29566e0ad085 100644 --- a/dotnet/src/webdriver/ICustomDriverCommandExecutor.cs +++ b/dotnet/src/webdriver/ICustomDriverCommandExecutor.cs @@ -36,7 +36,7 @@ public interface ICustomDriverCommandExecutor /// /// Registers a set of commands to be executed with this driver instance. /// - /// An where the keys are the names of the commands to register, and the values are the objects describing the commands. + /// An where the keys are the names of the commands to register, and the values are the objects describing the commands. void RegisterCustomDriverCommands(IReadOnlyDictionary commands); /// diff --git a/dotnet/src/webdriver/IHasCommandExecutor.cs b/dotnet/src/webdriver/IHasCommandExecutor.cs index 12d44d6f224e8..f67e982ce8b3a 100644 --- a/dotnet/src/webdriver/IHasCommandExecutor.cs +++ b/dotnet/src/webdriver/IHasCommandExecutor.cs @@ -18,8 +18,14 @@ namespace OpenQA.Selenium { + /// + /// An interface indicating that the implementing class has a command executor. + /// public interface IHasCommandExecutor { + /// + /// Gets the command executor. + /// ICommandExecutor CommandExecutor { get; } } } diff --git a/dotnet/src/webdriver/IJavascriptExecutor.cs b/dotnet/src/webdriver/IJavascriptExecutor.cs index b3de02232ec6b..0835980f0c189 100644 --- a/dotnet/src/webdriver/IJavascriptExecutor.cs +++ b/dotnet/src/webdriver/IJavascriptExecutor.cs @@ -33,9 +33,9 @@ public interface IJavaScriptExecutor /// The value returned by the script. /// /// - /// The method executes JavaScript in the context of - /// the currently selected frame or window. This means that "document" will refer - /// to the current document. If the script has a return value, then the following + /// The ExecuteScript method executes JavaScript + /// in the context of the currently selected frame or window. This means that "document" + /// will refer to the current document. If the script has a return value, then the following /// steps will be taken: /// /// @@ -70,13 +70,13 @@ public interface IJavaScriptExecutor /// The value returned by the script. /// /// - /// The method executes JavaScript in the context of - /// the currently selected frame or window. This means that "document" will refer - /// to the current document. If the script has a return value, then the following + /// The ExecuteScript method executes JavaScript + /// in the context of the currently selected frame or window. This means that "document" + /// will refer to the current document. If the script has a return value, then the following /// steps will be taken: /// /// - /// + /// /// For an HTML element, this method returns a /// For a number, a is returned /// For a boolean, a is returned diff --git a/dotnet/src/webdriver/ISupportsPrint.cs b/dotnet/src/webdriver/ISupportsPrint.cs index 4f936709e08bd..e3a945f34381a 100644 --- a/dotnet/src/webdriver/ISupportsPrint.cs +++ b/dotnet/src/webdriver/ISupportsPrint.cs @@ -26,7 +26,7 @@ public interface ISupportsPrint /// /// Gets a object representing a PDF-formatted print representation of the page. /// - /// A object describing the options of the printed document. + /// A object describing the options of the printed document. /// The object containing the PDF-formatted print representation of the page. PrintDocument Print(PrintOptions options); } diff --git a/dotnet/src/webdriver/Interactions/ActionSequence.cs b/dotnet/src/webdriver/Interactions/ActionSequence.cs index 94bdce521767f..75c21e0422b13 100644 --- a/dotnet/src/webdriver/Interactions/ActionSequence.cs +++ b/dotnet/src/webdriver/Interactions/ActionSequence.cs @@ -69,6 +69,9 @@ public int Count get { return this.interactions.Count; } } + /// + /// Gets the input device for this Action sequence. + /// public InputDevice inputDevice { get { return this.inputDevice; } diff --git a/dotnet/src/webdriver/Interactions/Actions.cs b/dotnet/src/webdriver/Interactions/Actions.cs index 7585b62e3747d..f49520e7002c6 100644 --- a/dotnet/src/webdriver/Interactions/Actions.cs +++ b/dotnet/src/webdriver/Interactions/Actions.cs @@ -57,7 +57,13 @@ protected IActionExecutor ActionExecutor get { return this.actionExecutor; } } - public Actions SetActivePointer(PointerKind kind, String name) + /// + /// Sets the active pointer device for this Actions class. + /// + /// The kind of pointer device to set as active. + /// The name of the pointer device to set as active. + /// A self-reference to this Actions class. + public Actions SetActivePointer(PointerKind kind, string name) { IList sequences = this.actionBuilder.ToActionSequenceList(); @@ -65,11 +71,11 @@ public Actions SetActivePointer(PointerKind kind, String name) foreach (var sequence in sequences) { - Dictionary actions = sequence.ToDictionary(); + Dictionary actions = sequence.ToDictionary(); - String id = (string)actions["id"]; + string id = (string)actions["id"]; - if (id.Equals(name)) + if (id == name) { device = sequence.inputDevice; break; @@ -88,7 +94,12 @@ public Actions SetActivePointer(PointerKind kind, String name) return this; } - public Actions SetActiveKeyboard(String name) + /// + /// Sets the active keyboard device for this Actions class. + /// + /// The name of the keyboard device to set as active. + /// A self-reference to this Actions class. + public Actions SetActiveKeyboard(string name) { IList sequences = this.actionBuilder.ToActionSequenceList(); @@ -96,11 +107,11 @@ public Actions SetActiveKeyboard(String name) foreach (var sequence in sequences) { - Dictionary actions = sequence.ToDictionary(); + Dictionary actions = sequence.ToDictionary(); - String id = (string)actions["id"]; + string id = (string)actions["id"]; - if (id.Equals(name)) + if (id == name) { device = sequence.inputDevice; break; @@ -119,7 +130,12 @@ public Actions SetActiveKeyboard(String name) return this; } - public Actions SetActiveWheel(String name) + /// + /// Sets the active wheel device for this Actions class. + /// + /// The name of the wheel device to set as active. + /// A self-reference to this Actions class. + public Actions SetActiveWheel(string name) { IList sequences = this.actionBuilder.ToActionSequenceList(); @@ -127,11 +143,11 @@ public Actions SetActiveWheel(String name) foreach (var sequence in sequences) { - Dictionary actions = sequence.ToDictionary(); + Dictionary actions = sequence.ToDictionary(); - String id = (string)actions["id"]; + string id = (string)actions["id"]; - if (id.Equals(name)) + if (id == name) { device = sequence.inputDevice; break; @@ -150,36 +166,48 @@ public Actions SetActiveWheel(String name) return this; } - + /// + /// Gets the active pointer device for this Actions class. + /// + /// The active pointer device for this Actions class. public PointerInputDevice GetActivePointer() { if (this.activePointer == null) { SetActivePointer(PointerKind.Mouse, "default mouse"); } + return this.activePointer; } + /// + /// Gets the active keyboard device for this Actions class. + /// + /// The active keyboard device for this Actions class. public KeyInputDevice GetActiveKeyboard() { if (this.activeKeyboard == null) { SetActiveKeyboard("default keyboard"); } + return this.activeKeyboard; } + /// + /// Gets the active wheel device for this Actions class. + /// + /// The active wheel device for this Actions class. public WheelInputDevice GetActiveWheel() { if (this.activeWheel == null) { SetActiveWheel("default wheel"); } + return this.activeWheel; } - - /// /// Sends a modifier key down message to the browser. /// diff --git a/dotnet/src/webdriver/Interactions/PointerInputDevice.cs b/dotnet/src/webdriver/Interactions/PointerInputDevice.cs index 1aa6a4c4836fc..a5a59cc7e5807 100644 --- a/dotnet/src/webdriver/Interactions/PointerInputDevice.cs +++ b/dotnet/src/webdriver/Interactions/PointerInputDevice.cs @@ -264,6 +264,7 @@ public Interaction CreatePointerMove(CoordinateOrigin origin, int xOffset, int y /// The horizontal offset from the origin of the move. /// The vertical offset from the origin of the move. /// The length of time the move gesture takes to complete. + /// The object containing additional proprties for this pointer move operation. /// The action representing the pointer move gesture. /// Thrown when passing CoordinateOrigin.Element into origin. /// Users should us the other CreatePointerMove overload to move to a specific element. @@ -286,6 +287,9 @@ public Interaction CreatePointerCancel() return new PointerCancelInteraction(this); } + /// + /// A class representing the properties of a pointer event. + /// public class PointerEventProperties { private double? width; @@ -399,6 +403,10 @@ public double? AzimuthAngle set { this.azimuthAngle = value; } } + /// + /// Serializes the properties of this input device as a dictionary. + /// + /// The dictionary containing the properties of this device. public Dictionary ToDictionary() { Dictionary toReturn = new Dictionary(); @@ -496,6 +504,7 @@ public PointerUpInteraction(InputDevice sourceDevice, MouseButton button, Pointe : base(sourceDevice) { this.button = button; + this.eventProperties = properties; } public override Dictionary ToDictionary() diff --git a/dotnet/src/webdriver/Interactions/WheelInputDevice.cs b/dotnet/src/webdriver/Interactions/WheelInputDevice.cs index ddd3a5c73b65e..1175d92b5d4b6 100644 --- a/dotnet/src/webdriver/Interactions/WheelInputDevice.cs +++ b/dotnet/src/webdriver/Interactions/WheelInputDevice.cs @@ -108,6 +108,9 @@ public Interaction CreateWheelScroll(CoordinateOrigin origin, int xOffset, int y return new WheelScrollInteraction(this, null, origin, xOffset, yOffset, deltaX, deltaY, duration); } + /// + /// Object representing the scroll origin of a scroll operation. + /// public class ScrollOrigin { private IWebElement element; @@ -115,24 +118,36 @@ public class ScrollOrigin private int xOffset = 0; private int yOffset = 0; + /// + /// Gets or sets the element for the scroll origin. + /// public IWebElement Element { get { return this.element; } set { this.element = value; } } + /// + /// Gets or sets a value indicating whether the viewport should be used as the origin. + /// public bool Viewport { get { return this.viewport; } set { this.viewport = value; } } + /// + /// Gets or sets the horizontal offset of the scroll origin. + /// public int XOffset { get { return this.xOffset; } set { this.xOffset = value; } } + /// + /// Gets or sets the vertical offset of the scroll origin. + /// public int YOffset { get { return this.yOffset; } diff --git a/dotnet/src/webdriver/Internal/ResourceUtilities.cs b/dotnet/src/webdriver/Internal/ResourceUtilities.cs index 3bfbfa7ea41a8..40ef810637751 100644 --- a/dotnet/src/webdriver/Internal/ResourceUtilities.cs +++ b/dotnet/src/webdriver/Internal/ResourceUtilities.cs @@ -31,7 +31,6 @@ namespace OpenQA.Selenium.Internal /// internal static class ResourceUtilities { - private static string assemblyVersion; private static string productVersion; private static string platformFamily; diff --git a/dotnet/src/webdriver/JavaScriptEngine.cs b/dotnet/src/webdriver/JavaScriptEngine.cs index 729a7dc655dbf..b3828234f1052 100644 --- a/dotnet/src/webdriver/JavaScriptEngine.cs +++ b/dotnet/src/webdriver/JavaScriptEngine.cs @@ -312,6 +312,34 @@ public async Task Reset() await ClearAll(); } + /// + /// Releases all resources associated with this . + /// + public void Dispose() + { + this.Dispose(true); + } + + /// + /// Releases all resources associated with this . + /// + /// if the Dispose method was explicitly called; otherwise, . + protected virtual void Dispose(bool disposing) + { + if (!this.isDisposed) + { + if (disposing) + { + if (this.session.IsValueCreated) + { + this.session.Value.Dispose(); + } + } + + this.isDisposed = true; + } + } + private async Task ClearPinnedScripts() { // Use a copy of the list to prevent the iterator from becoming invalid @@ -395,26 +423,5 @@ private void OnConsoleApiCalled(object sender, ConsoleApiCalledEventArgs e) }); } } - - public void Dispose() - { - this.Dispose(true); - } - - protected virtual void Dispose(bool disposing) - { - if (!this.isDisposed) - { - if (disposing) - { - if (this.session.IsValueCreated) - { - this.session.Value.Dispose(); - } - } - - this.isDisposed = true; - } - } } } diff --git a/dotnet/src/webdriver/Logs.cs b/dotnet/src/webdriver/Logs.cs index 03abda249c5ad..4ad943d9b7a44 100644 --- a/dotnet/src/webdriver/Logs.cs +++ b/dotnet/src/webdriver/Logs.cs @@ -30,7 +30,7 @@ public class Logs : ILogs private WebDriver driver; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// Instance of the driver currently in use public Logs(WebDriver driver) diff --git a/dotnet/src/webdriver/PrintOptions.cs b/dotnet/src/webdriver/PrintOptions.cs index 4333f45ffff14..2c4c82a12bef3 100644 --- a/dotnet/src/webdriver/PrintOptions.cs +++ b/dotnet/src/webdriver/PrintOptions.cs @@ -240,6 +240,9 @@ private static int ParsePageRangePart(string pageRangePart, int defaultValue) return pageRangePartValue; } + /// + /// An object representing the page size of the print options. + /// public class PageSize { private double height = DefaultPageHeight; @@ -298,6 +301,9 @@ public double WidthInInches } } + /// + /// An object representing the margins for printing. + /// public class Margins { private double top = DefaultMarginSize; @@ -305,6 +311,9 @@ public class Margins private double left = DefaultMarginSize; private double right = DefaultMarginSize; + /// + /// Gets or sets the top margin of the print options. + /// public double Top { get { return top; } @@ -319,6 +328,9 @@ public double Top } } + /// + /// Gets or sets the bottom margin of the print options. + /// public double Bottom { get { return bottom; } @@ -333,6 +345,9 @@ public double Bottom } } + /// + /// Gets or sets the left margin of the print options. + /// public double Left { get { return left; } @@ -347,6 +362,9 @@ public double Left } } + /// + /// Gets or sets the right margin of the print options. + /// public double Right { get { return right; } diff --git a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs index 49cd7ab03af75..4eb8c228d32b9 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs @@ -59,7 +59,14 @@ namespace OpenQA.Selenium.Remote /// public class RemoteWebDriver : WebDriver, IDevTools { + /// + /// The name of the Selenium grid remote DevTools end point capability. + /// public readonly string RemoteDevToolsEndPointCapabilityName = "se:cdp"; + + /// + /// The name of the Selenium remote DevTools version capability. + /// public readonly string RemoteDevToolsVersionCapabilityName = "se:cdpVersion"; private const string DefaultRemoteServerUrl = "http://127.0.0.1:4444/wd/hub"; @@ -408,11 +415,20 @@ public ReadOnlyCollection FindElementsByCssSelector(string cssSelec return this.FindElements("css selector", cssSelector); } + /// + /// Creates a session to communicate with a browser using a Developer Tools debugging protocol. + /// + /// The active session to use to communicate with the Developer Tools debugging protocol. public DevToolsSession GetDevToolsSession() { return GetDevToolsSession(DevToolsSession.AutoDetectDevToolsProtocolVersion); } + /// + /// Creates a session to communicate with a browser using a specific version of the Developer Tools debugging protocol. + /// + /// The specific version of the Developer Tools debugging protocol to use. + /// The active session to use to communicate with the Developer Tools debugging protocol. public DevToolsSession GetDevToolsSession(int protocolVersion) { if (this.devToolsSession == null) @@ -462,6 +478,10 @@ public void CloseDevToolsSession() } } + /// + /// Releases all resources associated with this . + /// + /// if the Dispose method was explicitly called; otherwise, . protected override void Dispose(bool disposing) { if (disposing) diff --git a/dotnet/src/webdriver/Remote/RemoteWebElement.cs b/dotnet/src/webdriver/Remote/RemoteWebElement.cs index 09eca5073c2cf..c0429e84b74f0 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebElement.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebElement.cs @@ -26,6 +26,11 @@ namespace OpenQA.Selenium.Remote [Obsolete("Replaced for dependent projects with WebElement class. Users should be using the IWebElement interface.")] public class RemoteWebElement : WebElement { + /// + /// Initializes a new instance of the class. + /// + /// The instance that is the parent of this element. + /// The internal ID of the element. public RemoteWebElement(WebDriver parentDriver, string id) : base(parentDriver, id) { } diff --git a/dotnet/src/webdriver/UserAgent.cs b/dotnet/src/webdriver/UserAgent.cs index 0afe45e64a8de..333273c45c32b 100644 --- a/dotnet/src/webdriver/UserAgent.cs +++ b/dotnet/src/webdriver/UserAgent.cs @@ -23,8 +23,19 @@ namespace OpenQA.Selenium.DevTools /// public class UserAgent { + /// + /// Gets or sets the user agent string. + /// public string UserAgentString { get; set; } + + /// + /// Gets or sets the language to accept in headers. + /// public string AcceptLanguage { get; set; } + + /// + /// Gets or sets the value of the platform. + /// public string Platform { get; set; } } } diff --git a/dotnet/src/webdriver/VirtualAuth/Credential.cs b/dotnet/src/webdriver/VirtualAuth/Credential.cs index 9df9ec1f6beac..2c0f814ee96c7 100644 --- a/dotnet/src/webdriver/VirtualAuth/Credential.cs +++ b/dotnet/src/webdriver/VirtualAuth/Credential.cs @@ -34,13 +34,7 @@ public class Credential private readonly byte[] userHandle; private readonly int signCount; - private Credential( - byte[] id, - bool isResidentCredential, - string rpId, - string privateKey, - byte[] userHandle, - int signCount) + private Credential(byte[] id, bool isResidentCredential, string rpId, string privateKey, byte[] userHandle, int signCount) { this.id = id; this.isResidentCredential = isResidentCredential; @@ -50,60 +44,86 @@ private Credential( this.signCount = signCount; } - public static Credential CreateNonResidentCredential( - byte[] id, - string rpId, - string privateKey, - int signCount) + /// + /// Creates a credential for use with a virtual authenticator. + /// + /// A byte array representing the ID of the credentials. + /// The ID of the relying party to which the credential is scoped. + /// The private Key for the credentials. + /// The signature counter for the credentials. + /// The created instance of the Credential class. + public static Credential CreateNonResidentCredential(byte[] id, string rpId, string privateKey, int signCount) { return new Credential(id, false, rpId, privateKey, null, signCount); } - public static Credential CreateResidentCredential( - byte[] id, - string rpId, - string privateKey, - byte[] userHandle, - int signCount) + /// + /// Creates a credential for use with a virtual authenticator. + /// + /// A byte array representing the ID of the credentials. + /// The ID of the relying party to which the credential is scoped. + /// The private Key for the credentials. + /// The user handle associated to the credential. + /// The signature counter for the credentials. + /// The created instance of the Credential class. + public static Credential CreateResidentCredential(byte[] id, string rpId, string privateKey, byte[] userHandle, int signCount) { - return new Credential( - id, - true, - rpId, - privateKey, - userHandle, - signCount); + return new Credential(id, true, rpId, privateKey, userHandle, signCount); } + /// + /// Gets the byte array of the ID of the credential. + /// public byte[] Id { get { return (byte[])id.Clone(); } } + /// + /// Gets a value indicating whether this Credential is a resident credential. + /// public bool IsResidentCredential { get { return this.isResidentCredential; } } + + /// + /// Gets the ID of the relying party of this credential. + /// public string RpId { get { return this.rpId; } } + /// + /// Gets the private key of the credential. + /// public string PrivateKey { get { return this.privateKey; } } + /// + /// Gets the user handle of the credential. + /// public byte[] UserHandle { get { return userHandle == null ? null : (byte[])userHandle.Clone(); } } + /// + /// Gets the signature counter associated to the public key credential source. + /// public int SignCount { get { return this.signCount; } } + /// + /// Creates a Credential instance from a dictionary of values. + /// + /// The dictionary of values to use to create the Credential instance. + /// The created instance of the Credential. public static Credential FromDictionary(Dictionary dictionary) { return new Credential( @@ -115,6 +135,10 @@ public static Credential FromDictionary(Dictionary dictionary) (int)((long)dictionary["signCount"])); } + /// + /// Serializes this Credential instance to a dictionary. + /// + /// The dictionary containing the values for this Credential. public Dictionary ToDictionary() { Dictionary toReturn = new Dictionary(); @@ -132,4 +156,4 @@ public Dictionary ToDictionary() return toReturn; } } -} \ No newline at end of file +} diff --git a/dotnet/src/webdriver/VirtualAuth/IHasVirtualAuthenticator.cs b/dotnet/src/webdriver/VirtualAuth/IHasVirtualAuthenticator.cs index de17b99f8e963..e5358bb96bc85 100644 --- a/dotnet/src/webdriver/VirtualAuth/IHasVirtualAuthenticator.cs +++ b/dotnet/src/webdriver/VirtualAuth/IHasVirtualAuthenticator.cs @@ -19,23 +19,57 @@ namespace OpenQA.Selenium.VirtualAuth { + /// + /// Interface indicating that an object supports using a virtual authenticator. + /// public interface IHasVirtualAuthenticator { + /// + /// Adds a virtual authenticator. + /// + /// The VirtualAuthenticatorOptions to use in creating the authenticator. + /// The ID of the added virtual authenticator. string AddVirtualAuthenticator(VirtualAuthenticatorOptions options); + /// + /// Removes a virtual authenticator. + /// + /// The ID of the virtual authenticator to remove. void RemoveVirtualAuthenticator(string id); + /// + /// Adds a credential to the virtual authenticator. + /// + /// The credential to add to the authenticator. void AddCredential(Credential credential); + /// + /// Gets a list of the credentials registered to the virtual authenticator. + /// + /// The list of credentials registered to the virtual authenticator. List GetCredentials(); + /// + /// Removes a credential from the virtual authenticator. + /// + /// A byte array representing the ID of the credential to remove. void RemoveCredential(byte[] credentialId); + /// + /// Removes a credential from the virtual authenticator. + /// + /// A string representing the ID of the credential to remove. void RemoveCredential(string credentialId); + /// + /// Removes all credentials registered to this virtual authenticator. + /// void RemoveAllCredentials(); + /// + /// Sets whether or not a user is verified in this virtual authenticator. + /// + /// if the user is verified; otherwise . void SetUserVerified(bool verified); } - -} \ No newline at end of file +} diff --git a/dotnet/src/webdriver/VirtualAuth/VirtualAuthenticatorOptions.cs b/dotnet/src/webdriver/VirtualAuth/VirtualAuthenticatorOptions.cs index e3aa8d8f40d98..839a398cecfdb 100644 --- a/dotnet/src/webdriver/VirtualAuth/VirtualAuthenticatorOptions.cs +++ b/dotnet/src/webdriver/VirtualAuth/VirtualAuthenticatorOptions.cs @@ -27,17 +27,45 @@ namespace OpenQA.Selenium.VirtualAuth /// public class VirtualAuthenticatorOptions { + /// + /// The protocol to use for the virtual authenticator. + /// public static class Protocol { + /// + /// Value representing the CTAP2 protocol. + /// public static readonly string CTAP2 = "ctap2"; + + /// + /// Value representing the U2F protocol. + /// public static readonly string U2F = "ctap1/u2f"; } + /// + /// The transport to use for the virtual authenticator. + /// public static class Transport { + /// + /// Value representing the BLE transport. + /// public static readonly string BLE = "ble"; + + /// + /// Value representing the "internal" transport. + /// public static readonly string INTERNAL = "internal"; + + /// + /// Value representing the near-field communications transport. + /// public static readonly string NFC = "nfc"; + + /// + /// Value representing the USB transport. + /// public static readonly string USB = "usb"; } @@ -74,10 +102,7 @@ public VirtualAuthenticatorOptions SetProtocol(string protocol) /// VirtualAuthenticatorOptions public VirtualAuthenticatorOptions SetTransport(string transport) { - if (Transport.BLE.Equals(transport) || - Transport.INTERNAL.Equals(transport) || - Transport.NFC.Equals(transport) || - Transport.USB.Equals(transport)) + if (Transport.BLE == transport || Transport.INTERNAL == transport || Transport.NFC == transport || Transport.USB == transport) { this.transport = transport; return this; @@ -137,6 +162,10 @@ public VirtualAuthenticatorOptions SetIsUserVerified(bool isUserVerified) return this; } + /// + /// Serializes this set of options to a dictionary of key-value pairs. + /// + /// The dictionary containing the values of this set of options. public Dictionary ToDictionary() { Dictionary toReturn = new Dictionary(); @@ -151,4 +180,4 @@ public Dictionary ToDictionary() return toReturn; } } -} \ No newline at end of file +} diff --git a/dotnet/src/webdriver/WebDriver.cs b/dotnet/src/webdriver/WebDriver.cs index e208992d3acfc..f2c421991fa36 100644 --- a/dotnet/src/webdriver/WebDriver.cs +++ b/dotnet/src/webdriver/WebDriver.cs @@ -28,6 +28,9 @@ namespace OpenQA.Selenium { + /// + /// A base class representing a driver for a web browser. + /// public class WebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, IFindsElement, ITakesScreenshot, ISupportsPrint, IActionExecutor, IAllowsFileDetection, IHasCapabilities, IHasCommandExecutor, IHasSessionId, ICustomDriverCommandExecutor, IHasVirtualAuthenticator { /// @@ -421,11 +424,21 @@ public ITargetLocator SwitchTo() return new TargetLocator(this); } + /// + /// Instructs the driver to change its settings. + /// + /// An object allowing the user to change + /// the settings of the driver. public IOptions Manage() { return new OptionsManager(this); } + /// + /// Instructs the driver to navigate the browser to another location. + /// + /// An object allowing the user to access + /// the browser's history and to navigate to a given URL. public INavigation Navigate() { return new Navigator(this); @@ -450,7 +463,7 @@ public object ExecuteCustomDriverCommand(string driverCommandToExecute, Dictiona /// /// Registers a set of commands to be executed with this driver instance. /// - /// An where the keys are the names of the commands to register, and the values are the objects describing the commands. + /// An where the keys are the names of the commands to register, and the values are the objects describing the commands. public void RegisterCustomDriverCommands(IReadOnlyDictionary commands) { foreach (KeyValuePair entry in commands) @@ -995,6 +1008,9 @@ public void RemoveVirtualAuthenticator(string authenticatorId) this.authenticatorId = null; } + /// + /// Gets the virtual authenticator ID for this WebDriver instance. + /// public string AuthenticatorId { get; } /// diff --git a/dotnet/src/webdriver/WebElement.cs b/dotnet/src/webdriver/WebElement.cs index b8ac81ee51005..44a9d884b8df0 100644 --- a/dotnet/src/webdriver/WebElement.cs +++ b/dotnet/src/webdriver/WebElement.cs @@ -29,6 +29,9 @@ namespace OpenQA.Selenium { + /// + /// A base class representing an HTML element on a page. + /// public class WebElement : IWebElement, IFindsElement, IWrapsDriver, ILocatable, ITakesScreenshot, IWebDriverObjectReference { /// @@ -261,7 +264,7 @@ string IWebDriverObjectReference.ObjectReferenceId /// This property is internal to the WebDriver instance, and is /// not intended to be used in your code. The element's ID has no meaning /// outside of internal WebDriver usage, so it would be improper to scope - /// it as public. However, both subclasses of + /// it as public. However, both subclasses of /// and the parent driver hosting the element have a need to access the /// internal element ID. Therefore, we have two properties returning the /// same value, one scoped as internal, the other as protected. diff --git a/third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs b/third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs index fd22e53e79e22..cd415d9b225a5 100644 --- a/third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs +++ b/third_party/dotnet/devtools/src/generator/ProtocolDefinition/ProtocolDefinitionItem.cs @@ -13,11 +13,10 @@ public bool Deprecated set; } - [JsonProperty(PropertyName = "description")] public string Description { - get; - set; + get => InitialDescription != null ? InitialDescription.Replace("<", "<").Replace(">", ">") : null; + set => InitialDescription = value; } [JsonProperty(PropertyName = "experimental")] @@ -39,5 +38,12 @@ public override string ToString() { return Name; } + + [JsonProperty(PropertyName = "description")] + protected string InitialDescription + { + get; + set; + } } } diff --git a/third_party/dotnet/devtools/src/generator/Templates/DevToolsSessionDomains.hbs b/third_party/dotnet/devtools/src/generator/Templates/DevToolsSessionDomains.hbs index 9d2dbeaf4a092..02658ac0f90d7 100644 --- a/third_party/dotnet/devtools/src/generator/Templates/DevToolsSessionDomains.hbs +++ b/third_party/dotnet/devtools/src/generator/Templates/DevToolsSessionDomains.hbs @@ -1,13 +1,20 @@ -namespace {{rootNamespace}} +namespace {{rootNamespace}} { using System; - + + /// + /// The active domains for a DevTools session. + /// public class DevToolsSessionDomains : OpenQA.Selenium.DevTools.DevToolsSessionDomains { {{#each domains}} private Lazy<{{dehumanize Name}}.{{dehumanize Name}}Adapter> m_{{dehumanize Name}}; {{/each}} + /// + /// Initializes a new instance of the DevToolsSessionDomains class. + /// + /// The DevTools session to be used with the domains public DevToolsSessionDomains(IDevToolsSession session) : base() { {{#each domains}} @@ -25,6 +32,9 @@ } {{/each}} + /// + /// Populates the data structure mapping commands to the type for the command response. + /// protected override void PopulateCommandResponseTypeMap() { {{#each commands}} diff --git a/third_party/dotnet/devtools/src/generator/Templates/command.hbs b/third_party/dotnet/devtools/src/generator/Templates/command.hbs index dfe3a6331a46c..e5ccc3dc124e2 100644 --- a/third_party/dotnet/devtools/src/generator/Templates/command.hbs +++ b/third_party/dotnet/devtools/src/generator/Templates/command.hbs @@ -1,4 +1,4 @@ -namespace {{rootNamespace}}.{{domain.Name}} +namespace {{rootNamespace}}.{{domain.Name}} { using Newtonsoft.Json; @@ -8,7 +8,10 @@ public sealed class {{className}}CommandSettings : ICommand { private const string DevToolsRemoteInterface_CommandName = "{{domain.Name}}.{{command.Name}}"; - + + /// + /// Gets the name of the command. + /// [JsonIgnore] public string CommandName { @@ -34,6 +37,9 @@ {{/each}} } + /// + /// Response for {{xml-code-comment command.Description 1}} + /// public sealed class {{className}}CommandResponse : ICommandResponse<{{className}}CommandSettings> { {{#each command.Returns}} @@ -54,4 +60,4 @@ } {{/each}} } -} \ No newline at end of file +} diff --git a/third_party/dotnet/devtools/src/generator/Templates/domain.hbs b/third_party/dotnet/devtools/src/generator/Templates/domain.hbs index 3dd6eb1b4b04c..2eb033990c404 100644 --- a/third_party/dotnet/devtools/src/generator/Templates/domain.hbs +++ b/third_party/dotnet/devtools/src/generator/Templates/domain.hbs @@ -1,4 +1,4 @@ -namespace {{rootNamespace}}.{{domain.Name}} +namespace {{rootNamespace}}.{{domain.Name}} { using System; using System.Collections.Generic; @@ -14,6 +14,10 @@ private readonly string m_domainName = "{{dehumanize domain.Name}}"; private Dictionary m_eventMap = new Dictionary(); + /// + /// Initializes a new instance of the {{dehumanize domain.Name}}Adapter class. + /// + /// The IDevToolsSession to be used with this adapter. public {{dehumanize domain.Name}}Adapter(IDevToolsSession session) { m_session = session ?? throw new ArgumentNullException(nameof(session)); @@ -72,4 +76,4 @@ } {{/each}} } -} \ No newline at end of file +} diff --git a/third_party/dotnet/devtools/src/generator/Templates/type-enum.hbs b/third_party/dotnet/devtools/src/generator/Templates/type-enum.hbs index 62189d624383d..e7230cdb7a26f 100644 --- a/third_party/dotnet/devtools/src/generator/Templates/type-enum.hbs +++ b/third_party/dotnet/devtools/src/generator/Templates/type-enum.hbs @@ -1,4 +1,4 @@ -namespace {{rootNamespace}}.{{domain.Name}} +namespace {{rootNamespace}}.{{domain.Name}} { using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -11,8 +11,11 @@ public enum {{className}} { {{#each type.Enum}} + /// + /// Enumerated member for the {{this}} value. + /// [EnumMember(Value = "{{this}}")] {{dehumanize this}}, {{/each}} } -} \ No newline at end of file +}