From 9c3d7ab3225a2f8310fe3e096186640a600e5d5e Mon Sep 17 00:00:00 2001 From: alan-wu Date: Tue, 14 Nov 2023 11:47:06 +1300 Subject: [PATCH 1/2] Update command for running cypress test. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7d0719a0..07b8eab5 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "generate-icons": "vsvg -s ./static/icons-svg -t ./static/icons-js", "test": "jest", "test:debug": "node --inspect node_modules/.bin/jest --runInBand", - "test-run-e2e": "cypress run --record" + "test-run-e2e": "cypress run" }, "dependencies": { "@abi-software/gallery": "0.3.2", From cae6c085e4f4179db0daad6b017ebc02e0f39874 Mon Sep 17 00:00:00 2001 From: alan-wu Date: Thu, 16 Nov 2023 13:58:31 +1300 Subject: [PATCH 2/2] Move cypress directory into test directory. --- .gitignore | 4 ++-- cypress.config.js | 6 ++++++ {cypress => test/cypress}/e2e/datasets.cy.js | 0 {cypress => test/cypress}/e2e/finddata.cy.js | 0 {cypress => test/cypress}/e2e/homepage.cy.js | 0 {cypress => test/cypress}/fixtures/example.json | 0 {cypress => test/cypress}/support/commands.js | 0 {cypress => test/cypress}/support/e2e.js | 0 8 files changed, 8 insertions(+), 2 deletions(-) rename {cypress => test/cypress}/e2e/datasets.cy.js (100%) rename {cypress => test/cypress}/e2e/finddata.cy.js (100%) rename {cypress => test/cypress}/e2e/homepage.cy.js (100%) rename {cypress => test/cypress}/fixtures/example.json (100%) rename {cypress => test/cypress}/support/commands.js (100%) rename {cypress => test/cypress}/support/e2e.js (100%) diff --git a/.gitignore b/.gitignore index 2277ae7a..f32a8683 100644 --- a/.gitignore +++ b/.gitignore @@ -110,5 +110,5 @@ sw.* # Certifact files .certs/ -cypress/videos -cypress/downloads \ No newline at end of file +test/cypress/videos +test/cypress/downloads \ No newline at end of file diff --git a/cypress.config.js b/cypress.config.js index e8f8d6b5..4b0e281d 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -9,6 +9,8 @@ module.exports = defineConfig({ baseUrl: process.env.ROOT_URL ? process.env.ROOT_URL : 'http://localhost:3000', experimentalStudio: true, projectId: process.env.CYPRESS_PROJECT_ID, + specPattern: "test/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}", + supportFile: "test/cypress/support/e2e.js", viewportWidth: 1600, viewportHeight: 900, //Prevent huge amount of time on reloading page @@ -18,4 +20,8 @@ module.exports = defineConfig({ // implement node event listeners here }, }, + fixturesFolder: "test/cypress/fixtures", + screenshotsFolder: "test/cypress/screenshots", + videosFolder: "test/cypress/videos", + downloadsFolder: "test/cypress/downloads", }); diff --git a/cypress/e2e/datasets.cy.js b/test/cypress/e2e/datasets.cy.js similarity index 100% rename from cypress/e2e/datasets.cy.js rename to test/cypress/e2e/datasets.cy.js diff --git a/cypress/e2e/finddata.cy.js b/test/cypress/e2e/finddata.cy.js similarity index 100% rename from cypress/e2e/finddata.cy.js rename to test/cypress/e2e/finddata.cy.js diff --git a/cypress/e2e/homepage.cy.js b/test/cypress/e2e/homepage.cy.js similarity index 100% rename from cypress/e2e/homepage.cy.js rename to test/cypress/e2e/homepage.cy.js diff --git a/cypress/fixtures/example.json b/test/cypress/fixtures/example.json similarity index 100% rename from cypress/fixtures/example.json rename to test/cypress/fixtures/example.json diff --git a/cypress/support/commands.js b/test/cypress/support/commands.js similarity index 100% rename from cypress/support/commands.js rename to test/cypress/support/commands.js diff --git a/cypress/support/e2e.js b/test/cypress/support/e2e.js similarity index 100% rename from cypress/support/e2e.js rename to test/cypress/support/e2e.js