diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 00000000000..85b1afcb975 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,17 @@ +"use strict" + +const { defineConfig } = require("cypress") +const setupNodeEvents = require("./test/e2e/plugins/index.js") + +module.exports = defineConfig({ + fileServerFolder: "test/e2e/static", + fixturesFolder: "test/e2e/fixtures", + screenshotsFolder: "test/e2e/screenshots", + videosFolder: "test/e2e/videos", + e2e: { + baseUrl: "http://localhost:3001/", + supportFile: "test/e2e/support/e2e.js", + specPattern: "test/e2e/tests/**/*.js", + setupNodeEvents, + }, +}) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 1f8f60b32ce..00000000000 --- a/cypress.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "fileServerFolder": "test/e2e/static", - "fixturesFolder": "test/e2e/fixtures", - "integrationFolder": "test/e2e/tests", - "pluginsFile": "test/e2e/plugins/index.js", - "screenshotsFolder": "test/e2e/screenshots", - "supportFile": "test/e2e/support/index.js", - "videosFolder": "test/e2e/videos" -} diff --git a/package-lock.json b/package-lock.json index b239426f7eb..a8f635a0711 100644 --- a/package-lock.json +++ b/package-lock.json @@ -70,7 +70,7 @@ "cross-env": "^7.0.3", "css-loader": "^6.7.1", "cssnano": "^5.0.6", - "cypress": "^9.5.1", + "cypress": "=10.3.0", "cypress-file-upload": "^5.0.8", "dedent": "^0.7.0", "deep-extend": "^0.6.0", @@ -8367,9 +8367,9 @@ } }, "node_modules/cypress": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.1.tgz", - "integrity": "sha512-H7lUWB3Svr44gz1rNnj941xmdsCljXoJa2cDneAltjI9leKLMQLm30x6jLlpQ730tiVtIbW5HdUmBzPzwzfUQg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", + "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -8405,7 +8405,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -32217,9 +32217,9 @@ "dev": true }, "cypress": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.1.tgz", - "integrity": "sha512-H7lUWB3Svr44gz1rNnj941xmdsCljXoJa2cDneAltjI9leKLMQLm30x6jLlpQ730tiVtIbW5HdUmBzPzwzfUQg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-10.3.0.tgz", + "integrity": "sha512-txkQWKzvBVnWdCuKs5Xc08gjpO89W2Dom2wpZgT9zWZT5jXxqPIxqP/NC1YArtkpmp3fN5HW8aDjYBizHLUFvg==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -32254,7 +32254,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.6", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", diff --git a/package.json b/package.json index 97aaa9f9ba0..10f89e39c1d 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "lint": "eslint --cache --ext '.js,.jsx' src test", "lint-errors": "eslint --cache --quiet --ext '.js,.jsx' src test", "lint-fix": "eslint --cache --ext '.js,.jsx' src test --fix", - "cy:start": "webpack serve --port 3260 --host 0.0.0.0 --config webpack/dev.babel.js --inline --hot --progress --content-base test/e2e/static", + "cy:start": "webpack serve --port 3260 --host 0.0.0.0 --config webpack/dev.babel.js --hot --progress --static test/e2e/static", "cy:open": "cypress open", "cy:run:chrome": "cypress run --browser chrome", "cy:run:firefox": "cypress run --browser firefox", @@ -118,7 +118,7 @@ "cross-env": "^7.0.3", "css-loader": "^6.7.1", "cssnano": "^5.0.6", - "cypress": "^9.5.1", + "cypress": "=10.3.0", "cypress-file-upload": "^5.0.8", "dedent": "^0.7.0", "deep-extend": "^0.6.0", diff --git a/test/e2e/plugins/index.js b/test/e2e/plugins/index.js index fd170fba691..fff2d903471 100644 --- a/test/e2e/plugins/index.js +++ b/test/e2e/plugins/index.js @@ -11,7 +11,9 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) -module.exports = (on, config) => { +const setupNodeEvents = (on, config) => { // `on` is used to hook into various events Cypress emits // `config` is the resolved Cypress config } + +module.exports = setupNodeEvents diff --git a/test/e2e/support/index.js b/test/e2e/support/e2e.js similarity index 100% rename from test/e2e/support/index.js rename to test/e2e/support/e2e.js