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 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
14 changes: 1 addition & 13 deletions docs/visual-testing/_partials/_fullpage-description.md
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
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.

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

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.
- `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.
Full Page Screenshots capture the entire webpage, including content beyond the visible viewport, to ensure comprehensive visual testing. This feature helps teams identify layout or rendering issues across the full page and ensures consistency across devices and browsers.
145 changes: 140 additions & 5 deletions docs/visual-testing/_partials/_fullpage-js.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
import FullPageDescription from './_fullpage-description.md';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import FullPageLimit from './_fullpage-limit.md';
import FullPageLimitation from './_fullpage-limitation.md';
import FullPageDescription from './_fullpage-description.md';

<FullPageDescription/>
By default, only the 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.

Check warning on line 9 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#L9

[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.
Raw output
{"message": "[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 9, "column": 74}}}, "severity": "WARNING"}

Check warning on line 9 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#L9

[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.
Raw output
{"message": "[sauce.HeadingPunctuation] Don't use periods or exclamation marks in headings.", "location": {"path": "docs/visual-testing/_partials/_fullpage-js.md", "range": {"start": {"line": 9, "column": 150}}}, "severity": "WARNING"}

<FullPageLimit />

#### Web

Options:

<FullPageDescription />
- `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 19 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#L19

[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": 19, "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 +44,118 @@
});
```

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

Check warning on line 47 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#L47

[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": 47, "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 set `scrollElement` to the appropriate scrollable container.
:::

<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 72 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#L72

[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": 72, "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 77 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#L77

[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": 77, "column": 64}}}, "severity": "WARNING"}

Check warning on line 77 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#L77

[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": 77, "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 88 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#L88

[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": 88, "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 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": 18}}}, "severity": "WARNING"}
selector: {

Check warning on line 98 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#L98

[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": 98, "column": 32}}}, "severity": "WARNING"}
value: '//XCUIElementTypeStaticText[@name="Product Price"]',
type: 'XPATH'

Check warning on line 100 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#L100

[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": 100, "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 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": 18}}}, "severity": "WARNING"}
selector: {
value: '//android.widget.TextView[@content-desc="Product Price"]',

Check warning on line 117 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#L117

[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": 117, "column": 48}}}, "severity": "WARNING"}
type: 'XPATH'

Check warning on line 118 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#L118

[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": 118, "column": 38}}}, "severity": "WARNING"}
}
}
],
fullPage: {
scrollElement: $('//androidx.recyclerview.widget.RecyclerView'),

Check warning on line 123 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#L123

[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": 123, "column": 64}}}, "severity": "WARNING"}

Check warning on line 123 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#L123

[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": 123, "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: {

Check warning on line 137 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#L137

[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": 137, "column": 38}}}, "severity": "WARNING"}
value: '//XCUIElementTypeCollectionView/XCUIElementTypeOther',
type: 'XPATH'

Check warning on line 139 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#L139

[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": 139, "column": 34}}}, "severity": "WARNING"}
}
},
});
```
</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: {

Check warning on line 151 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#L151

[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": 151, "column": 38}}}, "severity": "WARNING"}
value: '//androidx.recyclerview.widget.RecyclerView[@content-desc="Displays all products of catalog"]',
type: 'XPATH'

Check warning on line 153 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#L153

[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": 153, "column": 34}}}, "severity": "WARNING"}
}
},
});
```
</TabItem>
</Tabs>

<FullPageLimitation/>
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 slow down test execution.
:::
3 changes: 3 additions & 0 deletions docs/visual-testing/_partials/_fullpage-limitation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:::note
Full page screenshot for mobile native testing is in beta. Read more about [mobile native limitation](/visual-testing/mobile-native-testing/)
:::
2 changes: 1 addition & 1 deletion docs/visual-testing/integrations/csharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ VisualClient.CaptureDom = true;

### Full page screenshots

By default, only the current viewport is captured when `.VisualCheck` 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.
By default, only the viewport is captured when `.VisualCheck` 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.
Additionally, you have the option to configure full page settings using the `FullPageConfig` option.

:::note
Expand Down
Loading
Loading