Skip to content

Commit

Permalink
DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel committed Mar 14, 2024
1 parent f164434 commit 4ae50a7
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,8 @@ public class VisualClient : IDisposable
/// <param name="region">the Sauce Labs region to connect to</param>
/// <param name="username">the Sauce Labs username</param>
/// <param name="accessKey">the Sauce Labs access key</param>
public VisualClient(WebDriver wd, Region region, string username, string accessKey)
public VisualClient(WebDriver wd, Region region, string username, string accessKey) : this(wd, region, username, accessKey, new CreateBuildOptions())
{
_api = new VisualApi<WebDriver>(wd, region, username, accessKey);
_sessionId = wd.SessionId.ToString();
_jobId = wd.Capabilities.HasCapability("jobUuid") ? wd.Capabilities.GetCapability("jobUuid").ToString() : _sessionId;
var response = _api.WebDriverSessionInfo(_jobId, _sessionId).Result;
var metadata = response.EnsureValidResponse();
_sessionMetadataBlob = metadata.Result.Blob;

var createBuildResponse = CreateBuild(new CreateBuildOptions()).Result;
Build = new VisualBuild(createBuildResponse.Id, createBuildResponse.Url);
_externalBuild = false;
}

/// <summary>
Expand Down

0 comments on commit 4ae50a7

Please sign in to comment.