diff --git a/docs/src/test-components-js.md b/docs/src/test-components-js.md index 8d411a66ffa84..d95e8ad577808 100644 --- a/docs/src/test-components-js.md +++ b/docs/src/test-components-js.md @@ -219,7 +219,7 @@ This pattern is the heart of the methodology: ### Per-test props -When a scenario is genuinely parametric — a boundary-value sweep, a text matrix — pass plain serializable props as the second argument to `mount`. The gallery hands them to the story as its props: +When a scenario benefits from parameterizing, pass plain serializable props as the second argument to `mount`. The gallery hands them to the story as its props: ```js title="src/components/Button.story.tsx" import { Button } from './Button'; @@ -256,7 +256,7 @@ await expect(await mount('Button/Primary')).toHaveScreenshot('primary.png'); await expect(await mount('Button/Disabled')).toHaveScreenshot('disabled.png'); ``` -Screenshot the returned root locator, not the page, to avoid asserting on browser chrome. +Screenshot the returned root locator, not the page, to avoid asserting on anything extra you might put in the gallery. ### Handling network requests diff --git a/packages/html-reporter/playwright.config.ts b/packages/html-reporter/playwright.config.ts index d15ded9a00656..22b4ac5f4c73d 100644 --- a/packages/html-reporter/playwright.config.ts +++ b/packages/html-reporter/playwright.config.ts @@ -18,6 +18,8 @@ import path from 'path'; import url from 'url'; import { devices, defineConfig } from '@playwright/test'; +process.env.PWTEST_UNDER_TEST = '1'; + const dirname = path.dirname(url.fileURLToPath(import.meta.url)); const outputDir = path.join(dirname, '..', '..', 'test-results'); diff --git a/packages/html-reporter/playwright/gallery/index.html b/packages/html-reporter/playwright/gallery/index.html index 0842528ca8989..0279894a6dfd7 100644 --- a/packages/html-reporter/playwright/gallery/index.html +++ b/packages/html-reporter/playwright/gallery/index.html @@ -22,11 +22,17 @@