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

Iris 1289 - java, js native fps #3025

Merged
merged 16 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
13 changes: 0 additions & 13 deletions docs/visual-testing/_partials/_fullpage-description.md

This file was deleted.

136 changes: 131 additions & 5 deletions docs/visual-testing/_partials/_fullpage-js.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
import FullPageDescription from './_fullpage-description.md';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

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

<FullPageDescription />
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.
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved

<FullPageLimit />

#### Web

Options:

- `delayAfterScrollMs`: Delay in ms after scrolling and before taking screenshots. The default value is 0. We recommend using this option for lazy loading content.
- `disableCSSAnimation`: Disable CSS animations and the input caret in the app. The default value is true.
- `hideAfterFirstScroll`: One or more CSS selectors that we should remove from the page after the first scroll. Useful for hiding fixed elements such as headers, cookie banners, etc.

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

View workflow job for this annotation

GitHub Actions / vale

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

[sauce.Simplicity] Remove 'Useful'. Be precise instead of subjective.
Raw output
{"message": "[sauce.Simplicity] Remove 'Useful'. Be precise instead of subjective.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 16, "column": 113}}}, "severity": "WARNING"}
- `hideScrollBars`: Hide all scrollbars in the app. The default value is true.
- `scrollLimit`: Limit the number of screenshots taken for scrolling and stitching. The default value is 10. The value needs to be between 1 and 10.

:::note
It's recommended to use the `hideAfterFirstScroll` option for fixed or sticky position elements such as sticky headers or consent banners.
:::

Example:

```ts
await browser.sauceVisualCheck('Long content page', {
// Enable full page screenshots using the default options
// Enable full page screenshot using the default options
fullPage: true,
});

await browser.sauceVisualCheck('Long content page', {
// Enable full page screenshots and customize the behavior
// Enable full page screenshot and customize the behavior
fullPage: {
delayAfterScrollMs: 500,
disableCSSAnimation: false,
Expand All @@ -23,4 +41,112 @@
});
```

<FullPageLimit />
#### Mobile Native (beta)

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

View workflow job for this annotation

GitHub Actions / vale

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

[sauce.Headings] 'Mobile Native (beta)' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'Mobile Native (beta)' should use title case capitalization.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 44, "column": 6}}}, "severity": "WARNING"}
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved

Options:

- `delayAfterScrollMs`: Delay in ms after scrolling and before taking screenshots. The default value is 0. We recommend using this option for lazy loading content.
- `nativeClipSelector`: Selector used to identify the first element to which clipping will be applied.
- `scrollElement`: Scrollable element used for scrolling. The default is root element.
- `scrollLimit`: Limit the number of screenshots taken for scrolling and stitching. The default value is 10. The value needs to be between 1 and 10.

:::note
It is recommended to define the `scrollElement` as the appropriate scrollable container.
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
:::

<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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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"}
:::

<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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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' }
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
},
});
```
</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

View workflow job for this annotation

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

View workflow job for this annotation

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.
:::
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
186 changes: 175 additions & 11 deletions docs/visual-testing/integrations/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@

By default, only the current viewport is captured when `.sauceVisualCheck` is used. You can opt in to capturing the entire page by using the `enableFullPageScreenshots` option. It will capture everything by scrolling and stitching multiple screenshots together.

:::note
It's recommended to use the `withHideAfterFirstScroll` method for fixed or sticky position elements such as sticky headers or consent banners.
:::

Configuration should be specified using the `FullPageScreenshotConfig.Builder` object.

<FullPageLimit />

#### Web

Methods available:
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved

- `withDelayAfterScrollMs(int delayAfterScrollMs)`: Delay in ms after scrolling and before taking screenshots. The default value is 0. We recommend using this option for lazy loading content.
Expand All @@ -408,6 +408,10 @@
- `withHideScrollBars(Boolean hideScrollBars)`: Hide all scrollbars in the app. The default value is true.
- `withScrollLimit(int scrollLimit)`: Limit the number of screenshots taken for scrolling and stitching. The default value is 10. The value needs to be between 1 and 10.

:::note
It's recommended to use the `withHideAfterFirstScroll` method for fixed or sticky position elements such as sticky headers or consent banners.
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
:::

Examples:

```java
Expand All @@ -424,17 +428,177 @@

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);
```

<FullPageLimit />
#### Mobile Native (beta)

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

View workflow job for this annotation

GitHub Actions / vale

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

[sauce.Headings] 'Mobile Native (beta)' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'Mobile Native (beta)' should use title case capitalization.", "location": {"path": "docs/visual-testing/integrations/java.md", "range": {"start": {"line": 441, "column": 6}}}, "severity": "WARNING"}

Methods available:
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
- `withDelayAfterScrollMs(int delayAfterScrollMs)`: Delay in ms after scrolling and before taking screenshots. The default value is 0. We recommend using this option for lazy loading content.
- `withNativeClipSelector(SelectorIn nativeClipSelector)`: Selector used to identify the first element to which clipping will be applied.
- `withScrollElement(WebElement scrollElement)`: Scrollable element used for scrolling. The default is root element.
- `withScrollLimit(int scrollLimit)`: Limit the number of screenshots taken for scrolling and stitching. The default value is 10. The value needs to be between 1 and 10.

:::note
It is recommended to define the `withScrollElement` as the appropriate scrollable container.
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
:::

paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
<Tabs>
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved
<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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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.
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved

:::note
On iOS, selectors must be contained within the `scrollElement`.
:::
paweltomaszewskisaucelabs marked this conversation as resolved.
Show resolved Hide resolved


<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

View workflow job for this annotation

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

View workflow job for this annotation

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("//XCUIElementTypeStaticText[@name="Product Price"]")
.withType(SelectorType.XPATH)
.build())
.build());
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

View workflow job for this annotation

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

View workflow job for this annotation

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>

<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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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

View workflow job for this annotation

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>

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

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

View workflow job for this annotation

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

Expand Down
Loading