From 9cec8439f8c2474c1e751696ddbfe699efde449e Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Wed, 12 Jun 2024 08:04:12 -0700 Subject: [PATCH] docs(screenshots): add step for specific component testing (#29594) Issue number: N/A --------- ## What is the current behavior? There is no documentation on how to use the input field in the screenshots GH actions. ## What is the new behavior? - Added steps and examples on how to specify a component within screenshots GH actions. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information N/A --- docs/core/testing/usage-instructions.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/core/testing/usage-instructions.md b/docs/core/testing/usage-instructions.md index ecc51e1b85e..692257ba76e 100644 --- a/docs/core/testing/usage-instructions.md +++ b/docs/core/testing/usage-instructions.md @@ -198,9 +198,19 @@ Instead, use the [Update Reference Screenshots GitHub Action](https://github.com 1. Click the **Run workflow** dropdown. 2. Select your branch. -3. Click **Run workflow**. +3. Leave the input field blank. +4. Click **Run workflow**. -This workflow will re-run the screenshot tests. Instead of failing any tests with mismatched screenshots, it will take new ground truth screenshots. These ground truth screenshots will be pushed as a single commit to your branch once the workflow is completed. +This workflow will re-run all of the the screenshot tests. Instead of failing any tests with mismatched screenshots, it will take new ground truth screenshots. These ground truth screenshots will be pushed as a single commit to your branch once the workflow is completed. + +If you want to update ground truths for a specific test, you can pass the test file path as an input to the workflow. This is useful when working on a specific component. + +1. Click the **Run workflow** dropdown. +2. Select your branch. +3. Enter the file path in the input field. Example: `src/components/alert/test/basic/` +4. Click **Run workflow**. + +The input field also accepts component names, such as `alert`. You can enter multiple components by separating them with spaces, for example, `alert button`. For a full list of options, refer to Playwright's [Command Line page](https://playwright.dev/docs/test-cli). ### Verifying Screenshot Differences