未验证 提交 b4f18863 编写于 作者: K kyle 提交者: GitHub

meta: supplemental tests for #4537 (via #4828)

* `test/e2e` -> `test/e2e-selenium`

* add Cypress

* ESLint fixes

* MOAR cypress

* `integration` -> `tests`

* wire Cypress up to a hot e2e server

* add failing tests for #4537

* Update package.json
上级 1b2fbda6
openapi: "3.0.0"
paths:
/:
get:
operationId: "myOperation"
tags: ["myTag"]
summary: an operation
responses:
'200':
description: a pet to be returned
content:
application/json:
schema:
type: object
/withSpaces:
post:
operationId: "my Operation"
tags: ["my Tag"]
summary: an operation
responses:
'200':
description: a pet to be returned
content:
application/json:
schema:
type: object
\ No newline at end of file
swagger: "2.0"
\ No newline at end of file
swagger: "2.0"
paths:
/:
get:
operationId: "myOperation"
tags: ["myTag"]
summary: an operation
responses:
"200":
description: ok
/withSpaces:
post:
operationId: "my Operation"
tags: ["my Tag"]
summary: an operation
responses:
"200":
description: ok
describe("The Home Page", function () {
it("successfully loads", function () {
cy.visit("/")
describe("Deep linking feature", () => {
describe("in Swagger 2", () => {
beforeEach(() => {
cy.visit("/?deepLinking=true&url=/documents/features/deep-linking.swagger.yaml")
})
it("should generate an element ID and URL fragment for an operation", () => {
cy.get(".opblock-get")
.should("exist")
.should("have.id", "operations-myTag-myOperation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/myTag/myOperation")
})
it("should generate an element ID and URL fragment for an operation with spaces", () => {
cy.get(".opblock-post")
.should("exist")
.should("have.id", "operations-my_Tag-my_Operation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/my%20Tag/my%20Operation")
})
})
describe("in OpenAPI 3", () => {
beforeEach(() => {
cy.visit("/?deepLinking=true&url=/documents/features/deep-linking.openapi.yaml")
})
it("should generate an element ID and URL fragment for an operation", () => {
cy.get(".opblock-get")
.should("exist")
.should("have.id", "operations-myTag-myOperation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/myTag/myOperation")
})
it("should generate an element ID and URL fragment for an operation with spaces", () => {
cy.get(".opblock-post")
.should("exist")
.should("have.id", "operations-my_Tag-my_Operation")
.click()
.window()
.should("have.deep.property", "location.hash", "#/my%20Tag/my%20Operation")
})
})
})
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册