Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
paweltomaszewskisaucelabs committed Nov 28, 2024
1 parent 55907ae commit 6faa223
Showing 3 changed files with 238 additions and 94 deletions.
122 changes: 92 additions & 30 deletions docs/visual-testing/_partials/_fullpage-js.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import FullPageLimit from './_fullpage-limit.md';

By default, only the current viewport is captured when `.sauceVisualCheck` is used. You can opt in to capturing the entire page by using the `fullPage` option. It will capture everything by scrolling and stitching multiple screenshots together.
@@ -51,40 +54,99 @@ Options:
It is recommended to define the `scrollElement` as the appropriate scrollable container.
:::

```ts
await browser.sauceVisualCheck('Long content page', {
// Enable full page screenshot and customize the behavior
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
scrollLimit: 5
},
});
```
<Tabs>
<TabItem value="ios" label="iOS">
```ts
await browser.sauceVisualCheck('Long content page', {
// Enable full page screenshot and customize the behavior
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
scrollLimit: 5
},
});
```
</TabItem>
<TabItem value="android" label="Android">

Check warning on line 69 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L69

[sauce.WordList] Use 'Android' instead of 'android'.
Raw output
{"message": "[sauce.WordList] Use 'Android' instead of 'android'.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 69, "column": 21}}}, "severity": "WARNING"}
```ts
await browser.sauceVisualCheck('Long content page', {
// Enable full page screenshot and customize the behavior
fullPage: {
scrollElement: $('//androidx.recyclerview.widget.RecyclerView'),

Check warning on line 74 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L74

[sauce.SentenceSpacing] Remove the extra space.
Raw output
{"message": "[sauce.SentenceSpacing] Remove the extra space.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 74, "column": 64}}}, "severity": "WARNING"}

Check warning on line 74 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L74

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 74, "column": 81}}}, "severity": "WARNING"}
scrollLimit: 5
},
});
```
</TabItem>
</Tabs>

Use only XPath selectors for ignore regions and clipping to an element.

:::note
On iOS, selectors must be contained within the `scrollElement`.

Check warning on line 85 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L85

[sauce.WordList] Use 'in' instead of 'within'.
Raw output
{"message": "[sauce.WordList] Use 'in' instead of 'within'.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 85, "column": 37}}}, "severity": "WARNING"}
:::

```ts
await browser.sauceVisualCheck('Ignore regions - Long content page', {
// Enable full page screenshot and ignore elements
ignore: [
{ selector: { value: '//XCUIElementTypeCollectionView/XCUIElementTypeCell', type: 'XPATH' }}
],
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
},
});
```

```ts
await browser.sauceVisualCheck('Clip - Long content page', {
// Enable full page screenshot and clip to an element
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
nativeClipSelector: { value: '//XCUIElementTypeCollectionView/XCUIElementTypeOther', type: 'XPATH' }
},
});
```
<Tabs>
<TabItem value="ios" label="iOS">
```ts
await browser.sauceVisualCheck('Ignore regions - Long content page', {
// Enable full page screenshot and ignore elements
ignore: [
{

Check warning on line 94 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L94

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 94, "column": 18}}}, "severity": "WARNING"}
selector: {

Check warning on line 95 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L95

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 95, "column": 32}}}, "severity": "WARNING"}
value: '//XCUIElementTypeStaticText[@name="Product Price"]',
type: 'XPATH'

Check warning on line 97 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L97

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 97, "column": 38}}}, "severity": "WARNING"}
}
}
],
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
},
});
```
</TabItem>
<TabItem value="android" label="Android">
```ts
await browser.sauceVisualCheck('Ignore regions - Long content page', {
// Enable full page screenshot and ignore elements
ignore: [
{

Check warning on line 112 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L112

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 112, "column": 18}}}, "severity": "WARNING"}
selector: {
value: '//android.widget.TextView[@content-desc="Product Price"]',

Check warning on line 114 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L114

[sauce.SentenceSpacing] Remove the extra space.
Raw output
{"message": "[sauce.SentenceSpacing] Remove the extra space.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 114, "column": 48}}}, "severity": "WARNING"}
type: 'XPATH'

Check warning on line 115 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L115

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 115, "column": 38}}}, "severity": "WARNING"}
}
}
],
fullPage: {
scrollElement: $('//androidx.recyclerview.widget.RecyclerView'),

Check warning on line 120 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L120

[sauce.SentenceSpacing] Remove the extra space.
Raw output
{"message": "[sauce.SentenceSpacing] Remove the extra space.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 120, "column": 64}}}, "severity": "WARNING"}

Check warning on line 120 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L120

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 120, "column": 81}}}, "severity": "WARNING"}
},
});
```
</TabItem>
</Tabs>

<Tabs>
<TabItem value="ios" label="iOS">
```ts
await browser.sauceVisualCheck('Clip - Long content page', {
// Enable full page screenshot and clip to an element
fullPage: {
scrollElement: $('//XCUIElementTypeCollectionView'),
nativeClipSelector: { value: '//XCUIElementTypeCollectionView/XCUIElementTypeOther', type: 'XPATH' }
},
});
```
</TabItem>
<TabItem value="android" label="Android">
```ts
await browser.sauceVisualCheck('Clip - Long content page', {
// Enable full page screenshot and clip to an element
fullPage: {
scrollElement: $('//androidx.recyclerview.widget.RecyclerView'),
nativeClipSelector: { value: '//androidx.recyclerview.widget.RecyclerView[@content-desc="Displays all products of catalog"]', type: 'XPATH' }
},
});
```
</TabItem>
</Tabs>

Learn more about mobile native testing [here](/visual-testing/mobile-native-testing/)

Check warning on line 152 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L152

[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.
Raw output
{"message": "[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 152, "column": 41}}}, "severity": "WARNING"}

Check warning on line 152 in docs/visual-testing/_partials/_fullpage-js.md

GitHub Actions / vale

[vale] docs/visual-testing/_partials/_fullpage-js.md#L152

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 152, "column": 86}}}, "severity": "WARNING"}
4 changes: 3 additions & 1 deletion docs/visual-testing/_partials/_fullpage-limit.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:::note
The maximum number of scrolls and stitches in a full page screenshot is 10.

