Skip to content

Commit

Permalink
[dotnet] remove deprecated AddAdditionalCapability
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 23, 2022
1 parent 1556e86 commit 927e5af
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 196 deletions.
52 changes: 0 additions & 52 deletions dotnet/src/webdriver/Chromium/ChromiumOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,58 +506,6 @@ protected void AddAdditionalChromiumOption(string optionName, object optionValue
this.additionalChromeOptions[optionName] = optionValue;
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Chromium driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">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="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/>.
/// Also, by default, calling this method adds capabilities to the options object passed to
/// chromedriver.exe.</remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalChromeOption method for adding additional options")]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
{
// Add the capability to the chromeOptions object by default. This is to handle
// the 80% case where the chromedriver team adds a new option in chromedriver.exe
// and the bindings have not yet had a type safe option added.
this.AddAdditionalCapability(capabilityName, capabilityValue, false);
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Chromium driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">The value of the capability to add.</param>
/// <param name="isGlobalCapability">Indicates whether the capability is to be set as a global
/// capability for the driver instead of a Chromium-specific option.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object, bool)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/></remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalChromeOption method for adding additional options")]
public void AddAdditionalCapability(string capabilityName, object capabilityValue, bool isGlobalCapability)
{
if (isGlobalCapability)
{
this.AddAdditionalOption(capabilityName, capabilityValue);
}
else
{
this.AddAdditionalChromiumOption(capabilityName, capabilityValue);
}
}

/// <summary>
/// Returns DesiredCapabilities for Chromium with these options included as
/// capabilities. This does not copy the options. Further changes will be
Expand Down
17 changes: 0 additions & 17 deletions dotnet/src/webdriver/DriverOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,23 +228,6 @@ public virtual void AddAdditionalOption(string optionName, object optionValue)
this.additionalCapabilities[optionName] = optionValue;
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the specific browser driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">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="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/>.
/// </remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the browser-specific method for adding additional options")]
public abstract void AddAdditionalCapability(string capabilityName, object capabilityValue);

/// <summary>
/// Returns the <see cref="ICapabilities"/> for the specific browser driver with these
/// options included as capabilities. This does not copy the options. Further
Expand Down
52 changes: 0 additions & 52 deletions dotnet/src/webdriver/Firefox/FirefoxOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,58 +274,6 @@ public void AddAdditionalFirefoxOption(string optionName, object optionValue)
this.additionalFirefoxOptions[optionName] = optionValue;
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Firefox driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">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="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/>.
/// Also, by default, calling this method adds capabilities to the options object passed to
/// geckodriver.exe.</remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalFirefoxOption method for adding additional options")]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
{
// Add the capability to the FirefoxOptions object by default. This is to handle
// the 80% case where the geckodriver team adds a new option in geckodriver.exe
// and the bindings have not yet had a type safe option added.
this.AddAdditionalFirefoxOption(capabilityName, capabilityValue);
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Firefox driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">The value of the capability to add.</param>
/// <param name="isGlobalCapability">Indicates whether the capability is to be set as a global
/// capability for the driver instead of a Firefox-specific option.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object, bool)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/></remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalFirefoxOption method for adding additional options")]
public void AddAdditionalCapability(string capabilityName, object capabilityValue, bool isGlobalCapability)
{
if (isGlobalCapability)
{
this.AddAdditionalOption(capabilityName, capabilityValue);
}
else
{
this.AddAdditionalFirefoxOption(capabilityName, capabilityValue);
}
}

/// <summary>
/// Returns DesiredCapabilities for Firefox with these options included as
/// capabilities. This does not copy the options. Further changes will be
Expand Down
51 changes: 0 additions & 51 deletions dotnet/src/webdriver/IE/InternetExplorerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,57 +339,6 @@ public void AddAdditionalInternetExplorerOption(string optionName, object option
this.additionalInternetExplorerOptions[optionName] = optionValue;
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Internet Explorer driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">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="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object)"/>
/// where <paramref name="capabilityName"/> has already been added will overwrite the
/// existing value with the new value in <paramref name="capabilityValue"/>.
/// Also, by default, calling this method adds capabilities to the options object passed to
/// IEDriverServer.exe.</remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalInternetExplorerOption method for adding additional options")]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
{
// Add the capability to the ieOptions object by default. This is to handle
// the 80% case where the IE driver adds a new option in IEDriverServer.exe
// and the bindings have not yet had a type safe option added.
this.AddAdditionalCapability(capabilityName, capabilityValue, false);
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Internet Explorer driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">The value of the capability to add.</param>
/// <param name="isGlobalCapability">Indicates whether the capability is to be set as a global
/// capability for the driver instead of a IE-specific option.</param>
/// <exception cref="ArgumentException">
/// thrown when attempting to add a capability for which there is already a type safe option, or
/// when <paramref name="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability(string, object, bool)"/> where <paramref name="capabilityName"/>
/// has already been added will overwrite the existing value with the new value in <paramref name="capabilityValue"/></remarks>
[Obsolete("Use the temporary AddAdditionalOption method or the AddAdditionalInternetExplorerOption method for adding additional options")]
public void AddAdditionalCapability(string capabilityName, object capabilityValue, bool isGlobalCapability)
{
if (isGlobalCapability)
{
this.AddAdditionalOption(capabilityName, capabilityValue);
}
else
{
this.AddAdditionalInternetExplorerOption(capabilityName, capabilityValue);
}
}

/// <summary>
/// Returns DesiredCapabilities for IE with these options included as
/// capabilities. This copies the options. Further changes will not be
Expand Down
18 changes: 0 additions & 18 deletions dotnet/src/webdriver/Safari/SafariOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,6 @@ public bool EnableAutomaticProfiling
set { this.enableAutomaticProfiling = value; }
}

/// <summary>
/// Provides a means to add additional capabilities not yet added as type safe options
/// for the Safari driver.
/// </summary>
/// <param name="capabilityName">The name of the capability to add.</param>
/// <param name="capabilityValue">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="capabilityName"/> is <see langword="null"/> or the empty string.
/// </exception>
/// <remarks>Calling <see cref="AddAdditionalCapability"/> where <paramref name="capabilityName"/>
/// has already been added will overwrite the existing value with the new value in <paramref name="capabilityValue"/></remarks>
[Obsolete("Use the temporary AddAdditionalOption method for adding additional options")]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
{
this.AddAdditionalOption(capabilityName, capabilityValue);
}

/// <summary>
/// Returns ICapabilities for Safari with these options included as
/// capabilities. This copies the options. Further changes will not be
Expand Down
3 changes: 1 addition & 2 deletions dotnet/test/common/PageLoadingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,7 @@ private void InitLocalDriver(PageLoadStrategy strategy)

private class PageLoadStrategyOptions : DriverOptions
{
[Obsolete]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
public override void AddAdditionalOption(string capabilityName, object capabilityValue)
{
}

Expand Down
3 changes: 1 addition & 2 deletions dotnet/test/common/ProxySettingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ private void InitLocalDriver(Proxy proxy)

private class ProxyOptions : DriverOptions
{
[Obsolete]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
public override void AddAdditionalOption(string capabilityName, object capabilityValue)
{
}

Expand Down
3 changes: 1 addition & 2 deletions dotnet/test/common/UnexpectedAlertBehaviorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ private Func<bool> ElementTextToBeEqual(IWebElement resultElement, string expect

public class UnhandledPromptBehaviorOptions : DriverOptions
{
[Obsolete]
public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
public override void AddAdditionalOption(string capabilityName, object capabilityValue)
{
}

Expand Down

0 comments on commit 927e5af

Please sign in to comment.