Skip to content

Commit 72c02f3

Browse files
authored
Add information about update_screenshot workflow (#2756)
1 parent dba3aea commit 72c02f3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

docs/android/testing/screenshot_testing.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ We use the [Compose Preview Screenshot Testing](https://developer.android.com/st
3333
The reference screenshots are stored under `src/debug/screenshotTest/reference` in each Gradle module. To update the reference screenshots, run the following command:
3434

3535
```bash
36-
./gradlew updateDebugScreenshotTest
36+
./gradlew updateDebugScreenshotTest updateFullDebugScreenshotTest
3737
```
3838

3939
### CI integration
@@ -54,10 +54,17 @@ Screenshot tests can fail when run on different operating systems due to subtle
5454

5555
### Current approach
5656

57-
- We aim to keep the threshold as low as possible to avoid masking real issues.
58-
- If your tests fail due to minor rendering differences, you may need to adjust the threshold.
57+
We keep the threshold as low as possible to avoid masking real issues.
5958

60-
To adjust the threshold, update the configuration in your test file to allow for slight variations while still catching significant changes.
59+
:::info
60+
The workflow to update screenshots on CI is limited to users with write access and only works for branches within the main repository. It is not available for forks or external contributors at this time.
61+
:::
62+
63+
A GitHub Action workflow, `update_screenshots.yml`, is available and can be manually triggered by a repository maintainer to update the screenshots so they match the verification host configuration. If your screenshot tests fail because of threshold differences, a maintainer will address this during the review process.
64+
65+
:::note
66+
This workflow commits directly to the branch, but it does not trigger the pull request workflow automatically. To trigger the workflow, make a new commit to your branch after the update.
67+
:::
6168

6269
## Best practices for screenshot testing
6370

0 commit comments

Comments
 (0)