Skip to content

Commit

Permalink
Fix all linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmay-browserstack committed Jun 12, 2023
1 parent e5c8843 commit 36916ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Percy/Percy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static string PayloadParser(object? payload = null, bool alreadyJson = f
{
if (alreadyJson)
{
return payload.ToString();
return payload is null ? "" : payload.ToString();
}
return JsonSerializer.Serialize(payload).ToString();
}
Expand Down
2 changes: 1 addition & 1 deletion Percy/PercyDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace PercyIO.Selenium
public class PercyDriver
{
private IPercySeleniumDriver percySeleniumDriver;
private String sessionId;
private String sessionId = "";
internal void setValues(IPercySeleniumDriver percySeleniumDriver)
{
this.sessionId = percySeleniumDriver.sessionId();
Expand Down
10 changes: 5 additions & 5 deletions Percy/PercySeleniumDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public RemoteWebDriver getRemoteWebDriver()
public ICapabilities GetCapabilities()
{
// Implement Cache
return this._remoteDriver?.Capabilities;
return this._remoteDriver.Capabilities;
}

public IDictionary<string, object> GetSessionDetails()
{
// Implement Cache
return (IDictionary<string, object>)this._remoteDriver?.Capabilities;
return (IDictionary<string, object>)this._remoteDriver.Capabilities;
}

public String sessionId()
Expand All @@ -41,9 +41,9 @@ public String sessionId()

public String GetHost()
{
HttpCommandExecutor executor = (HttpCommandExecutor)(this._remoteDriver)?.CommandExecutor;
FieldInfo remoteServerUriField = typeof(HttpCommandExecutor)?.GetField("remoteServerUri", BindingFlags.NonPublic | BindingFlags.Instance);
String commandExecutorUrl = remoteServerUriField?.GetValue(executor)?.ToString();
HttpCommandExecutor executor = (HttpCommandExecutor)(this._remoteDriver).CommandExecutor;
FieldInfo remoteServerUriField = typeof(HttpCommandExecutor).GetField("remoteServerUri", BindingFlags.NonPublic | BindingFlags.Instance);
String commandExecutorUrl = remoteServerUriField.GetValue(executor).ToString();
return commandExecutorUrl;
}
}
Expand Down

0 comments on commit 36916ca

Please sign in to comment.