Skip to content

Commit

Permalink
Add ScrollOption for native full page screenshot (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
paweltomaszewskisaucelabs authored Dec 18, 2024
1 parent bc9e061 commit d6f02a8
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 5 deletions.
7 changes: 7 additions & 0 deletions visual-js/.changeset/silent-jeans-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@saucelabs/visual": minor
"@saucelabs/nightwatch-sauce-visual-service": minor
"@saucelabs/wdio-sauce-visual-service": minor
---

Added control over scrolling to the top before and after capturing a native full-page screenshot.
102 changes: 98 additions & 4 deletions visual-js/visual/src/graphql/__generated__/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion visual-js/visual/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { RegionIn, SelectorIn } from './graphql/__generated__/graphql';
import {
RegionIn,
ScrollOption,
SelectorIn,
} from './graphql/__generated__/graphql';
import { SelectiveRegionOptions } from './common/selective-region';
import { SauceRegion } from './common/regions';

Expand Down Expand Up @@ -34,6 +38,10 @@ export type FullPageScreenshotOptions<T> =
* Selector of an element that we should crop the screenshot to. Available only on native apps.
*/
nativeClipSelector?: SelectorIn;
/**
* Change scroll behaviour before and after taking full page screenshot. Available only on native apps.
*/
scrollOption?: ScrollOption;
};

export type Ignorable<T> = T | T[] | Promise<T> | Promise<T[]> | RegionIn;
Expand Down

0 comments on commit d6f02a8

Please sign in to comment.