chore(deps-dev): update cypress to v12 (#8889)
This update required changing the configuration and test directory structure. Some tests needed to be amended as well to compensate for new Cypress APIs.
This commit is contained in:
4
.github/workflows/nodejs.yml
vendored
4
.github/workflows/nodejs.yml
vendored
@@ -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 }}"'
|
||||
|
||||
19
cypress.config.js
Normal file
19
cypress.config.js
Normal file
@@ -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()
|
||||
},
|
||||
},
|
||||
})
|
||||
11
cypress.json
11
cypress.json
@@ -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
|
||||
}
|
||||
56
package-lock.json
generated
56
package-lock.json
generated
@@ -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": {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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", () => {
|
||||
@@ -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")
|
||||
@@ -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
|
||||
@@ -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")
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -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) => {
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user