Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
FriggaHel committed May 2, 2024
1 parent e597137 commit c157d82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public CreateSnapshotFromWebDriverIn(
string? clipSelector,
string? suiteName,
string? testName,
FullPageConfigIn? fullPageConfig
FullPageConfigIn? fullPageConfig,
DiffingOptionsIn? diffingOptions
)
{
BuildUuid = buildUuid;
Expand All @@ -60,6 +61,7 @@ public CreateSnapshotFromWebDriverIn(
SuiteName = suiteName;
TestName = testName;
FullPageConfig = fullPageConfig;
DiffingOptions = diffingOptions;
}
}
}
4 changes: 2 additions & 2 deletions visual-dotnet/SauceLabs.Visual/Utils/DiffingOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DiffingOptionsBuilder
};
internal static DiffingOptionsIn? SelectiveRegionToDiffingOptions(DiffingOption[]? enableOnly, DiffingOption[]? disable)
{
if (enableOnly != null)
if (enableOnly?.Length > 0)
{
var options = new DiffingOptionsIn(false);
foreach (var opt in enableOnly)
Expand All @@ -49,7 +49,7 @@ public class DiffingOptionsBuilder
return options;
}

if (disable != null)
if (disable?.Length > 0)
{
var options = new DiffingOptionsIn(true);
foreach (var opt in disable)
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 @@ -164,7 +164,8 @@ private async Task<string> VisualCheckAsync(string name, VisualCheckOptions opti
clipSelector: options.ClipSelector,
suiteName: options.SuiteName,
testName: options.TestName,
fullPageConfig: fullPageConfigIn
fullPageConfig: fullPageConfigIn,
diffingOptions: DiffingOptionsBuilder.SelectiveRegionToDiffingOptions(options.EnableOnly, options.Disable)
))).EnsureValidResponse();
result.Result.Diffs.Nodes.ToList().ForEach(d => _screenshotIds.Add(d.Id));
return result.Result.Id;
Expand Down

0 comments on commit c157d82

Please sign in to comment.