diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ff6d1bef1..f7ba106c1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -217,12 +217,12 @@ jobs: - name: Run Cypress Tests uses: cypress-io/github-action@v6 with: - working-directory: tests/cypress + working-directory: tests spec: | - e2e/*.cy.js - e2e/admin/*.cy.js - e2e/mcpar/*.cy.js - e2e/mlr/*.cy.js + cypress/e2e/*.cy.js + cypress/e2e/admin/*.cy.js + cypress/e2e/mcpar/*.cy.js + cypress/e2e/mlr/*.cy.js browser: chrome config: baseUrl=${{ needs.deploy.outputs.application_endpoint }} wait-on: ${{ needs.deploy.outputs.application_endpoint }} @@ -257,8 +257,8 @@ jobs: - name: Check Project A11y uses: cypress-io/github-action@v6 with: - working-directory: tests/cypress - spec: e2e/accessibility/*.cy.js + working-directory: tests + spec: cypress/e2e/accessibility/*.cy.js browser: chrome config: baseUrl=${{ needs.deploy.outputs.application_endpoint }} wait-on: ${{ needs.deploy.outputs.application_endpoint }} diff --git a/.gitignore b/.gitignore index fe774668b..2c3dbe615 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,6 @@ tests_output tests/cypress/videos tests/cypress/screenshots tests/cypress/downloads -tests/cypress/package-lock.json -package-lock.json .vscode/ *._S3rver_cors.xml services/database/local_buckets diff --git a/package.json b/package.json index 59a302eca..ad4408cfc 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "test": "tests" }, "scripts": { - "test": "cd tests/cypress && npm test && cd -", - "test:ci": "cd tests/cypress && yarn run test:ci" + "test": "cd tests && npm test && cd -", + "test:ci": "cd tests && yarn run test:ci" }, "repository": { "type": "git", diff --git a/tests/cypress/README.md b/tests/README.md similarity index 100% rename from tests/cypress/README.md rename to tests/README.md diff --git a/tests/cypress/cypress.config.js b/tests/cypress.config.js similarity index 84% rename from tests/cypress/cypress.config.js rename to tests/cypress.config.js index e520b0d8c..81aa523b4 100644 --- a/tests/cypress/cypress.config.js +++ b/tests/cypress.config.js @@ -1,16 +1,12 @@ const { defineConfig } = require("cypress"); const { pa11y, prepareAudit } = require("@cypress-audit/pa11y"); -require("dotenv").config({ path: "../../.env" }); +require("dotenv").config({ path: "../.env" }); module.exports = defineConfig({ experimentalStudio: true, redirectionLimit: 20, retries: 2, watchForFileChanges: true, - fixturesFolder: "fixtures", - screenshotsFolder: "screenshots", - videosFolder: "videos", - downloadsFolder: "downloads", types: ["cypress", "cypress-axe"], env: { STATE_USER_EMAIL: process.env.CYPRESS_STATE_USER_EMAIL, @@ -23,8 +19,7 @@ module.exports = defineConfig({ e2e: { baseUrl: "http://localhost:3000/", testIsolation: false, - specPattern: ["e2e/**/*.cy.js"], - supportFile: "support/index.js", + supportFile: "cypress/support/index.js", async setupNodeEvents(on, config) { on("task", { log(message) { diff --git a/tests/cypress/package.json b/tests/package.json similarity index 91% rename from tests/cypress/package.json rename to tests/package.json index b2a79a88d..e8c9ff6fc 100644 --- a/tests/cypress/package.json +++ b/tests/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "start": "cd ../../ && ./run local && cd -", + "start": "cd ../ && ./run local && cd -", "cypress": "cypress open", "test": "concurrently --kill-others \"yarn start\" \"yarn cypress\"", "test:ci": "cypress install && cypress run --browser chrome --headless" diff --git a/tests/cypress/yarn.lock b/tests/yarn.lock similarity index 100% rename from tests/cypress/yarn.lock rename to tests/yarn.lock