diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 7460c34a..b3294d1b 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -56,7 +56,7 @@ jobs: strategy: fail-fast: false matrix: - containers: ['+(a11y|security|bugs)/**/*.js', 'features/**/+(o|d)*.js', 'features/**/m*.js', 'features/**/!(o|d|m)*.js'] + containers: ['+(a11y|security|bugs)/**/*cy.js', 'features/**/+(o|d)*.cy.js', 'features/**/m*.cy.js', 'features/**/!(o|d|m)*.cy.js'] steps: - uses: actions/checkout@v3 @@ -80,4 +80,4 @@ jobs: run: npm ci - name: Cypress Test - run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/tests/${{ matrix.containers }}"' + run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/e2e/${{ matrix.containers }}"' diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 00000000..a948ea0f --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,19 @@ +const { defineConfig } = require("cypress") + +const startOAuthServer = require("./test/e2e-cypress/support/helpers/oauth2-server") + +module.exports = defineConfig({ + fileServerFolder: "test/e2e-cypress/static", + fixturesFolder: "test/e2e-cypress/fixtures", + screenshotsFolder: "test/e2e-cypress/screenshots", + videosFolder: "test/e2e-cypress/videos", + video: false, + e2e: { + baseUrl: "http://localhost:3230/", + supportFile: "test/e2e-cypress/support/e2e.js", + specPattern: "test/e2e-cypress/e2e/**/*.cy.{js,jsx}", + setupNodeEvents: () => { + startOAuthServer() + }, + }, +}) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 6d11f51b..00000000 --- a/cypress.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "fileServerFolder": "test/e2e-cypress/static", - "fixturesFolder": "test/e2e-cypress/fixtures", - "integrationFolder": "test/e2e-cypress/tests", - "pluginsFile": "test/e2e-cypress/plugins/index.js", - "screenshotsFolder": "test/e2e-cypress/screenshots", - "supportFile": "test/e2e-cypress/support/index.js", - "videosFolder": "test/e2e-cypress/videos", - "baseUrl": "http://localhost:3230/", - "video": false -} diff --git a/package-lock.json b/package-lock.json index f036017a..22744eac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,7 @@ "cross-env": "=7.0.3", "css-loader": "=6.7.4", "cssnano": "=6.0.1", - "cypress": "=9.5.1", + "cypress": "=12.13.0", "dedent": "^0.7.0", "deepmerge": "^4.3.1", "enzyme": "=3.11.0", @@ -9639,9 +9639,9 @@ } }, "node_modules/cypress": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.1.tgz", - "integrity": "sha512-H7lUWB3Svr44gz1rNnj941xmdsCljXoJa2cDneAltjI9leKLMQLm30x6jLlpQ730tiVtIbW5HdUmBzPzwzfUQg==", + "version": "12.13.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.13.0.tgz", + "integrity": "sha512-QJlSmdPk+53Zhy69woJMySZQJoWfEWun3X5OOenGsXjRPVfByVTHorxNehbzhZrEzH9RDUDqVcck0ahtlS+N/Q==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -9659,12 +9659,12 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", - "debug": "^4.3.2", + "debug": "^4.3.4", "enquirer": "^2.3.6", - "eventemitter2": "^6.4.3", + "eventemitter2": "6.4.7", "execa": "4.1.0", "executable": "^4.1.1", "extract-zip": "2.0.1", @@ -9677,7 +9677,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -9692,7 +9692,7 @@ "cypress": "bin/cypress" }, "engines": { - "node": ">=12.0.0" + "node": "^14.0.0 || ^16.0.0 || >=18.0.0" } }, "node_modules/cypress/node_modules/@types/node": { @@ -9787,9 +9787,9 @@ "dev": true }, "node_modules/cypress/node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true, "engines": { "node": ">= 6" @@ -11855,9 +11855,9 @@ } }, "node_modules/eventemitter2": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", - "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==", + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, "node_modules/eventemitter3": { @@ -37933,9 +37933,9 @@ "dev": true }, "cypress": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-9.5.1.tgz", - "integrity": "sha512-H7lUWB3Svr44gz1rNnj941xmdsCljXoJa2cDneAltjI9leKLMQLm30x6jLlpQ730tiVtIbW5HdUmBzPzwzfUQg==", + "version": "12.13.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-12.13.0.tgz", + "integrity": "sha512-QJlSmdPk+53Zhy69woJMySZQJoWfEWun3X5OOenGsXjRPVfByVTHorxNehbzhZrEzH9RDUDqVcck0ahtlS+N/Q==", "dev": true, "requires": { "@cypress/request": "^2.88.10", @@ -37952,12 +37952,12 @@ "check-more-types": "^2.24.0", "cli-cursor": "^3.1.0", "cli-table3": "~0.6.1", - "commander": "^5.1.0", + "commander": "^6.2.1", "common-tags": "^1.8.0", "dayjs": "^1.10.4", - "debug": "^4.3.2", + "debug": "^4.3.4", "enquirer": "^2.3.6", - "eventemitter2": "^6.4.3", + "eventemitter2": "6.4.7", "execa": "4.1.0", "executable": "^4.1.1", "extract-zip": "2.0.1", @@ -37970,7 +37970,7 @@ "listr2": "^3.8.3", "lodash": "^4.17.21", "log-symbols": "^4.0.0", - "minimist": "^1.2.5", + "minimist": "^1.2.8", "ospath": "^1.2.2", "pretty-bytes": "^5.6.0", "proxy-from-env": "1.0.0", @@ -38044,9 +38044,9 @@ "dev": true }, "commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", "dev": true }, "execa": { @@ -39548,9 +39548,9 @@ } }, "eventemitter2": { - "version": "6.4.9", - "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.9.tgz", - "integrity": "sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==", + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, "eventemitter3": { diff --git a/package.json b/package.json index 1140f54f..6105e1f9 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "cross-env": "=7.0.3", "css-loader": "=6.7.4", "cssnano": "=6.0.1", - "cypress": "=9.5.1", + "cypress": "=12.13.0", "dedent": "^0.7.0", "deepmerge": "^4.3.1", "enzyme": "=3.11.0", diff --git a/test/e2e-cypress/tests/a11y/response-tabs.js b/test/e2e-cypress/e2e/a11y/response-tabs.cy.js similarity index 100% rename from test/e2e-cypress/tests/a11y/response-tabs.js rename to test/e2e-cypress/e2e/a11y/response-tabs.cy.js diff --git a/test/e2e-cypress/tests/bugs/4442.js b/test/e2e-cypress/e2e/bugs/4442.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/4442.js rename to test/e2e-cypress/e2e/bugs/4442.cy.js diff --git a/test/e2e-cypress/tests/bugs/4641.js b/test/e2e-cypress/e2e/bugs/4641.cy.js similarity index 96% rename from test/e2e-cypress/tests/bugs/4641.js rename to test/e2e-cypress/e2e/bugs/4641.cy.js index 1a4bb03c..9ba6cf4a 100644 --- a/test/e2e-cypress/tests/bugs/4641.js +++ b/test/e2e-cypress/e2e/bugs/4641.cy.js @@ -24,13 +24,9 @@ const clickLogoutAndReauthorise = () => { describe("#4641: The Logout button in Authorize popup not clearing API Key", () => { beforeEach(() => { - cy.server() - cy - .route({ - url: "/4641*", - response: "OK", - }) - .as("request") + cy.intercept("GET", "/4641*", { + body: "OK", + }).as("request") }) it("should include the given api key in requests", () => { diff --git a/test/e2e-cypress/tests/bugs/4838.js b/test/e2e-cypress/e2e/bugs/4838.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/4838.js rename to test/e2e-cypress/e2e/bugs/4838.cy.js diff --git a/test/e2e-cypress/tests/bugs/4865.js b/test/e2e-cypress/e2e/bugs/4865.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/4865.js rename to test/e2e-cypress/e2e/bugs/4865.cy.js diff --git a/test/e2e-cypress/tests/bugs/4867.js b/test/e2e-cypress/e2e/bugs/4867.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/4867.js rename to test/e2e-cypress/e2e/bugs/4867.cy.js diff --git a/test/e2e-cypress/tests/bugs/4943.js b/test/e2e-cypress/e2e/bugs/4943.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/4943.js rename to test/e2e-cypress/e2e/bugs/4943.cy.js diff --git a/test/e2e-cypress/tests/bugs/5043.js b/test/e2e-cypress/e2e/bugs/5043.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5043.js rename to test/e2e-cypress/e2e/bugs/5043.cy.js diff --git a/test/e2e-cypress/tests/bugs/5060.js b/test/e2e-cypress/e2e/bugs/5060.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5060.js rename to test/e2e-cypress/e2e/bugs/5060.cy.js diff --git a/test/e2e-cypress/tests/bugs/5070.js b/test/e2e-cypress/e2e/bugs/5070.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5070.js rename to test/e2e-cypress/e2e/bugs/5070.cy.js diff --git a/test/e2e-cypress/tests/bugs/5072.js b/test/e2e-cypress/e2e/bugs/5072.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5072.js rename to test/e2e-cypress/e2e/bugs/5072.cy.js diff --git a/test/e2e-cypress/tests/bugs/5129.js b/test/e2e-cypress/e2e/bugs/5129.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5129.js rename to test/e2e-cypress/e2e/bugs/5129.cy.js diff --git a/test/e2e-cypress/tests/bugs/5138.js b/test/e2e-cypress/e2e/bugs/5138.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5138.js rename to test/e2e-cypress/e2e/bugs/5138.cy.js diff --git a/test/e2e-cypress/tests/bugs/5164.js b/test/e2e-cypress/e2e/bugs/5164.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5164.js rename to test/e2e-cypress/e2e/bugs/5164.cy.js diff --git a/test/e2e-cypress/tests/bugs/5188.js b/test/e2e-cypress/e2e/bugs/5188.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5188.js rename to test/e2e-cypress/e2e/bugs/5188.cy.js diff --git a/test/e2e-cypress/tests/bugs/5452.js b/test/e2e-cypress/e2e/bugs/5452.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5452.js rename to test/e2e-cypress/e2e/bugs/5452.cy.js diff --git a/test/e2e-cypress/tests/bugs/5453.js b/test/e2e-cypress/e2e/bugs/5453.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5453.js rename to test/e2e-cypress/e2e/bugs/5453.cy.js diff --git a/test/e2e-cypress/tests/bugs/5455.js b/test/e2e-cypress/e2e/bugs/5455.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5455.js rename to test/e2e-cypress/e2e/bugs/5455.cy.js diff --git a/test/e2e-cypress/tests/bugs/5458.js b/test/e2e-cypress/e2e/bugs/5458.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5458.js rename to test/e2e-cypress/e2e/bugs/5458.cy.js diff --git a/test/e2e-cypress/tests/bugs/5660.js b/test/e2e-cypress/e2e/bugs/5660.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/5660.js rename to test/e2e-cypress/e2e/bugs/5660.cy.js diff --git a/test/e2e-cypress/tests/bugs/6016.js b/test/e2e-cypress/e2e/bugs/6016.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6016.js rename to test/e2e-cypress/e2e/bugs/6016.cy.js diff --git a/test/e2e-cypress/tests/bugs/6158.js b/test/e2e-cypress/e2e/bugs/6158.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6158.js rename to test/e2e-cypress/e2e/bugs/6158.cy.js diff --git a/test/e2e-cypress/tests/bugs/6183.js b/test/e2e-cypress/e2e/bugs/6183.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6183.js rename to test/e2e-cypress/e2e/bugs/6183.cy.js diff --git a/test/e2e-cypress/tests/bugs/6276.js b/test/e2e-cypress/e2e/bugs/6276.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6276.js rename to test/e2e-cypress/e2e/bugs/6276.cy.js diff --git a/test/e2e-cypress/tests/bugs/6351.js b/test/e2e-cypress/e2e/bugs/6351.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6351.js rename to test/e2e-cypress/e2e/bugs/6351.cy.js diff --git a/test/e2e-cypress/tests/bugs/6369.js b/test/e2e-cypress/e2e/bugs/6369.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6369.js rename to test/e2e-cypress/e2e/bugs/6369.cy.js diff --git a/test/e2e-cypress/tests/bugs/6442.js b/test/e2e-cypress/e2e/bugs/6442.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6442.js rename to test/e2e-cypress/e2e/bugs/6442.cy.js diff --git a/test/e2e-cypress/tests/bugs/6475.js b/test/e2e-cypress/e2e/bugs/6475.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6475.js rename to test/e2e-cypress/e2e/bugs/6475.cy.js diff --git a/test/e2e-cypress/tests/bugs/6540.js b/test/e2e-cypress/e2e/bugs/6540.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6540.js rename to test/e2e-cypress/e2e/bugs/6540.cy.js diff --git a/test/e2e-cypress/tests/bugs/6627.js b/test/e2e-cypress/e2e/bugs/6627.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/6627.js rename to test/e2e-cypress/e2e/bugs/6627.cy.js diff --git a/test/e2e-cypress/tests/bugs/7996.js b/test/e2e-cypress/e2e/bugs/7996.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/7996.js rename to test/e2e-cypress/e2e/bugs/7996.cy.js diff --git a/test/e2e-cypress/tests/bugs/8217.js b/test/e2e-cypress/e2e/bugs/8217.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/8217.js rename to test/e2e-cypress/e2e/bugs/8217.cy.js diff --git a/test/e2e-cypress/tests/bugs/editor-1868.js b/test/e2e-cypress/e2e/bugs/editor-1868.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/editor-1868.js rename to test/e2e-cypress/e2e/bugs/editor-1868.cy.js diff --git a/test/e2e-cypress/tests/bugs/swos-63.js b/test/e2e-cypress/e2e/bugs/swos-63.cy.js similarity index 100% rename from test/e2e-cypress/tests/bugs/swos-63.js rename to test/e2e-cypress/e2e/bugs/swos-63.cy.js diff --git a/test/e2e-cypress/tests/features/auth-bearer-flow.js b/test/e2e-cypress/e2e/features/auth-bearer-flow.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/auth-bearer-flow.js rename to test/e2e-cypress/e2e/features/auth-bearer-flow.cy.js diff --git a/test/e2e-cypress/tests/features/auth-code-flow-pkce-without-secret.js b/test/e2e-cypress/e2e/features/auth-code-flow-pkce-without-secret.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/auth-code-flow-pkce-without-secret.js rename to test/e2e-cypress/e2e/features/auth-code-flow-pkce-without-secret.cy.js diff --git a/test/e2e-cypress/tests/features/deep-linking.js b/test/e2e-cypress/e2e/features/deep-linking.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/deep-linking.js rename to test/e2e-cypress/e2e/features/deep-linking.cy.js diff --git a/test/e2e-cypress/tests/features/dynamic-default-oauth.js b/test/e2e-cypress/e2e/features/dynamic-default-oauth.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/dynamic-default-oauth.js rename to test/e2e-cypress/e2e/features/dynamic-default-oauth.cy.js diff --git a/test/e2e-cypress/tests/features/external-docs.js b/test/e2e-cypress/e2e/features/external-docs.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/external-docs.js rename to test/e2e-cypress/e2e/features/external-docs.cy.js diff --git a/test/e2e-cypress/tests/features/info.js b/test/e2e-cypress/e2e/features/info.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/info.js rename to test/e2e-cypress/e2e/features/info.cy.js diff --git a/test/e2e-cypress/tests/features/license.js b/test/e2e-cypress/e2e/features/license.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/license.js rename to test/e2e-cypress/e2e/features/license.cy.js diff --git a/test/e2e-cypress/tests/features/model-collapse.js b/test/e2e-cypress/e2e/features/model-collapse.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/model-collapse.js rename to test/e2e-cypress/e2e/features/model-collapse.cy.js diff --git a/test/e2e-cypress/tests/features/multiple-examples-core.js b/test/e2e-cypress/e2e/features/multiple-examples-core.cy.js similarity index 98% rename from test/e2e-cypress/tests/features/multiple-examples-core.js rename to test/e2e-cypress/e2e/features/multiple-examples-core.cy.js index 15b4ebeb..8b63c8b5 100644 --- a/test/e2e-cypress/tests/features/multiple-examples-core.js +++ b/test/e2e-cypress/e2e/features/multiple-examples-core.cy.js @@ -1,12 +1,11 @@ /** * @prettier */ - const { ParameterPrimitiveTestCases, RequestBodyPrimitiveTestCases, ResponsePrimitiveTestCases, -} = require("../../helpers/multiple-examples") +} = require("../../support/helpers/multiple-examples") describe("OpenAPI 3.0 Multiple Examples - core features", () => { describe("/String", () => { describe("in a parameter", () => { @@ -607,7 +606,9 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => { }, }) it("should display an error message when input validation fails", () => { - cy.visit("/?url=/documents/features/multiple-examples-core.openapi.yaml") + cy.visit( + "/?url=/documents/features/multiple-examples-core.openapi.yaml" + ) // Expand the operation .get("#operations-default-post_Object") .click() @@ -615,7 +616,9 @@ describe("OpenAPI 3.0 Multiple Examples - core features", () => { .get(".try-out__btn") .click() // Set an invalid value - .get(".parameters-container > div > table > tbody > tr > td.parameters-col_description > div:nth-child(2) > textarea") + .get( + ".parameters-container > div > table > tbody > tr > td.parameters-col_description > div:nth-child(2) > textarea" + ) .type("{{{{ [[[[ <<<< invalid JSON here.") // Execute the operation .get(".execute") diff --git a/test/e2e-cypress/tests/features/oas3-badge.js b/test/e2e-cypress/e2e/features/oas3-badge.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-badge.js rename to test/e2e-cypress/e2e/features/oas3-badge.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-multiple-media-type.js b/test/e2e-cypress/e2e/features/oas3-multiple-media-type.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-multiple-media-type.js rename to test/e2e-cypress/e2e/features/oas3-multiple-media-type.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-multiple-servers.js b/test/e2e-cypress/e2e/features/oas3-multiple-servers.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-multiple-servers.js rename to test/e2e-cypress/e2e/features/oas3-multiple-servers.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-request-body-allow-empty-values.js b/test/e2e-cypress/e2e/features/oas3-request-body-allow-empty-values.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-request-body-allow-empty-values.js rename to test/e2e-cypress/e2e/features/oas3-request-body-allow-empty-values.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-request-body-default-views.js b/test/e2e-cypress/e2e/features/oas3-request-body-default-views.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-request-body-default-views.js rename to test/e2e-cypress/e2e/features/oas3-request-body-default-views.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-request-body-required.js b/test/e2e-cypress/e2e/features/oas3-request-body-required.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-request-body-required.js rename to test/e2e-cypress/e2e/features/oas3-request-body-required.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-user-edit-request-body-flows.js b/test/e2e-cypress/e2e/features/oas3-user-edit-request-body-flows.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-user-edit-request-body-flows.js rename to test/e2e-cypress/e2e/features/oas3-user-edit-request-body-flows.cy.js diff --git a/test/e2e-cypress/tests/features/oas3-xml.js b/test/e2e-cypress/e2e/features/oas3-xml.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/oas3-xml.js rename to test/e2e-cypress/e2e/features/oas3-xml.cy.js diff --git a/test/e2e-cypress/tests/features/oauth2-flows/application.js b/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js similarity index 93% rename from test/e2e-cypress/tests/features/oauth2-flows/application.js rename to test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js index 739cfc7a..41a66cae 100644 --- a/test/e2e-cypress/tests/features/oauth2-flows/application.js +++ b/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js @@ -1,10 +1,6 @@ describe("OAuth2 Application flow", function() { beforeEach(() => { - cy.server() - cy.route({ - url: "**/oauth/*", - method: "POST" - }).as("tokenRequest") + cy.intercept("POST", "**/oauth/*").as("tokenRequest") }) // https://github.com/swagger-api/swagger-ui/issues/6395 diff --git a/test/e2e-cypress/tests/features/oauth2-flows/password.js b/test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js similarity index 96% rename from test/e2e-cypress/tests/features/oauth2-flows/password.js rename to test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js index 872899a2..fb1ff54f 100644 --- a/test/e2e-cypress/tests/features/oauth2-flows/password.js +++ b/test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js @@ -1,10 +1,6 @@ describe("OAuth2 Password flow", function() { beforeEach(() => { - cy.server() - cy.route({ - url: "**/oauth/*", - method: "POST" - }).as("tokenRequest") + cy.intercept("POST", "**/oauth/*").as("tokenRequest") }) it("should make a password flow Authorization header request", () => { @@ -119,4 +115,4 @@ describe("OAuth2 Password flow", function() { .get(".live-responses-table .response-col_status") .contains("200") }) -}) \ No newline at end of file +}) diff --git a/test/e2e-cypress/tests/features/parameter-array-missing-items.js b/test/e2e-cypress/e2e/features/parameter-array-missing-items.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/parameter-array-missing-items.js rename to test/e2e-cypress/e2e/features/parameter-array-missing-items.cy.js diff --git a/test/e2e-cypress/tests/features/parameter-order.js b/test/e2e-cypress/e2e/features/parameter-order.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/parameter-order.js rename to test/e2e-cypress/e2e/features/parameter-order.cy.js diff --git a/test/e2e-cypress/tests/features/plugins/topbar/linking-to-configured-urls.js b/test/e2e-cypress/e2e/features/plugins/topbar/linking-to-configured-urls.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/plugins/topbar/linking-to-configured-urls.js rename to test/e2e-cypress/e2e/features/plugins/topbar/linking-to-configured-urls.cy.js diff --git a/test/e2e-cypress/tests/features/request-body-upload-file.js b/test/e2e-cypress/e2e/features/request-body-upload-file.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/request-body-upload-file.js rename to test/e2e-cypress/e2e/features/request-body-upload-file.cy.js diff --git a/test/e2e-cypress/tests/features/response-extension.js b/test/e2e-cypress/e2e/features/response-extension.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/response-extension.js rename to test/e2e-cypress/e2e/features/response-extension.cy.js diff --git a/test/e2e-cypress/tests/features/schema-form-enum-boolean.js b/test/e2e-cypress/e2e/features/schema-form-enum-boolean.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/schema-form-enum-boolean.js rename to test/e2e-cypress/e2e/features/schema-form-enum-boolean.cy.js diff --git a/test/e2e-cypress/tests/features/schema-form.js b/test/e2e-cypress/e2e/features/schema-form.cy.js similarity index 99% rename from test/e2e-cypress/tests/features/schema-form.js rename to test/e2e-cypress/e2e/features/schema-form.cy.js index b3e25983..0b8ff348 100644 --- a/test/e2e-cypress/tests/features/schema-form.js +++ b/test/e2e-cypress/e2e/features/schema-form.cy.js @@ -288,6 +288,7 @@ describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { .click() .get(".json-schema-form-item > input") .type("{selectall}spotted") + .blur() // Assert against the input fields .get(".json-schema-form-item > input") .then((inputs) => { @@ -308,6 +309,7 @@ describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { .click() .get(".json-schema-form-item:last-of-type > input") .type("{selectall}spotted") + .blur() // Assert against the input fields .get(".json-schema-form-item > input") .then((inputs) => { @@ -335,6 +337,7 @@ describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { .click() .get(".json-schema-form-item:last-of-type > input") .type("{selectall}spotted") + .blur() // Assert against the input fields .get(".json-schema-form-item > input") .then((inputs) => { @@ -431,6 +434,7 @@ describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { .click() .get(".json-schema-form-item > input") .type("{selectall}spotted") + .blur() // Assert against the input fields .get(".json-schema-form-item > input") .then((inputs) => { @@ -460,6 +464,7 @@ describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { .click() .get(".json-schema-form-item:last-of-type > input") .type("{selectall}spotted") + .blur() // Assert against the input fields .get(".json-schema-form-item > input") .then((inputs) => { diff --git a/test/e2e-cypress/tests/features/spec-parse-to-json.js b/test/e2e-cypress/e2e/features/spec-parse-to-json.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/spec-parse-to-json.js rename to test/e2e-cypress/e2e/features/spec-parse-to-json.cy.js diff --git a/test/e2e-cypress/tests/features/syntax-highlighting-json.js b/test/e2e-cypress/e2e/features/syntax-highlighting-json.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/syntax-highlighting-json.js rename to test/e2e-cypress/e2e/features/syntax-highlighting-json.cy.js diff --git a/test/e2e-cypress/tests/features/try-it-out-enabled.js b/test/e2e-cypress/e2e/features/try-it-out-enabled.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/try-it-out-enabled.js rename to test/e2e-cypress/e2e/features/try-it-out-enabled.cy.js diff --git a/test/e2e-cypress/tests/features/try-it-out-schema-required-override-allowed.js b/test/e2e-cypress/e2e/features/try-it-out-schema-required-override-allowed.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/try-it-out-schema-required-override-allowed.js rename to test/e2e-cypress/e2e/features/try-it-out-schema-required-override-allowed.cy.js diff --git a/test/e2e-cypress/tests/features/urls.js b/test/e2e-cypress/e2e/features/urls.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/urls.js rename to test/e2e-cypress/e2e/features/urls.cy.js diff --git a/test/e2e-cypress/tests/features/webhooks.js b/test/e2e-cypress/e2e/features/webhooks.cy.js similarity index 100% rename from test/e2e-cypress/tests/features/webhooks.js rename to test/e2e-cypress/e2e/features/webhooks.cy.js diff --git a/test/e2e-cypress/tests/security/anonymous.js b/test/e2e-cypress/e2e/security/anonymous.cy.js similarity index 100% rename from test/e2e-cypress/tests/security/anonymous.js rename to test/e2e-cypress/e2e/security/anonymous.cy.js diff --git a/test/e2e-cypress/tests/security/oauth2.js b/test/e2e-cypress/e2e/security/oauth2.cy.js similarity index 100% rename from test/e2e-cypress/tests/security/oauth2.js rename to test/e2e-cypress/e2e/security/oauth2.cy.js diff --git a/test/e2e-cypress/tests/security/sequential-import-chaining.js b/test/e2e-cypress/e2e/security/sequential-import-chaining.cy.js similarity index 100% rename from test/e2e-cypress/tests/security/sequential-import-chaining.js rename to test/e2e-cypress/e2e/security/sequential-import-chaining.cy.js diff --git a/test/e2e-cypress/plugins/index.js b/test/e2e-cypress/plugins/index.js deleted file mode 100644 index 852cfa69..00000000 --- a/test/e2e-cypress/plugins/index.js +++ /dev/null @@ -1,19 +0,0 @@ -const startOAuthServer = require("../helpers/oauth2-server") -// *********************************************************** -// This example plugins/index.js can be used to load plugins -// -// You can change the location of this file or turn off loading -// the plugins file with the 'pluginsFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/plugins-guide -// *********************************************************** - -// 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) => { - startOAuthServer() - // `on` is used to hook into various events Cypress emits - // `config` is the resolved Cypress config -} diff --git a/test/e2e-cypress/support/index.js b/test/e2e-cypress/support/e2e.js similarity index 100% rename from test/e2e-cypress/support/index.js rename to test/e2e-cypress/support/e2e.js diff --git a/test/e2e-cypress/helpers/multiple-examples.js b/test/e2e-cypress/support/helpers/multiple-examples.js similarity index 100% rename from test/e2e-cypress/helpers/multiple-examples.js rename to test/e2e-cypress/support/helpers/multiple-examples.js diff --git a/test/e2e-cypress/helpers/oauth2-server/index.js b/test/e2e-cypress/support/helpers/oauth2-server/index.js similarity index 100% rename from test/e2e-cypress/helpers/oauth2-server/index.js rename to test/e2e-cypress/support/helpers/oauth2-server/index.js diff --git a/test/e2e-cypress/helpers/oauth2-server/model.js b/test/e2e-cypress/support/helpers/oauth2-server/model.js similarity index 100% rename from test/e2e-cypress/helpers/oauth2-server/model.js rename to test/e2e-cypress/support/helpers/oauth2-server/model.js diff --git a/test/e2e-cypress/helpers/oauth2-server/swagger.yaml b/test/e2e-cypress/support/helpers/oauth2-server/swagger.yaml similarity index 100% rename from test/e2e-cypress/helpers/oauth2-server/swagger.yaml rename to test/e2e-cypress/support/helpers/oauth2-server/swagger.yaml