diff --git a/.gitignore b/.gitignore index 9b72e48..7947ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ backend/embed/acme.sh docker/dev/resolv.conf docker/dev/dnsrouter-config.json.tmp thunder-tests +test/cypress/videos diff --git a/test/cypress/Dockerfile b/test/cypress/Dockerfile index fc7573e..fb9714b 100644 --- a/test/cypress/Dockerfile +++ b/test/cypress/Dockerfile @@ -1,4 +1,4 @@ -FROM cypress/included:9.4.1 +FROM cypress/included:12.13.0 COPY --chown=1000 ./test /test diff --git a/test/cypress/config/dev.js b/test/cypress/config/dev.js new file mode 100644 index 0000000..fcd22de --- /dev/null +++ b/test/cypress/config/dev.js @@ -0,0 +1,22 @@ +const { defineConfig } = require('cypress'); + +module.exports = defineConfig({ + requestTimeout: 30000, + defaultCommandTimeout: 20000, + reporter: 'cypress-multi-reporters', + reporterOptions: { + configFile: 'multi-reporter.json' + }, + videos: false, + screenshotsFolder: 'results/screenshots', + env: { + swaggerBase: '{{baseUrl}}/api/schema', + RETRIES: 0 + }, + e2e: { + // baseUrl: '{{baseUrl}}', + setupNodeEvents(on, config) { + return require('../plugins/index.js')(on, config); + }, + } +}); diff --git a/test/cypress/integration/api/Certificates.spec.js b/test/cypress/e2e/api/Certificates.cy.js similarity index 100% rename from test/cypress/integration/api/Certificates.spec.js rename to test/cypress/e2e/api/Certificates.cy.js diff --git a/test/cypress/integration/api/FullCertProvision.spec.js b/test/cypress/e2e/api/FullCertProvision.cy.js similarity index 100% rename from test/cypress/integration/api/FullCertProvision.spec.js rename to test/cypress/e2e/api/FullCertProvision.cy.js diff --git a/test/cypress/integration/api/Health.spec.js b/test/cypress/e2e/api/Health.cy.js similarity index 100% rename from test/cypress/integration/api/Health.spec.js rename to test/cypress/e2e/api/Health.cy.js diff --git a/test/cypress/integration/api/Settings.spec.js b/test/cypress/e2e/api/Settings.cy.js similarity index 100% rename from test/cypress/integration/api/Settings.spec.js rename to test/cypress/e2e/api/Settings.cy.js diff --git a/test/cypress/integration/api/SetupPhase.spec.js b/test/cypress/e2e/api/SetupPhase.cy.js similarity index 100% rename from test/cypress/integration/api/SetupPhase.spec.js rename to test/cypress/e2e/api/SetupPhase.cy.js diff --git a/test/cypress/integration/api/SwaggerSchema.spec.js b/test/cypress/e2e/api/SwaggerSchema.cy.js similarity index 100% rename from test/cypress/integration/api/SwaggerSchema.spec.js rename to test/cypress/e2e/api/SwaggerSchema.cy.js diff --git a/test/cypress/integration/api/Upstreams.spec.js b/test/cypress/e2e/api/Upstreams.cy.js similarity index 100% rename from test/cypress/integration/api/Upstreams.spec.js rename to test/cypress/e2e/api/Upstreams.cy.js diff --git a/test/cypress/integration/api/Users.spec.js b/test/cypress/e2e/api/Users.cy.js similarity index 100% rename from test/cypress/integration/api/Users.spec.js rename to test/cypress/e2e/api/Users.cy.js diff --git a/test/cypress/integration/ui/SetupLogin.spec.js b/test/cypress/e2e/ui/SetupLogin.cy.js similarity index 100% rename from test/cypress/integration/ui/SetupLogin.spec.js rename to test/cypress/e2e/ui/SetupLogin.cy.js diff --git a/test/cypress/support/index.js b/test/cypress/support/e2e.js similarity index 100% rename from test/cypress/support/index.js rename to test/cypress/support/e2e.js diff --git a/test/package.json b/test/package.json index f173059..f6736ac 100644 --- a/test/package.json +++ b/test/package.json @@ -4,9 +4,9 @@ "description": "", "main": "index.js", "dependencies": { - "@jc21/cypress-swagger-validation": "^0.2.0", + "@jc21/cypress-swagger-validation": "^0.2.1", "@jc21/restler": "^3.4.0", - "chalk": "^5.2.0", + "chalk": "^4.1.0", "cypress": "^12.13.0", "cypress-multi-reporters": "^1.6.3", "cypress-wait-until": "^1.7.2", @@ -19,8 +19,8 @@ "mocha-junit-reporter": "^2.2.0" }, "scripts": { - "cypress": "cypress open --config-file=cypress/config/dev.json --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}", - "cypress:headless": "cypress run --config-file=cypress/config/dev.json --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}" + "cypress": "cypress open --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}", + "cypress:headless": "cypress run --config-file=cypress/config/dev.js --config baseUrl=${BASE_URL:-http://127.0.0.1:3081}" }, "author": "", "license": "ISC" diff --git a/test/yarn.lock b/test/yarn.lock index 086e821..f047579 100644 --- a/test/yarn.lock +++ b/test/yarn.lock @@ -117,14 +117,14 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@jc21/cypress-swagger-validation@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@jc21/cypress-swagger-validation/-/cypress-swagger-validation-0.2.0.tgz#73d31d2095380e18f8a6b4db22b6d20d0f3ea924" - integrity sha512-eDRY1ML8kXohlxN5oz2/deoZ5092PEmmTTEjIVejxmadkAUbXi71DNBKKCI69wdTwLKHVpFwlShNg2s2V386eQ== +"@jc21/cypress-swagger-validation@^0.2.1": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@jc21/cypress-swagger-validation/-/cypress-swagger-validation-0.2.1.tgz#2995b12619fcd382a5eba7482640c6dff15a169a" + integrity sha512-1M6P8STyHtMo+BsMRmwSUkBHtXs8bzMUvj78z0OUDK6QTBiKwYyBhJSech0WFE9zovq5wTJ23wZe9Wtqetf9mQ== dependencies: "@apidevtools/swagger-parser" "^10.1.0" ajv "^8.12.0" - chalk "^5.2.0" + chalk "^4.1.0" json-schema "^0.4.0" json-schema-ref-parser "^9.0.6" jsonpath "^1.1.1" @@ -469,11 +469,6 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.2.0.tgz#249623b7d66869c673699fb66d65723e54dfcfb3" - integrity sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA== - charenc@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"