Skip to content

Commit

Permalink
chore: fix wrong toHaveScreenshot defaults in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed May 16, 2022
1 parent f1307f4 commit 6fe6d1e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
6 changes: 4 additions & 2 deletions docs/src/api/class-locatorassertions.md
Expand Up @@ -1022,7 +1022,8 @@ await expect(locator).toHaveScreenshot('image.png');
Snapshot name.

### option: LocatorAssertions.toHaveScreenshot#1.timeout = %%-js-assertions-timeout-%%
### option: LocatorAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-%%
### option: LocatorAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-default-disabled-%%

### option: LocatorAssertions.toHaveScreenshot#1.caret = %%-screenshot-option-caret-%%
### option: LocatorAssertions.toHaveScreenshot#1.mask = %%-screenshot-option-mask-%%
### option: LocatorAssertions.toHaveScreenshot#1.omitBackground = %%-screenshot-option-omit-background-%%
Expand All @@ -1046,7 +1047,8 @@ await expect(locator).toHaveScreenshot();
```

### option: LocatorAssertions.toHaveScreenshot#2.timeout = %%-js-assertions-timeout-%%
### option: LocatorAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-%%
### option: LocatorAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-default-disabled-%%

### option: LocatorAssertions.toHaveScreenshot#2.caret = %%-screenshot-option-caret-%%
### option: LocatorAssertions.toHaveScreenshot#2.mask = %%-screenshot-option-mask-%%
### option: LocatorAssertions.toHaveScreenshot#2.omitBackground = %%-screenshot-option-omit-background-%%
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/class-pageassertions.md
Expand Up @@ -133,7 +133,7 @@ await expect(page).toHaveScreenshot('image.png');
Snapshot name.

### option: PageAssertions.toHaveScreenshot#1.timeout = %%-js-assertions-timeout-%%
### option: PageAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-%%
### option: PageAssertions.toHaveScreenshot#1.animations = %%-screenshot-option-animations-default-disabled-%%
### option: PageAssertions.toHaveScreenshot#1.caret = %%-screenshot-option-caret-%%
### option: PageAssertions.toHaveScreenshot#1.clip = %%-screenshot-option-clip-%%
### option: PageAssertions.toHaveScreenshot#1.fullPage = %%-screenshot-option-full-page-%%
Expand All @@ -159,7 +159,7 @@ await expect(page).toHaveScreenshot();
```

### option: PageAssertions.toHaveScreenshot#2.timeout = %%-js-assertions-timeout-%%
### option: PageAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-%%
### option: PageAssertions.toHaveScreenshot#2.animations = %%-screenshot-option-animations-default-disabled-%%
### option: PageAssertions.toHaveScreenshot#2.caret = %%-screenshot-option-caret-%%
### option: PageAssertions.toHaveScreenshot#2.clip = %%-screenshot-option-clip-%%
### option: PageAssertions.toHaveScreenshot#2.fullPage = %%-screenshot-option-full-page-%%
Expand Down
9 changes: 9 additions & 0 deletions docs/src/api/params.md
Expand Up @@ -910,6 +910,15 @@ When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animatio

Defaults to `"allow"` that leaves animations untouched.

## screenshot-option-animations-default-disabled
- `animations` <[ScreenshotAnimations]<"disabled"|"allow">>

When set to `"disabled"`, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
* finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* infinite animations are canceled to initial state, and then played over after the screenshot.

Defaults to `"disabled"` that disables animations.

## screenshot-option-omit-background
- `omitBackground` <[boolean]>

Expand Down
8 changes: 4 additions & 4 deletions packages/playwright-test/types/test.d.ts
Expand Up @@ -3349,7 +3349,7 @@ interface LocatorAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -3424,7 +3424,7 @@ interface LocatorAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -3578,7 +3578,7 @@ interface PageAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -3683,7 +3683,7 @@ interface PageAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down
8 changes: 4 additions & 4 deletions tests/config/experimental.d.ts
Expand Up @@ -19555,7 +19555,7 @@ interface LocatorAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -19630,7 +19630,7 @@ interface LocatorAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -19784,7 +19784,7 @@ interface PageAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down Expand Up @@ -19889,7 +19889,7 @@ interface PageAssertions {
* - finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
* - infinite animations are canceled to initial state, and then played over after the screenshot.
*
* Defaults to `"allow"` that leaves animations untouched.
* Defaults to `"disabled"` that disables animations.
*/
animations?: "disabled"|"allow";

Expand Down

0 comments on commit 6fe6d1e

Please sign in to comment.