Skip to content

Commit

Permalink
Setting name of test for SauceLabs when no setting in app.config
Browse files Browse the repository at this point in the history
  • Loading branch information
raczeja committed Apr 9, 2019
1 parent 057fc38 commit 35c3b0d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Objectivity.Test.Automation.Common/DriverContextHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ private T SetRemoteDriverOptions<T>(NameValueCollection driverCapabilitiesConf,
}
}

var setName = false;

// if there are any capability
if (settings != null)
{
Expand All @@ -247,6 +249,7 @@ private T SetRemoteDriverOptions<T>(NameValueCollection driverCapabilitiesConf,
if (key == "name" && !string.IsNullOrEmpty(this.TestTitle))
{
options.AddAdditionalCapability(key, this.TestTitle);
setName = true;
}
else
{
Expand All @@ -257,6 +260,11 @@ private T SetRemoteDriverOptions<T>(NameValueCollection driverCapabilitiesConf,
}
}

if (!setName && !string.IsNullOrEmpty(this.TestTitle))
{
options.AddAdditionalCapability("name", this.TestTitle);
}

return options;
}

Expand Down Expand Up @@ -305,6 +313,8 @@ private void SetRemoteDriverBrowserOptions(NameValueCollection driverCapabilitie
}
}

var setName = false;

// if there are any capability
if (settings != null)
{
Expand All @@ -313,6 +323,7 @@ private void SetRemoteDriverBrowserOptions(NameValueCollection driverCapabilitie
if (key == "name" && !string.IsNullOrEmpty(this.TestTitle))
{
browserOptions.AddAdditionalCapability(key, this.TestTitle, true);
setName = true;
}
else
{
Expand All @@ -321,6 +332,11 @@ private void SetRemoteDriverBrowserOptions(NameValueCollection driverCapabilitie
}
}
}

if (!setName && !string.IsNullOrEmpty(this.TestTitle))
{
browserOptions.AddAdditionalCapability("name", this.TestTitle);
}
}

[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Loop through all internetExplorerPreferences")]
Expand Down

0 comments on commit 35c3b0d

Please sign in to comment.