OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
API
/
swagger-ui-5.17.14
/
test
/
e2e-cypress
/
e2e
/
features
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
π
..
-
08/07/2024 04:34:14 AM
rwxr-xr-x
π
auth-bearer-flow.cy.js
1.31 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
auth-code-flow-pkce-without-secret.cy.js
1.48 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
deep-linking.cy.js
9.43 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
default-model-rendering.cy.js
1.31 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
dynamic-default-oauth.cy.js
1.32 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
external-docs.cy.js
3.9 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
info.cy.js
2.53 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
license.cy.js
3.55 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
model-collapse.cy.js
1.49 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
multiple-examples-core.cy.js
23.08 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
oas-badge.cy.js
866 bytes
08/07/2024 04:34:13 AM
rw-r--r--
π
oas3-callbacks.cy.js
535 bytes
08/07/2024 04:34:13 AM
rw-r--r--
π
oas3-multiple-media-type.cy.js
6.25 KB
08/07/2024 04:34:13 AM
rw-r--r--
π
oas3-multiple-servers.cy.js
2.6 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
oas3-request-body-allow-empty-values.cy.js
6.57 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
oas3-request-body-default-views.cy.js
542 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
oas3-request-body-required.cy.js
9.7 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
oas3-user-edit-request-body-flows.cy.js
3.95 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
oas3-xml.cy.js
3.14 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
oas31-auth-mutual-tls.cy.js
799 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
oauth2-flows
-
08/07/2024 04:34:38 AM
rwxr-xr-x
π
parameter-array-missing-items.cy.js
429 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
parameter-order.cy.js
1 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
parameters-one-of-any-of.cy.js
1.36 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
plugins
-
08/07/2024 04:35:02 AM
rwxr-xr-x
π
request-body-upload-file.cy.js
4.99 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
response-empty-examples-object.cy.js
434 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
response-extension.cy.js
1.89 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
schema-form-enum-boolean.cy.js
4.2 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
schema-form.cy.js
31.3 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
spec-parse-to-json.cy.js
1.14 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
syntax-highlighting-json.cy.js
1.81 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
try-it-out-enabled.cy.js
675 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
try-it-out-non-200-response-body.cy.js
795 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
try-it-out-schema-required-override-allowed.cy.js
551 bytes
08/07/2024 04:34:14 AM
rw-r--r--
π
urls.cy.js
3.65 KB
08/07/2024 04:34:14 AM
rw-r--r--
π
webhooks.cy.js
842 bytes
08/07/2024 04:34:14 AM
rw-r--r--
Editing: deep-linking.cy.js
Close
describe("Deep linking feature", () => { describe("in Swagger 2", () => { const swagger2BaseUrl = "/?deepLinking=true&url=/documents/features/deep-linking.swagger.yaml" describe("regular Operation", () => { OperationDeeplinkTestFactory({ baseUrl: swagger2BaseUrl, elementToGet: ".opblock-get", correctElementId: "operations-myTag-myOperation", correctFragment: "#/myTag/myOperation", correctHref: "#/myTag/myOperation" }) }) describe("Operation with whitespace in tag+id", () => { const elementToGet = ".opblock-post" const correctFragment = "#/my%20Tag/my%20Operation" OperationDeeplinkTestFactory({ baseUrl: swagger2BaseUrl, elementToGet, correctElementId: "operations-my_Tag-my_Operation", correctFragment, correctHref: "#/my%20Tag/my%20Operation" }) const legacyFragment = "#/my_Tag/my_Operation" it("should expand the operation when reloaded and provided the legacy fragment", () => { cy.visit(`${swagger2BaseUrl}${legacyFragment}`) .reload() .get(`${elementToGet}.is-open`) .should("exist") }) it.skip("should rewrite to the correct fragment when provided the legacy fragment", () => { cy.visit(`${swagger2BaseUrl}${legacyFragment}`) .reload() .window() .should("have.deep.property", "location.hash", correctFragment) }) }) describe("Operation with underscores in tag+id", () => { OperationDeeplinkTestFactory({ baseUrl: swagger2BaseUrl, elementToGet: ".opblock-patch", correctElementId: "operations-underscore_Tag-underscore_Operation", correctFragment: "#/underscore_Tag/underscore_Operation", correctHref: "#/underscore_Tag/underscore_Operation" }) }) describe("Operation with UTF-16 characters", () => { OperationDeeplinkTestFactory({ baseUrl: swagger2BaseUrl, elementToGet: ".opblock-head", correctElementId: "operations-ΡΠ΅Π»Π»Ρ-ΠΏΠΎΡΠ΅Π»", correctFragment: "#/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B/%D0%BF%D0%BE%D1%88%D0%B5%D0%BB", correctHref: "#/ΡΠ΅Π»Π»Ρ/ΠΏΠΎΡΠ΅Π»" }) }) describe("Operation with no operationId", () => { OperationDeeplinkTestFactory({ baseUrl: swagger2BaseUrl, elementToGet: ".opblock-put", correctElementId: "operations-tagTwo-put_noOperationId", correctFragment: "#/tagTwo/put_noOperationId", correctHref: "#/tagTwo/put_noOperationId" }) }) describe("regular Tag", () => { TagDeeplinkTestFactory({ isTagCase: true, baseUrl: swagger2BaseUrl, elementToGet: `.opblock-tag[data-tag="myTag"][data-is-open="true"]`, correctElementId: "operations-tag-myTag", correctFragment: "#/myTag", correctHref: "#/myTag" }) }) describe("Tag with whitespace", () => { TagDeeplinkTestFactory({ isTagCase: true, baseUrl: swagger2BaseUrl, elementToGet: `.opblock-tag[data-tag="my Tag"][data-is-open="true"]`, correctElementId: "operations-tag-my_Tag", correctFragment: "#/my%20Tag", correctHref: "#/my%20Tag" }) }) }) describe("in OpenAPI 3", () => { const openAPI3BaseUrl = "/?deepLinking=true&url=/documents/features/deep-linking.openapi.yaml" describe("regular Operation", () => { OperationDeeplinkTestFactory({ baseUrl: openAPI3BaseUrl, elementToGet: ".opblock-get", correctElementId: "operations-myTag-myOperation", correctFragment: "#/myTag/myOperation", correctHref: "#/myTag/myOperation" }) }) describe("Operation with whitespace in tag+id", () => { const elementToGet = ".opblock-post" const correctFragment = "#/my%20Tag/my%20Operation" OperationDeeplinkTestFactory({ baseUrl: openAPI3BaseUrl, elementToGet: ".opblock-post", correctElementId: "operations-my_Tag-my_Operation", correctFragment, correctHref: "#/my%20Tag/my%20Operation" }) const legacyFragment = "#/my_Tag/my_Operation" it("should expand the operation when reloaded and provided the legacy fragment", () => { cy.visit(`${openAPI3BaseUrl}${legacyFragment}`) .reload() .get(`${elementToGet}.is-open`) .should("exist") }) it.skip("should rewrite to the correct fragment when provided the legacy fragment", () => { cy.visit(`${openAPI3BaseUrl}${legacyFragment}`) .reload() .window() .should("have.deep.property", "location.hash", correctFragment) }) }) describe("Operation with underscores in tag+id", () => { OperationDeeplinkTestFactory({ baseUrl: openAPI3BaseUrl, elementToGet: ".opblock-patch", correctElementId: "operations-underscore_Tag-underscore_Operation", correctFragment: "#/underscore_Tag/underscore_Operation", correctHref: "#/underscore_Tag/underscore_Operation" }) }) describe("Operation with UTF-16 characters", () => { OperationDeeplinkTestFactory({ baseUrl: openAPI3BaseUrl, elementToGet: ".opblock-head", correctElementId: "operations-ΡΠ΅Π»Π»Ρ-ΠΏΠΎΡΠ΅Π»", correctFragment: "#/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B/%D0%BF%D0%BE%D1%88%D0%B5%D0%BB", correctHref: "#/ΡΠ΅Π»Π»Ρ/ΠΏΠΎΡΠ΅Π»" }) }) describe("Operation with no operationId", () => { OperationDeeplinkTestFactory({ baseUrl: openAPI3BaseUrl, elementToGet: ".opblock-put", correctElementId: "operations-tagTwo-put_noOperationId", correctFragment: "#/tagTwo/put_noOperationId", correctHref: "#/tagTwo/put_noOperationId" }) }) describe("regular Tag", () => { TagDeeplinkTestFactory({ isTagCase: true, baseUrl: openAPI3BaseUrl, elementToGet: `.opblock-tag[data-tag="myTag"][data-is-open="true"]`, correctElementId: "operations-tag-myTag", correctFragment: "#/myTag", correctHref: "#/myTag" }) }) describe("Tag with whitespace", () => { TagDeeplinkTestFactory({ isTagCase: true, baseUrl: openAPI3BaseUrl, elementToGet: `.opblock-tag[data-tag="my Tag"][data-is-open="true"]`, correctElementId: "operations-tag-my_Tag", correctFragment: "#/my%20Tag", correctHref: "#/my%20Tag" }) }) }) }) function OperationDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref }) { it("should generate a correct element ID", () => { cy.visit(baseUrl) .get(elementToGet) .should("have.id", correctElementId) }) it("should add the correct element fragment to the URL when expanded", () => { cy.visit(baseUrl) .get(elementToGet) .click() cy.location().should((loc) => { expect(loc.hash).to.eq(correctFragment) }) }) it("should provide an anchor link that has the correct fragment as href", () => { cy.visit(baseUrl) .get(elementToGet) .find("a") .should("have.attr", "href", correctHref) .click() cy.location().should((loc) => { expect(loc.hash).to.eq(correctFragment) }) }) it("should expand the operation when reloaded", () => { cy.visit(`${baseUrl}${correctFragment}`) .get(`${elementToGet}.is-open`) .should("exist") }) it("should retain the correct fragment when reloaded", () => { cy.visit(`${baseUrl}${correctFragment}`) .reload() .should("exist") cy.location().should((loc) => { expect(loc.hash).to.eq(correctFragment) }) }) it("should expand a tag with docExpansion disabled", () => { cy.visit(`${baseUrl}&docExpansion=none${correctFragment}`) .get(`.opblock-tag-section.is-open`) .should("have.length", 1) }) it("should expand an operation with docExpansion disabled", () => { cy.visit(`${baseUrl}&docExpansion=none${correctFragment}`) .get(`.opblock.is-open`) .should("have.length", 1) }) } function TagDeeplinkTestFactory({ baseUrl, elementToGet, correctElementId, correctFragment, correctHref, isTagCase = false }) { it("should generate a correct element ID", () => { cy.visit(baseUrl) .get(elementToGet) .should("have.id", correctElementId) }) it("should add the correct element fragment to the URL when expanded", () => { cy.visit(baseUrl) .get(elementToGet) .click() .click() // tags need two clicks because they're expanded by default cy.location().should((loc) => { expect(loc.hash).to.eq(correctFragment) }) }) it("should provide an anchor link that has the correct fragment as href", () => { cy.visit(baseUrl) .get(elementToGet) .find("a") .should("have.attr", "href", correctHref) }) it("should expand the tag when reloaded", () => { cy.visit(`${baseUrl}${correctFragment}`) .get(`${elementToGet}[data-is-open="true"]`) .should("exist") }) it("should retain the correct fragment when reloaded", () => { cy.visit(`${baseUrl}${correctFragment}`) .reload() .should("exist") cy.location().should((loc) => { expect(loc.hash).to.eq(correctFragment) }) }) it("should expand a tag with docExpansion disabled", () => { cy.visit(`${baseUrl}&docExpansion=none${correctFragment}`) .get(`.opblock-tag-section.is-open`) .should("have.length", 1) }) }