Skip to content

Commit 2ae7df4

Browse files
Merge pull request #2665 from saucelabs/IRIS-488-fullpage-screenshot-selenium-sdk
IRIS-488-fullpage-screenshot-selenium-sdk
2 parents d5417b5 + 7e51752 commit 2ae7df4

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

docs/visual-testing/integrations/nightwatch.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,34 @@ 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 elements like sticky header.
324+
:::
325+
326+
Options:
327+
328+
- `delayAfterScrollMs`: Delay in ms after scrolling and before taking screenshots (helps with lazy loading content)
329+
- `hideAfterFirstScroll`: Hide elements on the page after first scroll (uses css selectors)
330+
331+
Example:
332+
333+
```ts
334+
await browser.sauceVisualCheck('Long content page', {
335+
fullPage: true,
336+
});
337+
338+
await browser.sauceVisualCheck('Long content page', {
339+
fullPage: {
340+
delayAfterScroll: 500,
341+
hideAfterFirstScroll: ["#header"],
342+
},
343+
});
344+
```
345+
318346
### Fail on failures
319347

320348
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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,34 @@ 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 elements like sticky header.
232+
:::
233+
234+
Options:
235+
236+
- `delayAfterScrollMs`: Delay in ms after scrolling and before taking screenshots (helps with lazy loading content)
237+
- `hideAfterFirstScroll`: Hide elements on the page after first scroll (uses css selectors)
238+
239+
Example:
240+
241+
```ts
242+
await browser.sauceVisualCheck('Long content page', {
243+
fullPage: true,
244+
});
245+
246+
await browser.sauceVisualCheck('Long content page', {
247+
fullPage: {
248+
delayAfterScroll: 500,
249+
hideAfterFirstScroll: ["#header"],
250+
},
251+
});
252+
```
253+
226254
## Example
227255

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

0 commit comments

Comments
 (0)