Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scroll to top for native full page #169

Merged
merged 5 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading