Skip to content

Commit

Permalink
Add support for clipSelector (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel authored Mar 22, 2024
1 parent 3065869 commit 3c26824
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ internal class CreateSnapshotFromWebDriverIn
[JsonProperty("captureDom")]
public bool? CaptureDom { get; set; }

[JsonProperty("clipSelector")]
public string? ClipSelector { get; set; }

public CreateSnapshotFromWebDriverIn(
string buildUuid,
string name,
Expand All @@ -34,7 +37,8 @@ public CreateSnapshotFromWebDriverIn(
string sessionMetadata,
DiffingMethod diffingMethod,
RegionIn[] regions,
bool captureDom
bool captureDom,
string? clipSelector
)
{
BuildUuid = buildUuid;
Expand All @@ -45,6 +49,7 @@ bool captureDom
SessionMetadata = sessionMetadata;
SessionId = sessionId;
CaptureDom = captureDom;
ClipSelector = clipSelector;
}
}
}
1 change: 1 addition & 0 deletions visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ public class VisualCheckOptions
public IgnoreRegion[]? IgnoreRegions { get; set; }
public IWebElement[]? IgnoreElements { get; set; }
public bool? CaptureDom { get; set; }
public string? ClipSelector { get; set; }
}
}
4 changes: 3 additions & 1 deletion visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ public async Task<string> VisualCheck(string name, VisualCheckOptions? options =
regions: ignored.ToArray(),
sessionId: _sessionId,
sessionMetadata: _sessionMetadataBlob ?? "",
captureDom: options?.CaptureDom ?? CaptureDom))).EnsureValidResponse();
captureDom: options?.CaptureDom ?? CaptureDom,
clipSelector: options?.ClipSelector
))).EnsureValidResponse();
result.Result.Diffs.Nodes.ToList().ForEach(d => _screenshotIds.Add(d.Id));
return result.Result.Id;
}
Expand Down

0 comments on commit 3c26824

Please sign in to comment.