Skip to content

Commit

Permalink
Fixing overzealous .NET spec modificiations
Browse files Browse the repository at this point in the history
  • Loading branch information
jimevans committed Mar 21, 2017
1 parent 6b781f3 commit 96b97dc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
31 changes: 28 additions & 3 deletions dotnet/src/webdriver/Remote/RemoteTimeouts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,27 @@ public TimeSpan AsynchronousJavaScript
/// </summary>
public TimeSpan PageLoad
{
get { return this.ExecuteGetTimeout("pageLoad"); }
set { this.ExecuteSetTimeout("pageLoad", value); }
get
{
string timeoutName = "page load";
if (this.driver.IsSpecificationCompliant)
{
timeoutName = "pageLoad";
}

return this.ExecuteGetTimeout(timeoutName);
}

set
{
string timeoutName = "page load";
if (this.driver.IsSpecificationCompliant)
{
timeoutName = "pageLoad";
}

this.ExecuteSetTimeout(timeoutName, value);
}
}

/// <summary>
Expand Down Expand Up @@ -131,7 +150,13 @@ public ITimeouts SetScriptTimeout(TimeSpan timeToWait)
[Obsolete("This method will be removed in a future version. Please set the PageLoad property instead.")]
public ITimeouts SetPageLoadTimeout(TimeSpan timeToWait)
{
this.ExecuteSetTimeout("pageLoad", timeToWait);
string timeoutName = "page load";
if (this.driver.IsSpecificationCompliant)
{
timeoutName = "pageLoad";
}

this.ExecuteSetTimeout(timeoutName, timeToWait);
return this;
}

Expand Down
1 change: 1 addition & 0 deletions dotnet/src/webdriver/Remote/RemoteWebElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ public override bool Equals(object obj)
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("id", this.Id);
parameters.Add("other", otherAsElement.Id);

Response response = this.Execute(DriverCommand.ElementEquals, parameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected override void InitializeCommandDictionary()
// local-end implementation of WebDriver.
this.TryAddCommand(DriverCommand.GetSessionCapabilities, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}"));
this.TryAddCommand(DriverCommand.IsElementDisplayed, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/displayed"));
this.TryAddCommand(DriverCommand.ElementEquals, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/equals"));
this.TryAddCommand(DriverCommand.ElementEquals, new CommandInfo(CommandInfo.GetCommand, "/session/{sessionId}/element/{id}/equals/{other}"));
this.TryAddCommand(DriverCommand.DefineDriverMapping, new CommandInfo(CommandInfo.PostCommand, "/config/drivers"));
this.TryAddCommand(DriverCommand.UploadFile, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/file"));
this.TryAddCommand(DriverCommand.SetAlertCredentials, new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/alert/credentials"));
Expand Down

0 comments on commit 96b97dc

Please sign in to comment.