Skip to content

Commit

Permalink
remove toolBarShadowPadding and addressBarShadowPadding in fps
Browse files Browse the repository at this point in the history
  • Loading branch information
paweltomaszewskisaucelabs committed May 17, 2024
1 parent 9081c9f commit 4e49d28
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
8 changes: 4 additions & 4 deletions visual-java/src/main/java/com/saucelabs/visual/VisualApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,7 @@ public void setCaptureDom(Boolean captureDom) {
this.captureDom = captureDom;
}

/**
* Enables full page screenshots
*/
/** Enables full page screenshots */
public void enableFullPageScreenshots() {
this.fullPageScreenshotConfig = new FullPageScreenshotConfig.Builder().build();
}
Expand Down Expand Up @@ -385,7 +383,9 @@ public void sauceVisualCheck(String snapshotName, CheckOptions options) {
input.setClipSelector(clipSelector);
}

FullPageScreenshotConfig fullPageScreenshotConfig = Optional.ofNullable(options.getFullPageScreenshotConfig()).orElse(this.fullPageScreenshotConfig);
FullPageScreenshotConfig fullPageScreenshotConfig =
Optional.ofNullable(options.getFullPageScreenshotConfig())
.orElse(this.fullPageScreenshotConfig);
if (fullPageScreenshotConfig != null) {
input.setFullPageConfig(fullPageScreenshotConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,32 @@

public class FullPageScreenshotConfig {

private int addressBarShadowPadding;
private int delayAfterScrollMs;
private Boolean disableCSSAnimation;
private List<String> hideAfterFirstScroll;
private Boolean hideScrollBars;
private int toolBarShadowPadding;
private int scrollLimit;

public FullPageScreenshotConfig(int addressBarShadowPadding, int delayAfterScrollMs, Boolean disableCSSAnimation, List<String> hideAfterFirstScroll, Boolean hideScrollBars, int toolBarShadowPadding, int scrollLimit) {
this.addressBarShadowPadding = addressBarShadowPadding;
public FullPageScreenshotConfig(
int delayAfterScrollMs,
Boolean disableCSSAnimation,
List<String> hideAfterFirstScroll,
Boolean hideScrollBars,
int scrollLimit) {
this.delayAfterScrollMs = delayAfterScrollMs;
this.disableCSSAnimation = disableCSSAnimation;
this.hideAfterFirstScroll = hideAfterFirstScroll;
this.hideScrollBars = hideScrollBars;
this.toolBarShadowPadding = toolBarShadowPadding;
this.scrollLimit = scrollLimit;
}

public static class Builder {
private int addressBarShadowPadding;
private int delayAfterScrollMs;
private Boolean disableCSSAnimation;
private List<String> hideAfterFirstScroll;
private Boolean hideScrollBars;
private int toolBarShadowPadding;
private int scrollLimit;

public Builder withAddressBarShadowPadding(int addressBarShadowPadding) {
this.addressBarShadowPadding = addressBarShadowPadding;
return this;
}

public Builder withDelayAfterScrollMs(int delayAfterScrollMs) {
this.delayAfterScrollMs = delayAfterScrollMs;
return this;
Expand All @@ -57,11 +51,6 @@ public Builder withHideScrollBars(Boolean hideScrollBars) {
return this;
}

public Builder withToolBarShadowPadding(int toolBarShadowPadding) {
this.toolBarShadowPadding = toolBarShadowPadding;
return this;
}

public Builder withScrollLimit(int scrollLimit) {
if (scrollLimit > 0 && scrollLimit <= 10) {
this.scrollLimit = scrollLimit;
Expand All @@ -73,16 +62,15 @@ public Builder withScrollLimit(int scrollLimit) {
}

public FullPageScreenshotConfig build() {
return new FullPageScreenshotConfig(addressBarShadowPadding, delayAfterScrollMs, disableCSSAnimation, hideAfterFirstScroll, hideScrollBars, toolBarShadowPadding, scrollLimit);
return new FullPageScreenshotConfig(
delayAfterScrollMs,
disableCSSAnimation,
hideAfterFirstScroll,
hideScrollBars,
scrollLimit);
}
}

public int getAddressBarShadowPadding() {
return addressBarShadowPadding;
}
public void setAddressBarShadowPadding(int addressBarShadowPadding) {
this.addressBarShadowPadding = addressBarShadowPadding;
}
public int getDelayAfterScrollMs() {
return delayAfterScrollMs;
}
Expand Down Expand Up @@ -115,14 +103,6 @@ public void setHideScrollBars(Boolean hideScrollBars) {
this.hideScrollBars = hideScrollBars;
}

public int getToolBarShadowPadding() {
return toolBarShadowPadding;
}

public void setToolBarShadowPadding(int toolBarShadowPadding) {
this.toolBarShadowPadding = toolBarShadowPadding;
}

public int getScrollLimit() {
return scrollLimit;
}
Expand Down

0 comments on commit 4e49d28

Please sign in to comment.