diff --git a/README.md b/README.md index fd043184b..b80fcb2cf 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,14 @@ Show your latest holiday photos and videos like in the movies. Show a glimpse of 4. 🎉 Partytime! ### 🧙 Advanced development stuff -To build the Javascript whenever you make changes, you can also run `npm run dev` for developement builds. +To build the Javascript whenever you make changes, you can also run `npm run dev` for development builds. + +### 📷 Running cypress tests +To run e2e cypress tests, execute `npm run cypress`. + +The `visual-regression` tests require additional care as they depend on installation of fonts in the application. To achieve repeatable results run the tests using `npm run cypress:visual-regression`. This will build the app with the required fonts and run the tests. + +If changes are required to the reference (base) screenshots used by the `visual-regression` tests, run `cypress:update-snapshots` and commit the updated screenshots. ## API diff --git a/package.json b/package.json index 174f06581..4fa6c0b95 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,9 @@ "cypress": "npm run cypress:e2e", "cypress:e2e": "cypress run --e2e", "cypress:gui": "cypress open --e2e", - "cypress:visual-regression": "TESTING=true cypress run --spec cypress/e2e/visual-regression.cy.js", - "cypress:update-snapshots": "TESTING=true cypress run --env type=base --spec cypress/e2e/visual-regression.cy.js --config screenshotsFolder=cypress/snapshots/base" + "cypress:pre-snapshots": "TESTING=true npm run dev", + "cypress:visual-regression": "npm run cypress:pre-snapshots && cypress run --spec cypress/e2e/visual-regression.cy.js", + "cypress:update-snapshots": "npm run cypress:pre-snapshots && cypress run --env type=base --spec cypress/e2e/visual-regression.cy.js --config screenshotsFolder=cypress/snapshots/base" }, "dependencies": { "@fontsource/roboto": "^4.5.8",