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:
Vladimír Gorej
2023-06-07 10:25:32 +02:00
committed by GitHub
parent f30d89af1b
commit 3e81a4f897
80 changed files with 68 additions and 83 deletions

View File

@@ -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", () => {

View File

@@ -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")

View File

@@ -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

View File

@@ -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")
})
})
})

View File

@@ -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) => {

View File

@@ -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
}