From 24ce3fe5ca6024d2aba2fde02fc8dcfada1d00c1 Mon Sep 17 00:00:00 2001 From: frederikprijck Date: Tue, 19 Sep 2023 14:26:12 +0200 Subject: [PATCH] Update Cypress config for v13 --- .github/actions/integration/action.yml | 2 +- .github/workflows/browserstack.yml | 2 +- browserstack.json | 4 ++-- cypress.config.js | 17 +++++++++++++++++ cypress.json | 13 ------------- .../smoke-bs.test.ts => e2e/smoke-bs.cy.ts} | 0 .../smoke.test.ts => e2e/smoke.cy.ts} | 0 package.json | 2 +- 8 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 cypress.config.js delete mode 100644 cypress.json rename cypress/{integration/smoke-bs.test.ts => e2e/smoke-bs.cy.ts} (100%) rename cypress/{integration/smoke.test.ts => e2e/smoke.cy.ts} (100%) diff --git a/.github/actions/integration/action.yml b/.github/actions/integration/action.yml index ad9a44b0..3a31759c 100644 --- a/.github/actions/integration/action.yml +++ b/.github/actions/integration/action.yml @@ -71,6 +71,6 @@ runs: - name: Run Cypress test uses: cypress-io/github-action@v6 with: - spec: cypress/integration/smoke.test.ts + spec: cypress/e2e/smoke.cy.ts install: false wait-on: 'http://localhost:3001/, http://localhost:3000' diff --git a/.github/workflows/browserstack.yml b/.github/workflows/browserstack.yml index 0bcf806d..6ef7ef48 100644 --- a/.github/workflows/browserstack.yml +++ b/.github/workflows/browserstack.yml @@ -54,7 +54,7 @@ jobs: - name: Run tests shell: bash - run: npx concurrently --raw --kill-others --success first "npm:start" "wait-on http://127.0.0.1:3000/ && browserstack-cypress run --build-name ${{ github.event.pull_request.head.sha || github.ref }} --no-wrap --specs "cypress/integration/smoke-bs.test.ts"" + run: npx concurrently --raw --kill-others --success first "npm:start" "wait-on http://127.0.0.1:3000/ && browserstack-cypress run --build-name ${{ github.event.pull_request.head.sha || github.ref }} --no-wrap --specs "cypress/e2e/smoke-bs.cy.ts"" env: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} diff --git a/browserstack.json b/browserstack.json index a31a12cd..e22e768f 100644 --- a/browserstack.json +++ b/browserstack.json @@ -17,8 +17,8 @@ } ], "run_settings": { - "cypress_config_file": "./cypress-bs.json", - "cypress-version": "9", + "cypress_config_file": "./cypress.config.js", + "cypress-version": "13.1", "project_name": "Auth0 React SDK", "exclude": [], "parallels": "5", diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 00000000..eda489a4 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,17 @@ +const { defineConfig } = require('cypress'); + +module.exports = defineConfig({ + chromeWebSecurity: false, + viewportWidth: 1000, + viewportHeight: 1000, + fixturesFolder: false, + reporter: 'junit', + reporterOptions: { + mochaFile: 'test-results/cypress/junit-[hash].xml', + }, + e2e: { + setupNodeEvents(on, config) {}, + baseUrl: 'http://localhost:3000', + supportFile: false, + }, +}); \ No newline at end of file diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 63071e5d..00000000 --- a/cypress.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "baseUrl": "http://localhost:3000", - "chromeWebSecurity": false, - "viewportWidth": 1000, - "viewportHeight": 1000, - "fixturesFolder": false, - "pluginsFile": false, - "supportFile": false, - "reporter": "junit", - "reporterOptions": { - "mochaFile": "test-results/cypress/junit-[hash].xml" - } -} diff --git a/cypress/integration/smoke-bs.test.ts b/cypress/e2e/smoke-bs.cy.ts similarity index 100% rename from cypress/integration/smoke-bs.test.ts rename to cypress/e2e/smoke-bs.cy.ts diff --git a/cypress/integration/smoke.test.ts b/cypress/e2e/smoke.cy.ts similarity index 100% rename from cypress/integration/smoke.test.ts rename to cypress/e2e/smoke.cy.ts diff --git a/package.json b/package.json index 423dbd29..629c4969 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "test:nextjs": "start-server-and-test start:api 3001 start:nextjs 3000 cypress:run", "test:nextjs:watch": "start-server-and-test start:api 3001 start:nextjs 3000 cypress:open", "test:integration": "npm run test:cra && npm run test:gatsby && npm run test:nextjs", - "cypress:run": "cypress run --spec 'cypress/integration/smoke.test.ts'", + "cypress:run": "cypress run --spec 'cypress/e2e/smoke.cy.ts'", "cypress:open": "cypress open" }, "repository": {