:::note
Use full page screenshots only when necessary, as they can slow down test execution.
:::
206 changes: 143 additions & 63 deletions docs/visual-testing/integrations/java.md
Original file line number Diff line number Diff line change
@@ -428,12 +428,12 @@ import com.saucelabs.visual.model.FullPageScreenshotConfig;

CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withDelayAfterScrollMs(500)
.withDisableCSSAnimation(false)
.withHideAfterFirstScroll("#header")
.withHideScrollBars(false)
.withScrollLimit(5)
.build();
.withDelayAfterScrollMs(500)
.withDisableCSSAnimation(false)
.withHideAfterFirstScroll("#header")
.withHideScrollBars(false)
.withScrollLimit(5)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
@@ -450,75 +450,155 @@ Methods available:
It is recommended to define the `withScrollElement` as the appropriate scrollable container.
:::

```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

RemoteWebDriver driver;
...

WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withScrollLimit(5)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
<Tabs>
<TabItem value="ios" label="iOS">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 458 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L458

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 458, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 461 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L461

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 461, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withScrollLimit(5)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
<TabItem value="android" label="Android">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 476 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L476

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 476, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 479 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L479

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 479, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//androidx.recyclerview.widget.RecyclerView"));

Check warning on line 480 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L480

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 480, "column": 118}}}, "severity": "WARNING"}
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withScrollLimit(5)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
</Tabs>

Use only XPath selectors for ignore regions and clipping to an element.

:::note
On iOS, selectors must be contained within the `scrollElement`.
:::

```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

RemoteWebDriver driver;
...

WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.build();
options.enableFullPageScreenshots(config);
List<IgnoreSelectorIn> ignoreSelectors = List.of(
new IgnoreSelectorIn.Builder()
<Tabs>
<TabItem value="ios" label="iOS">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 504 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L504

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 504, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 507 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L507

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 507, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.build();
options.enableFullPageScreenshots(config);
List<IgnoreSelectorIn> ignoreSelectors = List.of(
new IgnoreSelectorIn.Builder()
.withSelector(
new SelectorIn.Builder()
.withValue(
"//XCUIElementTypeCollectionView//XCUIElementTypeStaticText")
.withType(SelectorType.XPATH)
.build())
new SelectorIn.Builder()
.withValue("//XCUIElementTypeStaticText[@name="Product Price"]")
.withType(SelectorType.XPATH)
.build())
.build());
options.setIgnoreSelectors(ignoreSelectors);
visual.sauceVisualCheck("Long content page", options);
```

```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;
options.setIgnoreSelectors(ignoreSelectors);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
<TabItem value="android" label="Android">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 530 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L530

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 530, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 533 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L533

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 533, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//androidx.recyclerview.widget.RecyclerView"));
CheckOptions options = new CheckOptions();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.build();
options.enableFullPageScreenshots(config);
List<IgnoreSelectorIn> ignoreSelectors = List.of(
new IgnoreSelectorIn.Builder()
.withSelector(
new SelectorIn.Builder()
.withValue("//android.widget.TextView[@content-desc="Product Price"]")
.withType(SelectorType.XPATH)
.build())
.build());
options.setIgnoreSelectors(ignoreSelectors);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
</Tabs>

RemoteWebDriver driver;
...
<Tabs>
<TabItem value="ios" label="iOS">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 559 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L559

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 559, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 562 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L562

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 562, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
SelectorIn nativeClipSelector = new SelectorIn.Builder()
.withType(SelectorType.XPATH)
.withValue("//XCUIElementTypeCollectionView/XCUIElementTypeOther")
.build();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withNativeClipSelector(nativeClipSelector)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
<TabItem value="android" label="Android">
```java
import com.saucelabs.visual.CheckOptions;
import com.saucelabs.visual.model.FullPageScreenshotConfig;

Check warning on line 581 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L581

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 581, "column": 1}}}, "severity": "WARNING"}
RemoteWebDriver driver;
...

Check warning on line 584 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L584

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 584, "column": 1}}}, "severity": "WARNING"}
WebElement scrollElement = driver.findElement(AppiumBy.xpath("//androidx.recyclerview.widget.RecyclerView"));
CheckOptions options = new CheckOptions();
SelectorIn nativeClipSelector = new SelectorIn.Builder()
.withType(SelectorType.XPATH)
.withValue("//androidx.recyclerview.widget.RecyclerView[@content-desc='Displays all products of catalog']")
.build();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withNativeClipSelector(nativeClipSelector)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
</TabItem>
</Tabs>

WebElement scrollElement = driver.findElement(AppiumBy.xpath("//XCUIElementTypeCollectionView"));
CheckOptions options = new CheckOptions();
SelectorIn nativeClipSelector = new SelectorIn.Builder()
.withType(SelectorType.XPATH)
.withValue("//XCUIElementTypeCollectionView/XCUIElementTypeOther")
.build();
FullPageScreenshotConfig config = new FullPageScreenshotConfig.Builder()
.withScrollElement(scrollElement)
.withNativeClipSelector(nativeClipSelector)
.build();
options.enableFullPageScreenshots(config);
visual.sauceVisualCheck("Long content page", options);
```
Learn more about mobile native testing [here](/visual-testing/mobile-native-testing/)

Check warning on line 601 in docs/visual-testing/integrations/java.md

GitHub Actions / vale

[vale] docs/visual-testing/integrations/java.md#L601

[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.
Raw output
{"message": "[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 601, "column": 41}}}, "severity": "WARNING"}

### Clip to an Element

0 comments on commit 6faa223

Please sign in to comment.