Skip to content

Commit

Permalink
docs(screenshots): add step for specific component testing (#29594)
Browse files Browse the repository at this point in the history
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

There is no documentation on how to use the input field in the
screenshots GH actions.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Added steps and examples on how to specify a component within
screenshots GH actions.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

N/A
  • Loading branch information
thetaPC committed Jun 12, 2024
1 parent e1c0f45 commit 9cec843
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/core/testing/usage-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9cec843

Please sign in to comment.