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] Use vendor-specific method names for additional Chromium options. #9906

Merged
merged 1 commit into from Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions dotnet/src/webdriver/Chrome/ChromeOptions.cs
Expand Up @@ -79,5 +79,25 @@ public override string CapabilityName
{
get { return string.Format(CultureInfo.InvariantCulture, "{0}:{1}", this.VendorPrefix, ChromeOptionsCapabilityName); }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Chrome driver.
/// </summary>
/// <param name="optionName">The name of the capability to add.</param>
/// <param name="optionValue">The value of the capability to add.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Chrome-specific options object passed to
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
public void AddAdditionalChromeOption(string optionName, object optionValue)
{
this.AddAdditionalChromiumOption(optionName, optionValue);
}
}
}
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/Chromium/ChromiumOptions.cs
Expand Up @@ -495,12 +495,12 @@ public void AddWindowTypes(IEnumerable<string> windowTypesToAdd)
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalChromeOption(string, object)"/>
/// <remarks>Calling <see cref="AddAdditionalChromiumOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Chrome-specific options object passed to
/// webdriver executable (property name 'goog:chromeOptions').</remarks>
public void AddAdditionalChromeOption(string optionName, object optionValue)
/// Calling this method adds capabilities to the Chromium-specific options object passed to
/// webdriver executable (e.g. property name 'goog:chromeOptions').</remarks>
protected void AddAdditionalChromiumOption(string optionName, object optionValue)
{
this.ValidateCapabilityName(optionName);
this.additionalChromeOptions[optionName] = optionValue;
Expand Down Expand Up @@ -554,7 +554,7 @@ public void AddAdditionalCapability(string capabilityName, object capabilityValu
}
else
{
this.AddAdditionalChromeOption(capabilityName, capabilityValue);
this.AddAdditionalChromiumOption(capabilityName, capabilityValue);
}
}

Expand Down
20 changes: 20 additions & 0 deletions dotnet/src/webdriver/Edge/EdgeOptions.cs
Expand Up @@ -82,5 +82,25 @@ public bool UseWebView
get { return this.BrowserName == WebViewBrowserNameValue; }
set { this.BrowserName = value ? WebViewBrowserNameValue : DefaultBrowserNameValue; }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Edge driver.
/// </summary>
/// <param name="optionName">The name of the capability to add.</param>
/// <param name="optionValue">The value of the capability to add.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="optionName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalEdgeOption(string, object)"/>
/// where <paramref name="optionName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="optionValue"/>.
/// Calling this method adds capabilities to the Edge-specific options object passed to
/// webdriver executable (property name 'ms:edgeOptions').</remarks>
public void AddAdditionalEdgeOption(string optionName, object optionValue)
{
this.AddAdditionalChromiumOption(optionName, optionValue);
}
}
}