Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
paweltomaszewskisaucelabs committed Apr 2, 2024
1 parent 0e18859 commit 0d252d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
13 changes: 1 addition & 12 deletions visual-dotnet/SauceLabs.Visual/VisualCheckOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,12 @@ namespace SauceLabs.Visual
/// </summary>
public class VisualCheckOptions
{
private FullPageConfig? _fullPageConfig;
public DiffingMethod? DiffingMethod { get; set; }
public IgnoreRegion[]? IgnoreRegions { get; set; }
public IWebElement[]? IgnoreElements { get; set; }
public bool? CaptureDom { get; set; }
public bool? FullPage { get; set; }
public FullPageConfig? FullPageConfig
{
get
{
return FullPage != false ? _fullPageConfig ?? new FullPageConfig() : null;
}
set
{
_fullPageConfig = value;
}
}
public FullPageConfig? FullPageConfig { get; set; }
public string? ClipSelector { get; set; }

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion visual-dotnet/SauceLabs.Visual/VisualClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ private async Task<string> VisualCheckAsync(string name, VisualCheckOptions opti
var ignored = new List<RegionIn>();
ignored.AddRange(options.IgnoreRegions?.Select(r => new RegionIn(r)) ?? new List<RegionIn>());
ignored.AddRange(options.IgnoreElements?.Select(r => new RegionIn(r)) ?? new List<RegionIn>());
var fullPageConfig = (options.FullPageConfig ?? new FullPageConfig()).ToFullPageConfigIn();

var result = (await Api.CreateSnapshotFromWebDriver(new CreateSnapshotFromWebDriverIn(
buildUuid: Build.Id,
Expand All @@ -157,7 +158,7 @@ private async Task<string> VisualCheckAsync(string name, VisualCheckOptions opti
clipSelector: options.ClipSelector,
suiteName: options.SuiteName,
testName: options.TestName,
fullPageConfig: options.FullPageConfig?.ToFullPageConfigIn()
fullPageConfig: options.FullPage != false ? fullPageConfig : null
))).EnsureValidResponse();
result.Result.Diffs.Nodes.ToList().ForEach(d => _screenshotIds.Add(d.Id));
return result.Result.Id;
Expand Down

0 comments on commit 0d252d1

Please sign in to comment.