Files
swagger-ui/test/e2e-cypress/e2e/bugs/6158.cy.js
Vladimír Gorej 3e81a4f897 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.
2023-06-07 10:25:32 +02:00

55 lines
1.8 KiB
JavaScript

describe("#6158: read-only property is not hidden in `POST/PUT`", () => {
describe("POST", () => {
it("should hide property 'id'", () => {
cy.visit("/?url=/documents/bugs/6158.yaml")
.get("#operations-User-post_users")
.click()
.get(".parameters[data-property-name='id']")
.should("not.exist")
.get(".parameters[data-property-name='name']")
.should("exist")
})
it("should hide property 'id' when trying it out", () => {
cy.visit("/?url=/documents/bugs/6158.yaml")
.get("#operations-User-post_users")
.click()
.get(".try-out__btn")
.click()
.get(".parameters[data-property-name='id']")
.should("not.exist")
.get("input[placeholder='id']")
.should("not.exist")
.get(".parameters[data-property-name='name']")
.should("exist")
.get("input[placeholder='name']")
.should("exist")
})
})
describe("PUT", () => {
it("should hide property 'id'", () => {
cy.visit("/?url=/documents/bugs/6158.yaml")
.get("#operations-User-put_users")
.click()
.get(".parameters[data-property-name='id']")
.should("not.exist")
.get(".parameters[data-property-name='name']")
.should("exist")
})
it("should hide property 'id' when trying it out", () => {
cy.visit("/?url=/documents/bugs/6158.yaml")
.get("#operations-User-put_users")
.click()
.get(".try-out__btn")
.click()
.get(".parameters[data-property-name='id']")
.should("not.exist")
.get("input[placeholder='id']")
.should("not.exist")
.get(".parameters[data-property-name='name']")
.should("exist")
.get("input[placeholder='name']")
.should("exist")
})
})
})