Rayrun
← Back to Discord Forum

Are snapshots supposed to be generated locally or are they supposed to be generated by CI?

We use https://playwright.dev/docs/test-snapshots testing as part of our automated tests. We are debating as a team whether snapshots should be generated locally and committed or if they should be generated as part of CI/CD. I would like to hear from others as to how you are doing it and what pros/cons have you weighted?

For avoidance of confusion, we are debating between:

Option A:

  1. generating locally
  2. committing
  3. CI is responsible for validating that the committed snapshots match the execution of the CI results

Option B:

  1. adding a CI action that generates snapshots and adds a commit to the PR
  2. engineer is responsible for reviewing the generated snapshot
  3. CI is responsible for validating that the committed snapshots match the execution of the CI results

This thread is trying to answer question "Should snapshots for automated tests be generated locally and committed, or should they be generated as part of CI/CD?"

3 replies
tphillips8117

Both options involve the engineer at least reviewing the image, so I would go with Option A.

tphillips8117

Doing it that way lets you look over the images as part of a PR process and you can update them when you need to.

For others reference, I've also started poll on Reddit on the same subject https://www.reddit.com/r/webdev/comments/1742s62/conceptually_are_snapshots_supposed_to_be/

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].