diff --git a/visual-java/src/main/java/com/saucelabs/visual/CheckOptions.java b/visual-java/src/main/java/com/saucelabs/visual/CheckOptions.java index bc64b25f..2ba40b22 100644 --- a/visual-java/src/main/java/com/saucelabs/visual/CheckOptions.java +++ b/visual-java/src/main/java/com/saucelabs/visual/CheckOptions.java @@ -21,6 +21,33 @@ public enum DiffingMethod { public CheckOptions() {} + public CheckOptions( + List ignoreElements, + List ignoreRegions, + List regions, + String testName, + String suiteName, + DiffingMethod diffingMethod, + DiffingOptionsIn diffingOptions, + Boolean captureDom, + String clipSelector, + WebElement clipElement, + FullPageScreenshotConfig fullPageScreenshotConfig) { + this( + ignoreElements, + ignoreRegions, + regions, + testName, + suiteName, + diffingMethod, + diffingOptions, + captureDom, + clipSelector, + clipElement, + fullPageScreenshotConfig, + new ArrayList<>()); + } + public CheckOptions( List ignoreElements, List ignoreRegions, diff --git a/visual-java/src/main/java/com/saucelabs/visual/graphql/CreateSnapshotFromWebDriverMutation.java b/visual-java/src/main/java/com/saucelabs/visual/graphql/CreateSnapshotFromWebDriverMutation.java index 735263dd..80d14f1d 100644 --- a/visual-java/src/main/java/com/saucelabs/visual/graphql/CreateSnapshotFromWebDriverMutation.java +++ b/visual-java/src/main/java/com/saucelabs/visual/graphql/CreateSnapshotFromWebDriverMutation.java @@ -54,6 +54,29 @@ public static class CreateSnapshotFromWebDriverIn { public Optional diffingOptions = Optional.empty(); + public CreateSnapshotFromWebDriverIn( + String buildUuid, + DiffingMethod diffingMethod, + Optional diffingOptions, + List ignoreRegions, + List ignoreElements, + String jobId, + String name, + String sessionId, + String sessionMetadata) { + this( + buildUuid, + diffingMethod, + diffingOptions, + ignoreRegions, + ignoreElements, + jobId, + name, + sessionId, + sessionMetadata, + new ArrayList<>()); + } + public CreateSnapshotFromWebDriverIn( String buildUuid, DiffingMethod diffingMethod, diff --git a/visual-java/src/main/java/com/saucelabs/visual/model/FullPageScreenshotConfig.java b/visual-java/src/main/java/com/saucelabs/visual/model/FullPageScreenshotConfig.java index 7bccfb2a..f2137c46 100644 --- a/visual-java/src/main/java/com/saucelabs/visual/model/FullPageScreenshotConfig.java +++ b/visual-java/src/main/java/com/saucelabs/visual/model/FullPageScreenshotConfig.java @@ -16,6 +16,23 @@ public class FullPageScreenshotConfig { private String scrollElement; private SelectorIn nativeClipSelector; + public FullPageScreenshotConfig( + int delayAfterScrollMs, + Boolean disableCSSAnimation, + List hideAfterFirstScroll, + Boolean hideScrollBars, + int scrollLimit, + String scrollElement) { + this( + delayAfterScrollMs, + disableCSSAnimation, + hideAfterFirstScroll, + hideScrollBars, + scrollLimit, + scrollElement, + null); + } + public FullPageScreenshotConfig( int delayAfterScrollMs, Boolean disableCSSAnimation, diff --git a/visual-js/.changeset/shy-bananas-speak.md b/visual-js/.changeset/shy-bananas-speak.md index 124b18ac..7c438f5e 100644 --- a/visual-js/.changeset/shy-bananas-speak.md +++ b/visual-js/.changeset/shy-bananas-speak.md @@ -1,5 +1,5 @@ --- -"@saucelabs/nightwatch-sauce-visual-service": patch +"@saucelabs/nightwatch-sauce-visual-service": minor --- -ignore selectors +add support for ignore selectors in visual check