diff --git a/core/package.json b/core/package.json index 9c14a6f3d2..18813d3f01 100644 --- a/core/package.json +++ b/core/package.json @@ -95,6 +95,7 @@ "test.spec": "stencil test --spec --max-workers=2", "test.spec.debug": "npx --node-arg=\"--inspect-brk\" stencil test --spec", "test.e2e": "npx playwright test", + "test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots", "test.watch": "jest --watch --no-cache", "test.treeshake": "node scripts/treeshaking.js dist/index.js", "validate": "npm run lint && npm run test && npm run build && npm run test.treeshake" diff --git a/core/src/utils/test/playwright/docs/usage-instructions.md b/core/src/utils/test/playwright/docs/usage-instructions.md index 8a2fa44bc6..de7c348018 100644 --- a/core/src/utils/test/playwright/docs/usage-instructions.md +++ b/core/src/utils/test/playwright/docs/usage-instructions.md @@ -59,7 +59,13 @@ The examples provided in the [Running Tests](#running-tests) section also apply Note that since you are generating the reference branch ground truth screenshots, you must be on the reference branch locally. Don't forget to pull the latest reference branch changes and then re-build using `npm run build`. ```shell -npm run test.e2e -- --update-snapshots +npm run test.e2e.update-snapshots +``` + +Optionally, you can pass a directory to only update the ground truths for that directory & subdirectories. This is useful when working on a specific component. + +```shell +npm run test.e2e.update-snapshots src/components/alert/ ``` From here, you can switch back to your branch and run the tests.