Skip to content

Commit

Permalink
[dotnet] remove obsolete commands
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Jun 24, 2022
1 parent 3b3a3ed commit 2fbfc62
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 228 deletions.
13 changes: 0 additions & 13 deletions dotnet/src/webdriver/Alert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,5 @@ public void SendKeys(string keysToSend)

this.driver.InternalExecute(DriverCommand.SetAlertValue, parameters);
}

/// <summary>
/// Sets the user name and password in an alert prompting for credentials.
/// </summary>
/// <param name="userName">The user name to set.</param>
/// <param name="password">The password to set.</param>
public void SetAuthenticationCredentials(string userName, string password)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("username", userName);
parameters.Add("password", password);
this.driver.InternalExecute(DriverCommand.SetAlertCredentials, parameters);
}
}
}
150 changes: 0 additions & 150 deletions dotnet/src/webdriver/DriverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,156 +361,6 @@ public static class DriverCommand
/// </summary>
public static readonly string GetLog = "getLog";

/// <summary>
/// Represents the Define Driver Mapping command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string DefineDriverMapping = "defineDriverMapping";

/// <summary>
/// Represents the Get Session List command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string GetSessionList = "getSessionList";

/// <summary>
/// Represents the Get Session Capabilities command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Actual capabilities are returned by the new session command.")]
public static readonly string GetSessionCapabilities = "getSessionCapabilities";

/// <summary>
/// Represents SubmitElement command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string SubmitElement = "submitElement";

/// <summary>
/// Represents GetElementLocation command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the get element rect command instead.")]
public static readonly string GetElementLocation = "getElementLocation";

/// <summary>
/// Represents GetElementLocationOnceScrolledIntoView command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the get element rect command instead.")]
public static readonly string GetElementLocationOnceScrolledIntoView = "getElementLocationOnceScrolledIntoView";

/// <summary>
/// Represents GetElementSize command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the get element rect command instead.")]
public static readonly string GetElementSize = "getElementSize";

/// <summary>
/// Represents GetWindowSize command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the get window rect command instead.")]
public static readonly string GetWindowSize = "getWindowSize";

/// <summary>
/// Represents SetWindowSize command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the set window rect command instead.")]
public static readonly string SetWindowSize = "setWindowSize";

/// <summary>
/// Represents GetWindowPosition command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the get window rect command instead.")]
public static readonly string GetWindowPosition = "getWindowPosition";

/// <summary>
/// Represents SetWindowPosition command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the set window rect command instead.")]
public static readonly string SetWindowPosition = "setWindowPosition";

/// <summary>
/// Represents the ImplicitlyWait command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the set timeouts command instead.")]
public static readonly string ImplicitlyWait = "implicitlyWait";

/// <summary>
/// Represents the SetAsyncScriptTimeout command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the set timeouts command instead.")]
public static readonly string SetAsyncScriptTimeout = "setScriptTimeout";

/// <summary>
/// Represents TapElement command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string TapElement = "tapElement";

/// <summary>
/// Represents the MouseClick command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string MouseClick = "mouseClick";

/// <summary>
/// Represents the MouseDoubleClick command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string MouseDoubleClick = "mouseDoubleClick";

/// <summary>
/// Represents the MouseDown command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string MouseDown = "mouseDown";

/// <summary>
/// Represents the MouseUp command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string MouseUp = "mouseUp";

/// <summary>
/// Represents the MouseMoveTo command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string MouseMoveTo = "mouseMoveTo";

/// <summary>
/// Represents the SendKeysToActiveElement command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification. Use the actions command to define user interactions.")]
public static readonly string SendKeysToActiveElement = "sendKeysToActiveElement";

/// <summary>
/// Represents the Authenticate command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string SetAlertCredentials = "setAlertCredentials";

/// <summary>
/// Represents GetOrientation command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string GetOrientation = "getOrientation";

/// <summary>
/// Represents SetOrientation command
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string SetOrientation = "setOrientation";

/// <summary>
/// Represents the GetLocation command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string GetLocation = "getLocation";

/// <summary>
/// Represents the SetLocation command.
/// </summary>
[Obsolete("Command not defined by W3C WebDriver Specification.")]
public static readonly string SetLocation = "setLocation";

public static readonly IList<string> KnownCommands = new List<string>()
{
Status,
Expand Down
7 changes: 0 additions & 7 deletions dotnet/src/webdriver/IAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,5 @@ public interface IAlert
/// </summary>
/// <param name="keysToSend">The keystrokes to send.</param>
void SendKeys(string keysToSend);

/// <summary>
/// Sets the user name and password in an alert prompting for credentials.
/// </summary>
/// <param name="userName">The user name to set.</param>
/// <param name="password">The password to set.</param>
void SetAuthenticationCredentials(string userName, string password);
}
}
58 changes: 0 additions & 58 deletions dotnet/test/common/AlertsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,64 +462,6 @@ public void ShouldHandleAlertOnFormSubmit()
Assert.AreEqual("Testing Alerts", driver.Title);
}

// Disabling test for all browsers. Authentication API is not supported by any driver yet.
// [Test]
[IgnoreBrowser(Browser.Chrome)]
[IgnoreBrowser(Browser.Edge)]
[IgnoreBrowser(Browser.Firefox)]
[IgnoreBrowser(Browser.IE)]
[IgnoreBrowser(Browser.Remote)]
[IgnoreBrowser(Browser.Safari)]
public void ShouldBeAbleToHandleAuthenticationDialog()
{
driver.Url = authenticationPage;
IAlert alert = WaitFor<IAlert>(AlertToBePresent, "No alert found");
alert.SetAuthenticationCredentials("test", "test");
alert.Accept();
Assert.That(driver.FindElement(By.TagName("h1")).Text, Does.Contain("authorized"));
}

// Disabling test for all browsers. Authentication API is not supported by any driver yet.
// [Test]
[IgnoreBrowser(Browser.Chrome)]
[IgnoreBrowser(Browser.Edge)]
[IgnoreBrowser(Browser.Firefox)]
[IgnoreBrowser(Browser.IE)]
[IgnoreBrowser(Browser.Remote)]
[IgnoreBrowser(Browser.Safari)]
public void ShouldBeAbleToDismissAuthenticationDialog()
{
driver.Url = authenticationPage;
IAlert alert = WaitFor<IAlert>(AlertToBePresent, "No alert found");
alert.Dismiss();
}

// Disabling test for all browsers. Authentication API is not supported by any driver yet.
// [Test]
[IgnoreBrowser(Browser.Chrome)]
[IgnoreBrowser(Browser.Edge)]
[IgnoreBrowser(Browser.Firefox)]
[IgnoreBrowser(Browser.Remote)]
[IgnoreBrowser(Browser.Safari)]
public void ShouldThrowAuthenticatingOnStandardAlert()
{
driver.Url = alertsPage;
driver.FindElement(By.Id("alert")).Click();
IAlert alert = WaitFor<IAlert>(AlertToBePresent, "No alert found");
try
{
alert.SetAuthenticationCredentials("test", "test");
Assert.Fail("Should not be able to Authenticate");
}
catch (UnhandledAlertException)
{
// this is an expected exception
}

// but the next call should be good.
alert.Dismiss();
}

private IAlert AlertToBePresent()
{
return driver.SwitchTo().Alert();
Expand Down

0 comments on commit 2fbfc62

Please sign in to comment.