Skip to content

Conversation

mon4our
Copy link
Member

@mon4our mon4our commented Aug 31, 2025

Updated the acceptance tests wiki with steps on how to update screenshots

@mon4our
Copy link
Member Author

mon4our commented Sep 2, 2025

@seanlip PTAL, thanks!

Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mon4our for doing this! Left a few notes, PTAL.

@@ -247,6 +247,67 @@ On CI, we run all the acceptance tests in production mode, so the screenshots in

On the other hand, if the screenshot fails locally (in desktop environment), the screenshot `teachPage-diff.png` will be generated and stored inside a new folder `diff-snapshots` under `logged-out-user/dev-desktop-screenshots`.

### Adding Prod screenshots for Acceptance Tests
On making changes that affect a user journey tested through the acceptance tests or introduce a new feature, a contributor needs to update/add screenshots supporting their changes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On --> When

@@ -247,6 +247,67 @@ On CI, we run all the acceptance tests in production mode, so the screenshots in

On the other hand, if the screenshot fails locally (in desktop environment), the screenshot `teachPage-diff.png` will be generated and stored inside a new folder `diff-snapshots` under `logged-out-user/dev-desktop-screenshots`.

### Adding Prod screenshots for Acceptance Tests
On making changes that affect a user journey tested through the acceptance tests or introduce a new feature, a contributor needs to update/add screenshots supporting their changes.
It has been noted that screenshots obtained by running the Acceptance tests locally using the prod flag do not match those captured by the CI. To overcome this, you can commit any image in the prod screenshot folder and follow these steps:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the first sentence, replace with: "These screenshots should be obtained from the CI (not local) run, so that the environment matches future runs." Update the second sentence to follow on from that.

In the second sentence, what do you mean by "commit any image in the prod screenshot folder"?

### Adding Prod screenshots for Acceptance Tests
On making changes that affect a user journey tested through the acceptance tests or introduce a new feature, a contributor needs to update/add screenshots supporting their changes.
It has been noted that screenshots obtained by running the Acceptance tests locally using the prod flag do not match those captured by the CI. To overcome this, you can commit any image in the prod screenshot folder and follow these steps:
1. Go to the failing run and click on the 'uploading diff screenshots as an artifact' section:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize "uploading"

"click on the" --> "open the"

1. Go to the failing run and click on the 'uploading diff screenshots as an artifact' section:
<img width="349" height="35" alt="image" src="https://github.com/user-attachments/assets/827d8557-3346-443a-aaf8-1fd0168a3f24" />

2. Then download the artifact from the artifact download url:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight that URL in the image.

2. Then download the artifact from the artifact download url:
<img width="1221" height="301" alt="image" src="https://github.com/user-attachments/assets/c2caa55f-b4f9-40cc-a47a-7ddc2de9a479" />

3. Extract the contents of the artifact. There will be a folder with an image. The image will be like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be like this --> look like this


(Its curriculum-admin in this case)

14. Navigate to the spec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unclear, please specify what you mean by "spec". How do they figure out which spec to navigate to?

15. Check if the failure was for desktop or mobile based on the screenshot or the subfolder in the artifact:
<img width="102" height="127" alt="image" src="https://github.com/user-attachments/assets/c1b902ee-5ccb-4218-a247-d4e19da9d3ed" />

16. Go to the prod-desktop-screenshots/prod-mobile-screenshots folder depending on your failure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "or" instead of "/" to avoid ambiguity, since a slash is a folder name separator too


16. Go to the prod-desktop-screenshots/prod-mobile-screenshots folder depending on your failure

17. Paste the image we split.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to the step number where the splitting action was taken


17. Paste the image we split.

18. Check the name of the image from the artifact. It will be {screenshot_name}-diff.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can combine steps 18-21 into something along the lines of "replace the old screenshot with the new one"


20. Rename the pasted image to {screenshot_name}-snap.png

21. Check that the correct image got replaced, commit and push your changes!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Commit and push your changes" should be a separate step

Maybe at the end you can also ask them to do a self-review of the PR to verify that the correct images are used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants