Skip to content

Commit c4f04c2

Browse files
IRIS-488-fullpage-screenshot-selenium-sdk
1 parent d5417b5 commit c4f04c2

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

docs/visual-testing/integrations/nightwatch.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,32 @@ browser
315315
.end();
316316
```
317317

318+
### Full page screenshots
319+
320+
If you want to see more than what's on the screen, you can take a full-page screenshot. It'll capture everything by scrolling and stitching it together.
321+
322+
:::note
323+
It's recommended to use the `hideAfterFirstScroll` option for all fixed elements on the page.
324+
:::
325+
326+
Options:
327+
328+
- `enable`: Enable taking full page screenshot (limited to desktop devices only)
329+
- `delayAfterScroll`: Delay in ms after scrolling and before taking screenshots (helps with lazy loading content)
330+
- `hideAfterFirstScroll`: Hide elements on the page after first scroll (uses css selectors)
331+
332+
Example:
333+
334+
```ts
335+
await browser.sauceVisualCheck('Long content page', {
336+
fullPageConfig: {
337+
enable: true,
338+
delayAfterScroll: 500,
339+
hideAfterFirstScroll: ["#header"],
340+
},
341+
});
342+
```
343+
318344
### Fail on failures
319345

320346
By default, Sauce Visual will not fail the test if there are any failures during the comparison process. A failure will be logged in the Sauce Labs Visual dashboard, but the test will continue to run.

docs/visual-testing/integrations/webdriverio.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,32 @@ browser.sauceVisualCheck('Before Login', {
223223
});
224224
```
225225

226+
### Full page screenshots
227+
228+
If you want to see more than what's on the screen, you can take a full-page screenshot. It'll capture everything by scrolling and stitching it together.
229+
230+
:::note
231+
It's recommended to use the `hideAfterFirstScroll` option for all fixed elements on the page.
232+
:::
233+
234+
Options:
235+
236+
- `enable`: Enable taking full page screenshot (limited to desktop devices only)
237+
- `delayAfterScroll`: Delay in ms after scrolling and before taking screenshots (helps with lazy loading content)
238+
- `hideAfterFirstScroll`: Hide elements on the page after first scroll (uses css selectors)
239+
240+
Example:
241+
242+
```ts
243+
await browser.sauceVisualCheck('Long content page', {
244+
fullPageConfig: {
245+
enable: true,
246+
delayAfterScroll: 500,
247+
hideAfterFirstScroll: ["#header"],
248+
},
249+
});
250+
```
251+
226252
## Example
227253

228254
An example project is available [here](https://github.com/saucelabs/visual-examples/tree/main/wdio).

0 commit comments

Comments
 (0)