From b7706c9fe0a82db83c047f69b257a4c273ef26df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Thu, 11 May 2023 08:24:08 +0200 Subject: [PATCH 1/2] fix: update npm scripts for visual regresison snapshots update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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", From 1b06de543a1b35cfbdd05a7b2387c38733d0b7d4 Mon Sep 17 00:00:00 2001 From: Dariusz Olszewski Date: Thu, 11 May 2023 21:40:24 +0200 Subject: [PATCH 2/2] Note about cypress tests in README Signed-off-by: Dariusz Olszewski --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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