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

@@ -0,0 +1,49 @@
describe("Response extension feature", () => {
describe("in Swagger 2", () => {
const swagger2BaseUrl = "/?showExtensions=true&docExpansion=full&url=/documents/features/response-extension.swagger.yaml"
describe("without x- values", () => {
it("should omit response extensions section", () => {
cy.visit(swagger2BaseUrl)
.get("tr.response[data-code='200'] td.response-col_description div.response__extension")
.should("not.exist")
})
})
describe("with x- values", () => {
it("should list each value", () => {
const page = cy.visit(swagger2BaseUrl)
page.get("tr.response[data-code='404'] td.response-col_description div.response__extension:nth-child(2)")
.should("have.text", "x-error: true")
page.get("tr.response[data-code='404'] td.response-col_description div.response__extension:nth-child(3)")
.should("have.text", "x-error-codes: List [ \"NOT_FOUND\" ]")
})
})
})
describe("in OpenAPI 3", () => {
const openAPI3BaseUrl = "/?showExtensions=true&docExpansion=full&url=/documents/features/response-extension.openapi.yaml"
describe("without x- values", () => {
it("should omit response extensions section", () => {
cy.visit(openAPI3BaseUrl)
.get("tr.response[data-code='200'] td.response-col_description div.response__extension")
.should("not.exist")
})
})
describe("with x- values", () => {
it("should list each value", () => {
const page = cy.visit(openAPI3BaseUrl)
page.get("tr.response[data-code='404'] td.response-col_description div.response__extension:nth-child(2)")
.should("have.text", "x-error: true")
page.get("tr.response[data-code='404'] td.response-col_description div.response__extension:nth-child(3)")
.should("have.text", "x-error-codes: List [ \"NOT_FOUND\" ]")
})
})
})
})