diff --git a/docs/src/api/class-locatorassertions.md b/docs/src/api/class-locatorassertions.md index df22b9d46b73b..90e9c89a03046 100644 --- a/docs/src/api/class-locatorassertions.md +++ b/docs/src/api/class-locatorassertions.md @@ -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-%% @@ -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-%% diff --git a/docs/src/api/class-pageassertions.md b/docs/src/api/class-pageassertions.md index 4e6fc70a0fbbc..3e298ba2fc576 100644 --- a/docs/src/api/class-pageassertions.md +++ b/docs/src/api/class-pageassertions.md @@ -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-%% @@ -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-%% diff --git a/docs/src/api/params.md b/docs/src/api/params.md index a62988ac7b5a4..7051be7ec9ccc 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -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]> diff --git a/packages/playwright-test/types/test.d.ts b/packages/playwright-test/types/test.d.ts index c7e1e050d1d26..28d0e00b87dad 100644 --- a/packages/playwright-test/types/test.d.ts +++ b/packages/playwright-test/types/test.d.ts @@ -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"; @@ -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"; @@ -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"; @@ -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"; diff --git a/tests/config/experimental.d.ts b/tests/config/experimental.d.ts index c1355b05ad92c..e2b08ec5b6e06 100644 --- a/tests/config/experimental.d.ts +++ b/tests/config/experimental.d.ts @@ -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"; @@ -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"; @@ -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"; @@ -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";