diff --git a/.claude/SKILL_USAGE_EXAMPLE.md b/.claude/SKILL_USAGE_EXAMPLE.md index af1b863b5db..a106a9c3250 100644 --- a/.claude/SKILL_USAGE_EXAMPLE.md +++ b/.claude/SKILL_USAGE_EXAMPLE.md @@ -298,22 +298,24 @@ describe("oas40 plugin - fn - isOAS40", () => { }) ``` -#### E2E Test (test/e2e-cypress/e2e/features/oas40/workflows.cy.js) +#### E2E Test (test/e2e-playwright/features/oas40/workflows.spec.ts) ```javascript /** * @prettier */ -describe("OpenAPI 4.0 - Workflows", () => { - it("should render workflows section", () => { - cy.visit("/e2e-cypress/static/documents/oas40/petstore-workflows.yaml") - cy.get(".opblock-tag").contains("Workflows").should("exist") +import { test, expect } from "../../support/fixtures" + +test.describe("OpenAPI 4.0 - Workflows", () => { + test("should render workflows section", async ({ page }) => { + await page.goto("/?url=/documents/oas40/petstore-workflows.yaml") + await expect(page.locator(".opblock-tag")).toContainText("Workflows") }) - it("should display workflow definitions", () => { - cy.visit("/e2e-cypress/static/documents/oas40/petstore-workflows.yaml") - cy.get(".opblock-workflow").should("have.length.greaterThan", 0) + test("should display workflow definitions", async ({ page }) => { + await page.goto("/?url=/documents/oas40/petstore-workflows.yaml") + await expect(page.locator(".opblock-workflow").first()).toBeAttached() }) }) ``` @@ -359,7 +361,7 @@ npm run build npm run test:artifact # E2E tests -npm run cy:ci +npm run e2e ``` ### 9. Claude Creates Commit @@ -368,7 +370,7 @@ npm run cy:ci git add src/core/plugins/oas40/ git add src/core/presets/apis/index.js git add test/unit/core/plugins/oas40/ -git add test/e2e-cypress/e2e/features/oas40/ +git add test/e2e-playwright/features/oas40/ git add README.md CLAUDE.md git commit -m "$(cat <<'EOF' @@ -425,9 +427,9 @@ test/unit/core/plugins/oas40/ └── components/ └── version-pragma-filter.jsx (45 lines) -test/e2e-cypress/e2e/features/oas40/ -├── workflows.cy.js (34 lines) -└── async-api-auth.cy.js (28 lines) +test/e2e-playwright/features/oas40/ +├── workflows.spec.ts (34 lines) +└── async-api-auth.spec.ts (28 lines) ``` **Total:** ~1,367 lines of code, fully tested and documented. diff --git a/.claude/implementation/perf-virtualization/README.md b/.claude/implementation/perf-virtualization/README.md index bdde3a8598a..80b913fc61b 100644 --- a/.claude/implementation/perf-virtualization/README.md +++ b/.claude/implementation/perf-virtualization/README.md @@ -119,9 +119,9 @@ These ACs move out of the individual phase tickets, because they are only meanin integrated result: - [ ] `npm run deps-size` before/after for the whole train (`@tanstack/react-virtual`, ~5KB min+gzip) -- [ ] `swagger-ui-react` smoke-tested — separately published, not covered by Cypress +- [ ] `swagger-ui-react` smoke-tested — separately published, not covered by Playwright - [ ] Combined React Profiler benchmark, all phases active, against the perf fixtures -- [ ] Full `npm test` (lint + unit + Cypress) green on the integration branch +- [ ] Full `npm test` (lint + unit + Playwright) green on the integration branch - [ ] `npm run test:artifact` passes - [ ] Release note drafted covering the above-threshold behavior changes (find-in-page, print, DOM) - [ ] Threshold constants confirmed against a real profile, or accepted as-is (100 / 150) @@ -149,7 +149,7 @@ Verify with `npm run deps-size` after adding. ## Test Fixtures (created 2026-08-04) ``` -test/e2e-cypress/static/documents/perf/ +test/e2e-playwright/static/documents/perf/ ├── many-schemas.swagger.yaml 240 definitions ← Phase 1 (Swagger 2.0) ├── many-schemas.openapi.yaml 240 components/schemas ← Phase 1 (OAS 3.0.0) ├── many-schemas.openapi31.yaml 240 components/schemas ← Phase 2 (OAS 3.1.0 → oas31 component) @@ -193,7 +193,7 @@ export const VIRTUALIZE_OPERATIONS_THRESHOLD = 150 // Phase 3 (counted on flatI - **No public API break.** `OperationTag` keeps accepting `children`; `.opblock-tag-section`, `.operation-tag-content` and `.model-container` nesting all survive on the legacy path. -- **Every existing Cypress and Selenium test keeps passing untouched**, because every current +- **Every existing Playwright and Selenium test keeps passing untouched**, because every current fixture is far below either threshold: `features/models.swagger.yaml` has **3** definitions, `features/deep-linking.swagger.yaml` **5** operations, `oas32/component-only.yaml` **0** paths. - Find-in-page / print loss applies **only** to specs above the threshold — where the content was diff --git a/.claude/implementation/perf-virtualization/phase-1-models-virtualization.md b/.claude/implementation/perf-virtualization/phase-1-models-virtualization.md index 152486afa36..08f8edb312a 100644 --- a/.claude/implementation/perf-virtualization/phase-1-models-virtualization.md +++ b/.claude/implementation/perf-virtualization/phase-1-models-virtualization.md @@ -38,18 +38,18 @@ order-of-magnitude improvement. - `test/unit/core/plugins/json-schema-5/components/models.jsx` (existing test file — update; currently uses Enzyme `shallow`, which will not survive the hook conversion) - `test/unit/jest-shim.js` (add a `ResizeObserver` polyfill — see "Unit-test infrastructure") - - `test/e2e-cypress/static/documents/` (new large-schema fixture, see below) - - `test/e2e-cypress/e2e/features/` (new spec) + - `test/e2e-playwright/static/documents/` (new large-schema fixture, see below) + - `test/e2e-playwright/features/` (new spec) - `test/e2e-selenium/pages/main.js:506-539` — holds **all 12 `.model-container` references under `test/`**. (Production code has its own ~10 refs; those are covered by the CSS audit below.) These are **positional descendant selectors** — e.g. `section.models div.model-container:nth-child(2)` — so wrapping each model in its own virtual item div makes every `.model-container` a `:nth-child(1)`, and every `:nth-child(2..6)` selector matches nothing. They are **definitely broken by this change, not merely affected.** Mitigating - factor only: there are **zero** Cypress references to that class and the Selenium suite is not - run in CI (`.github/workflows/nodejs.yml` runs Cypress only), so this does not turn CI red — - fix or delete them deliberately rather than discovering it later. The Cypress-side exposure is - the `#model-` id selectors instead — covered by the `model-collapse.cy.js` AC above. + factor only: there are **zero** Playwright references to that class and the Selenium suite is not + run in CI (`.github/workflows/nodejs.yml` runs Playwright only), so this does not turn CI red — + fix or delete them deliberately rather than discovering it later. The Playwright-side exposure is + the `#model-` id selectors instead — covered by the `model-collapse.spec.ts` AC above. - New dependency: `@tanstack/react-virtual` (~5KB min+gzip) - **Dominant unknown when sizing this:** the `Collapse`-unmount / measurement-cache interaction. (The deep-link bridge was ruled out once model deep-linking was found not to exist; the threshold @@ -58,13 +58,13 @@ order-of-magnitude improvement. ### Test fixtures (CREATED — committed 2026-08-04) Both variants exist, because `models.jsx` branches on `isOAS3()` for the base path -(`getSchemaBasePath()`, lines 17–20) and `model-collapse.cy.js` runs its scenarios twice (Swagger 2 +(`getSchemaBasePath()`, lines 17–20) and `model-collapse.spec.ts` runs its scenarios twice (Swagger 2 at `:2-6`, OpenAPI 3 at `:7-10`): | Fixture | Schemas | Notes | |---|---|---| -| `test/e2e-cypress/static/documents/perf/many-schemas.swagger.yaml` | 240 `definitions` | Swagger 2.0 | -| `test/e2e-cypress/static/documents/perf/many-schemas.openapi.yaml` | 240 `components/schemas` | `openapi: 3.0.0` | +| `test/e2e-playwright/static/documents/perf/many-schemas.swagger.yaml` | 240 `definitions` | Swagger 2.0 | +| `test/e2e-playwright/static/documents/perf/many-schemas.openapi.yaml` | 240 `components/schemas` | `openapi: 3.0.0` | 240 is deliberately well above the 100 threshold, so the virtualized path is unambiguously exercised. Both are generated files with a regenerate-don't-hand-edit header; both parse and each @@ -77,13 +77,13 @@ component renders instead of this one. ## Acceptance Criteria - [x] A spec **below** the 100-schema threshold renders today's markup unchanged (legacy path) — - verify `model-collapse.cy.js` passes with no edits + verify `model-collapse.spec.ts` passes with no edits - [x] A spec **above** the threshold uses the windowed path, and only visible models in the viewport are mounted (verify in React DevTools) - [x] Boundary tested both sides — one fixture just under the threshold, one just over - [x] Scrolling through the models list renders/unmounts items correctly - [x] Collapsing and expanding the "Schemas/Models" section works as before -- [x] Existing `model-collapse.cy.js` scenarios still pass **with no edits** — its fixtures have 3 +- [x] Existing `model-collapse.spec.ts` scenarios still pass **with no edits** — its fixtures have 3 definitions each, so they take the legacy path. If any of its selectors needed changing (`.models h4 .models-control`, `#model-User .model-box .model-box-control` at `:40`/`:44`, `#model-Pet` / `#model-Order` at `:18`/`:28`/`:34`), that means the legacy path was altered — @@ -102,7 +102,7 @@ component renders instead of this one. adds ~5KB min+gzip. Flag it in the PR if the measured delta is materially larger - [x] `swagger-ui-react` still renders models correctly — the flavor re-exports core, so it inherits this change with no code edit, but it is a separately published package and is not - covered by the Cypress suite + covered by the Playwright suite - [x] E2E test: models section scrolls and renders correctly with the new fixture - [x] `#model-` browser-anchor navigation still works below the threshold, and its above-threshold breakage is accepted per @@ -143,7 +143,7 @@ The virtual wrapper is an **extra** div around today's markup, not a replacement `.model-container` must be reproduced verbatim — all of it is test or embedder surface: - `id={`model-${name}`}` (`models.jsx:117`) — the anchor and the handle every - `model-collapse.cy.js` assertion uses. + `model-collapse.spec.ts` assertion uses. - `className="model-container"` (`:117`) — 12 references across `test/`. - `data-name={name}` (`:118`) — read back by `onLoadModel` via `ref.getAttribute("data-name")` (`:42`), so dropping it breaks that callback even though the callback is otherwise dead. @@ -314,7 +314,7 @@ But `scrollToKey` can never hold a schema path: So `["definitions", "Pet"]` never matches, and `#/definitions/SomeModel` is not a recognized hash form. `docs/usage/deep-linking.md` documents no model/schema syntax. -Corroborating evidence: `test/e2e-cypress/e2e/features/model-collapse.cy.js:4` does define +Corroborating evidence: `test/e2e-playwright/features/model-collapse.spec.ts:4` does define `const urlFragment = "#/definitions/Pet"` and pass it as a second argument — but the receiving function signature is `function ModelCollapseTest(baseUrl)` (`:13`), a single parameter, so the fragment is silently discarded and no test ever visits it. Even the one reference in the repo is @@ -361,7 +361,7 @@ Pick a strategy and state it in the PR: non-zero height, which jsdom does not provide by default — heights are all 0, so the virtualizer may window nothing); **or** - mock `@tanstack/react-virtual` in the unit test so `useVirtualizer` returns a deterministic fake - (fixed `getVirtualItems()`, no-op `measureElement`), and cover real windowing in Cypress only. + (fixed `getVirtualItems()`, no-op `measureElement`), and cover real windowing in Playwright only. The second option is recommended: it keeps the unit test asserting *this component's* logic (the config gates, `requestResolvedSubtree` dispatch, key/DOM contract) and leaves genuine scroll @@ -415,7 +415,7 @@ This is the most consequential instruction in the ticket, because it inverts mos contract items and the CSS audit below apply to the *virtualized* branch only; the legacy branch preserves them by construction. - **Every existing test keeps passing untouched.** `features/models.swagger.yaml` has **3** - definitions and `features/models.openapi.yaml` likewise, so `model-collapse.cy.js` and the + definitions and `features/models.openapi.yaml` likewise, so `model-collapse.spec.ts` and the Selenium `:nth-child` selectors in `main.js:506-539` all take the legacy path and are unaffected. That removes them from this ticket's risk surface entirely. - **The virtualized path has zero existing coverage.** The new perf fixtures are its *only* E2E @@ -436,7 +436,7 @@ unconditionally, *before* the threshold branch — you cannot put the early retu | Config gates lost in class→functional conversion (`defaultModelsExpandDepth < 0` early return at `:51`, `> 0 && isShown` expansion gate at `:131`) | Unit-test both boundaries explicitly; they are easy to drop when the render body is restructured | | `Collapse` unmounting `.models-scroll` destroys the scroll element and measurement cache on every section toggle | Decide the persistence strategy up front (see constraints); explicit test: expand section, scroll, collapse, re-expand | | `getScrollParent` now resolves to `.models-scroll` instead of `window`, changing scroll behavior | Pass an explicit `container` to `scrollToElement`; E2E-verify the section scrolls into view too | -| ~~E2E selectors break on DOM restructure~~ — **neutralized by the count threshold.** All existing fixtures are ≤3 definitions, so every current Cypress and Selenium selector runs the legacy path | None. Do not "clean up" the legacy markup while converting — that is what would reintroduce this | +| ~~E2E selectors break on DOM restructure~~ — **neutralized by the count threshold.** All existing fixtures are ≤3 definitions, so every current Playwright and Selenium selector runs the legacy path | None. Do not "clean up" the legacy markup while converting — that is what would reintroduce this | | **Virtualized path ships untested** because every existing fixture is below threshold | The new perf fixtures are its only coverage and must exceed 100 definitions; add a just-under/just-over boundary pair | | Two render paths diverge over time — a fix applied to one branch only | Keep the legacy branch as a thin extraction of today's JSX, not a parallel reimplementation; unit-test both branches | | Find-in-page / print regression (see above) | Maintainer decision on threshold or flag | diff --git a/.claude/implementation/perf-virtualization/phase-2-oas31-models.md b/.claude/implementation/perf-virtualization/phase-2-oas31-models.md index ac67e7b5c68..3928ebcc474 100644 --- a/.claude/implementation/perf-virtualization/phase-2-oas31-models.md +++ b/.claude/implementation/perf-virtualization/phase-2-oas31-models.md @@ -23,7 +23,7 @@ Do not start before Phase 1; the pattern is expected to shift during its review. - `src/core/plugins/oas31/components/models/_models.scss` (the `.models-scroll` rule — **this plugin has its own stylesheet**, Phase 1's edit to `src/style/_models.scss` does not cover it) - New unit test (none exists for this component today) -- E2E: reuse `test/e2e-cypress/static/documents/perf/many-schemas.openapi.yaml` — but see the +- E2E: reuse `test/e2e-playwright/static/documents/perf/many-schemas.openapi.yaml` — but see the OAS-version note below ### Fixture caveat diff --git a/.claude/implementation/perf-virtualization/phase-3-operations-virtualization.md b/.claude/implementation/perf-virtualization/phase-3-operations-virtualization.md index c455544b1fd..7a0698994bd 100644 --- a/.claude/implementation/perf-virtualization/phase-3-operations-virtualization.md +++ b/.claude/implementation/perf-virtualization/phase-3-operations-virtualization.md @@ -62,7 +62,7 @@ The timings above are impressionistic. **Record a real baseline before starting* new directory**; existing unit tests live under `test/unit/core/plugins/`, `system/`, `config/`, `helpers/`. No `testMatch` change needed — `config/jest/jest.unit.config.js:6-9` globs `**/test/unit/**/*.js?(x)`, so the new path is picked up automatically) - - `test/e2e-cypress/static/documents/perf/many-operations.yaml` — **already created and committed + - `test/e2e-playwright/static/documents/perf/many-operations.yaml` — **already created and committed (2026-08-04)**: 529 operations across 24 tags, `flatItems` ≈ 554 fully expanded, comfortably above the 150 threshold. Includes `operationId: multiTagged` at `/perf/multi-tagged` declaring **two** tags (`perfTag01`, `perfTag02`) — the duplicate-key case for `getItemKey`. Generated @@ -72,7 +72,7 @@ The timings above are impressionistic. **Record a real baseline before starting* ## Acceptance Criteria - [ ] A spec **below** the 150-item threshold renders today's nested markup unchanged — the legacy - regression contract: `deep-linking.cy.js`, `oas32-component-only.cy.js` and the Selenium + regression contract: `deep-linking.spec.ts`, `oas32-component-only.spec.ts` and the Selenium scenarios all pass **with no edits** - [ ] A spec **above** the threshold uses the windowed path; only operations within the viewport are mounted (verify in React DevTools) @@ -496,8 +496,8 @@ header-only: So this is a "reproduce `flex-direction: column` on the virtual wrapper" job, not a CSS refactor. Confirm with `grep -rn "opblock-tag-section\|operation-tag-content" src/style/`. - **The real fallout is in tests, not styles.** `test/` references these class names in ~14 - places — `test/e2e-cypress/e2e/features/deep-linking.cy.js` (×2), - `test/e2e-cypress/e2e/features/oas32/oas32-component-only.cy.js`, and ~9 + places — `test/e2e-playwright/features/deep-linking.spec.ts` (×2), + `test/e2e-playwright/features/oas32/oas32-component-only.spec.ts`, and ~9 `test/e2e-selenium/scenarios/` files (`bugs/4445.js`, `bugs/4485.js`, `bugs/4756.js`, `bugs/4374.js`, `bugs/4587.js`, `bugs/4409.js`, `bugs/4196.js`, `features/parameter-example-rendering.js`, `features/parameter-enum-rendering.js`). @@ -514,7 +514,7 @@ header-only: - `id={isShownKey.map(v => escapeDeepLinkPath(v)).join("-")}` (`:77`) — the tag anchor. - `data-tag={tag}` (`:78`) and `data-is-open={showTag}` (`:79`). -`deep-linking.cy.js` targets tags through exactly these, e.g. +`deep-linking.spec.ts` targets tags through exactly these, e.g. `.opblock-tag[data-tag="myTag"][data-is-open="true"]` (`:78`,`:89`,`:173`,`:184`). They survive the header-only restructure unchanged — but they are attributes on an element whose parent is being deleted, so they are easy to lose in the edit. @@ -522,9 +522,9 @@ deleted, so they are easy to lose in the edit. **Under the count-threshold decision these tests are no longer at risk** — all of them use fixtures far below 150 items, so they exercise the legacy path where these classes still exist: -- `deep-linking.cy.js:237`/`:289` assert `.opblock-tag-section.is-open` positively — +- `deep-linking.spec.ts:237`/`:289` assert `.opblock-tag-section.is-open` positively — `deep-linking.swagger.yaml` has **5** operations → legacy path → passes untouched. -- `oas32-component-only.cy.js:18` asserts `.opblock-tag-section` does **not** exist — +- `oas32-component-only.spec.ts:18` asserts `.opblock-tag-section` does **not** exist — `component-only.yaml` has **0** paths → legacy path → still a meaningful assertion, not a vacuous one. - The 9 Selenium scenarios likewise (and Selenium is not in CI anyway). @@ -540,7 +540,7 @@ Same two blockers as Phase 1 — see If Phase 1 shipped the `ResizeObserver` polyfill in `test/unit/jest-shim.js`, this phase inherits it; verify rather than assume. The new `Operations` test is greenfield, so choose the same strategy Phase 1 settled on (recommended: mock `@tanstack/react-virtual`, and cover real windowing in -Cypress). +Playwright). ### Measuring Success @@ -613,8 +613,8 @@ This decision **substantially changes this ticket's risk profile — read before `.operation-tag-content`, the ``, or the `children` propType. This also means it is **no longer a public plugin-API break** (see Accepted Behavior Changes). - **All the E2E fallout in constraint 6 evaporates.** `deep-linking.swagger.yaml` has **5** - operations and `oas32/component-only.yaml` has **0** paths, so `deep-linking.cy.js:237`/`:289`, - `oas32-component-only.cy.js:18` and the 9 Selenium scenarios all take the legacy path and pass + operations and `oas32/component-only.yaml` has **0** paths, so `deep-linking.spec.ts:237`/`:289`, + `oas32-component-only.spec.ts:18` and the 9 Selenium scenarios all take the legacy path and pass untouched. Keep constraint 6's DOM-contract list as the definition of what the legacy path must keep producing. - **The virtualized path has zero existing coverage.** `many-operations.yaml` (529 ops / 24 tags, @@ -645,7 +645,7 @@ Hooks must be called unconditionally before the branch; the early return goes af - Schema property lists — out of scope for this epic; see the README's "Out of scope" section for why virtualization was rejected there - `src/core/components/overview.jsx` tag list — typically <100 tags, low ROI - `swagger-ui-react` flavor — inherits the change automatically (it re-exports core), so no code - work. But it is a separately published package not covered by the Cypress suite, so smoke-test + work. But it is a separately published package not covered by the Playwright suite, so smoke-test it once before release, same as Phase 1. ## Risks diff --git a/.claude/skills/add-oas-support.md b/.claude/skills/add-oas-support.md index 36062c30ab4..90d3ab7e117 100644 --- a/.claude/skills/add-oas-support.md +++ b/.claude/skills/add-oas-support.md @@ -1491,7 +1491,7 @@ describe("OAS{VERSION}VersionPragmaFilter", () => { ### Step 13: Add E2E Tests -**Directory:** `test/e2e-cypress/e2e/features/oas{VERSION_NUMBER}/` +**Directory:** `test/e2e-playwright/features/oas{VERSION_NUMBER}/` **Create test spec file:** ```javascript @@ -1499,23 +1499,25 @@ describe("OAS{VERSION}VersionPragmaFilter", () => { * @prettier */ -describe("OpenAPI {MAJOR}.{MINOR} features", () => { - it("should detect OAS {VERSION} version", () => { - cy.visit("/oas{VERSION_NUMBER}-spec.html") - cy.get(".information-container .version").should("contain", "{MAJOR}.{MINOR}.0") +import { test, expect } from "../../support/fixtures" + +test.describe("OpenAPI {MAJOR}.{MINOR} features", () => { + test("should detect OAS {VERSION} version", async ({ page }) => { + await page.goto("/oas{VERSION_NUMBER}-spec.html") + await expect(page.locator(".information-container .version")).toContainText("{MAJOR}.{MINOR}.0") }) // Add tests for new features - it("should render new feature X", () => { - cy.visit("/oas{VERSION_NUMBER}-spec.html") - cy.get(".opblock-tag-section").should("contain", "New Feature") + test("should render new feature X", async ({ page }) => { + await page.goto("/oas{VERSION_NUMBER}-spec.html") + await expect(page.locator(".opblock-tag-section")).toContainText("New Feature") }) }) ``` **Add test fixtures:** -- Create sample OAS {VERSION} spec in `test/e2e-cypress/static/documents/oas{VERSION_NUMBER}/` -- Create HTML fixture in `test/e2e-cypress/static/` referencing the spec +- Create sample OAS {VERSION} spec in `test/e2e-playwright/static/documents/oas{VERSION_NUMBER}/` +- Create HTML fixture in `test/e2e-playwright/static/` referencing the spec ### Step 14: Update Documentation @@ -1559,7 +1561,7 @@ npm run test:artifact ```bash npm run lint-errors # ESLint errors only npm run test:unit # Jest unit tests -npm run cy:ci # Cypress E2E tests +npm run e2e # Playwright E2E tests ``` **All tests must pass before submitting PR.** @@ -1966,7 +1968,7 @@ const OpenAPI40Plugin = ({ fn }) => { **Step 1: Create test spec** ```yaml -# test/e2e-cypress/static/documents/oas40/workflows-example.yaml +# test/e2e-playwright/static/documents/oas40/workflows-example.yaml openapi: 4.0.0 info: title: Workflows API @@ -1986,23 +1988,25 @@ paths: **Step 2: Create E2E test** ```javascript -// test/e2e-cypress/e2e/features/oas40/workflows.cy.js +// test/e2e-playwright/features/oas40/workflows.spec.ts + +import { test, expect } from "../../support/fixtures" -describe("OAS 4.0 - Workflows", () => { - beforeEach(() => { - cy.visit("/e2e-cypress/static/documents/oas40/workflows-example.yaml") +test.describe("OAS 4.0 - Workflows", () => { + test.beforeEach(async ({ page }) => { + await page.goto("/?url=/documents/oas40/workflows-example.yaml") }) - it("should render workflows section", () => { - cy.get(".opblock-tag").contains("Workflows").should("exist") + test("should render workflows section", async ({ page }) => { + await expect(page.locator(".opblock-tag")).toContainText("Workflows") }) - it("should display workflow definitions", () => { - cy.get(".opblock-workflow").should("have.length.greaterThan", 0) + test("should display workflow definitions", async ({ page }) => { + await expect(page.locator(".opblock-workflow").first()).toBeAttached() }) - it("should show workflow steps", () => { - cy.get(".opblock-workflow-steps ul li").should("exist") + test("should show workflow steps", async ({ page }) => { + await expect(page.locator(".opblock-workflow-steps ul li").first()).toBeAttached() }) }) ``` diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 87f1e3582ac..0d57c5ef130 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,9 +9,6 @@ on: pull_request: branches: [ main, next ] -env: - CYPRESS_CACHE_FOLDER: cypress/cache - permissions: contents: read @@ -27,14 +24,12 @@ jobs: with: node-version-file: .nvmrc - - name: Cache Node Modules and Cypress binary + - name: Cache Node Modules uses: actions/cache@v6 id: cache-primes with: - path: | - node_modules - ${{ env.CYPRESS_CACHE_FOLDER }} - key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-primes.outputs.cache-hit != 'true' @@ -43,6 +38,9 @@ jobs: - name: Lint code for errors only run: npm run lint-errors + - name: Type-check Playwright tests + run: npm run e2e:typecheck + - name: Run all tests run: npm run test:unit env: @@ -59,7 +57,7 @@ jobs: strategy: fail-fast: false matrix: - containers: ['+(a11y|security|bugs)/**/*cy.js', 'features/**/+(o|d)*.cy.js', 'features/**/m*.cy.js', 'features/**/!(o|d|m)*.cy.js'] + shard: [1, 2, 3, 4] steps: - uses: actions/checkout@v7 @@ -69,18 +67,38 @@ jobs: with: node-version-file: .nvmrc - - name: Cache Node Modules and Cypress binary + - name: Cache Node Modules uses: actions/cache@v6 id: cache-primes with: - path: | - node_modules - ${{ env.CYPRESS_CACHE_FOLDER }} - key: ${{ runner.os }}-node-and-cypress-${{ hashFiles('package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - name: Install dependencies if: steps.cache-primes.outputs.cache-hit != 'true' run: npm ci - - name: Cypress Test - run: npx start-server-and-test cy:start http://localhost:3204 'npm run cy:run -- --spec "test/e2e-cypress/e2e/${{ matrix.containers }}"' + - name: Cache Playwright browsers + uses: actions/cache@v6 + id: cache-playwright + with: + path: ~/.cache/ms-playwright + key: ${{ runner.os }}-playwright-${{ hashFiles('package-lock.json') }} + + # on a cache hit the browser download is skipped, system deps are still installed + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + # Playwright starts the webpack dev server and the mock API itself (see playwright.config.ts) + - name: Playwright Test + run: npm run e2e -- --shard=${{ matrix.shard }}/4 + + - name: Upload Playwright report and traces + if: failure() + uses: actions/upload-artifact@v7 + with: + name: playwright-report-${{ matrix.shard }} + path: | + playwright-report/ + test-results/ + retention-days: 7 diff --git a/.gitignore b/.gitignore index e957857575d..39340b50bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,6 @@ flavors/**/dist/* dist/log* /swagger-ui-*.tgz -# Cypress -test/e2e-cypress/screenshots -test/e2e-cypress/videos +# Playwright +playwright-report/ +test-results/ diff --git a/CLAUDE.md b/CLAUDE.md index e3e02d675e1..654b6b85a88 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,7 +88,7 @@ Apache 2.0 - See LICENSE and NOTICE files for details. **Testing:** - Jest 29.7.0 - Unit testing -- Cypress 14.2.0 - E2E testing +- Playwright 1.63.0 - E2E testing - Enzyme 3.11.0 - React component testing **Development:** @@ -286,43 +286,51 @@ npm run test:unit - `test/unit/jest-shim.js` - Polyfills and shims - `test/unit/setup.js` - Test environment setup -### E2E Tests (Cypress) +### E2E Tests (Playwright) -**Configuration:** `cypress.config.js` +**Configuration:** `playwright.config.ts` -**Location:** `test/e2e-cypress/` +**Location:** `test/e2e-playwright/` -**Base URL:** http://localhost:3230/ +**Base URL:** http://localhost:3230 **Commands:** ```bash -# Run all E2E tests -npm run cy:ci +# Run all E2E tests (starts webpack dev server + mock API automatically) +npm run e2e -# Interactive Cypress runner -npm run cy:dev +# Interactive Playwright UI mode +npm run e2e:ui -# Headless run -npm run cy:run +# Headed browser +npm run e2e:headed -# Start servers and run tests -npm run cy:start # Starts webpack + mock API +# Open the HTML report of the last run +npm run e2e:report + +# Type-check the specs (Playwright itself does not; also runs in CI) +npm run e2e:typecheck + +# Run one spec +npm run e2e -- test/e2e-playwright/features/deep-linking.spec.ts ``` **Structure:** -- `test/e2e-cypress/e2e/` - Test specs (99 test files) -- `test/e2e-cypress/static/` - Test fixtures and documents -- `test/e2e-cypress/support/` - Test helpers and commands +- `test/e2e-playwright/{a11y,bugs,features,security}/` - Test specs (`*.spec.ts`) +- `test/e2e-playwright/static/` - Test fixtures and documents (served at `/` by `webpack/dev-e2e.js`) +- `test/e2e-playwright/fixtures/` - Other fixtures +- `test/e2e-playwright/support/` - Shared `test` fixture, helpers and the OAuth2 test server (port 3231, started by global setup) +- `test/e2e-playwright/tsconfig.json` - strict TypeScript config for specs and `playwright.config.ts` **Test Categories:** -- `a11y/**/*cy.js` - Accessibility tests -- `security/**/*cy.js` - Security tests -- `bugs/**/*cy.js` - Bug regression tests -- `features/**/*cy.js` - Feature tests +- `a11y/**/*.spec.ts` - Accessibility tests +- `security/**/*.spec.ts` - Security tests +- `bugs/**/*.spec.ts` - Bug regression tests +- `features/**/*.spec.ts` - Feature tests **Mock API Server:** ```bash -npm run cy:mock-api # JSON Server on port 3204 +npm run e2e:mock-api # JSON Server on port 3204 ``` ### Artifact Tests @@ -339,7 +347,7 @@ npm run test:artifact ### Complete Test Suite ```bash -npm test # Runs: lint-errors + test:unit + cy:ci +npm test # Runs: lint-errors + test:unit + e2e ``` ### CI/CD Testing @@ -348,7 +356,7 @@ npm test # Runs: lint-errors + test:unit + cy:ci **Two Jobs:** 1. **build** - Lint, unit tests, build, artifact tests -2. **e2e-tests** - Cypress tests (matrix strategy with 3 containers) +2. **e2e-tests** - Playwright tests (matrix strategy with 4 shards, HTML report and traces uploaded on failure) **Branches:** `main`, `next` @@ -441,8 +449,8 @@ insertPragma: true # Insert @prettier pragma **Tests:** - Unit: `test/unit/` (mirrors source structure) -- E2E: `test/e2e-cypress/e2e/` -- Naming: `*.test.ts`, `*.spec.ts`, `*.cy.ts` (Cypress) — use `.tsx` variants when JSX is involved +- E2E: `test/e2e-playwright/` +- Naming: `*.test.ts`, `*.spec.ts` (Playwright) — use `.tsx` variants when JSX is involved --- @@ -513,7 +521,7 @@ Fixes #12345 - Unit tests (Jest) - Build verification - Artifact tests -- E2E tests (Cypress) +- E2E tests (Playwright) ### Release Process @@ -657,7 +665,7 @@ src/ ├── .browserslistrc # Browser targets ├── .nvmrc # Node version (24.x) ├── .lintstagedrc # Pre-commit linting -└── cypress.config.js # Cypress E2E config +└── playwright.config.ts # Playwright E2E config ``` ### Build & Tooling @@ -707,10 +715,10 @@ test/ ├── unit/ # Jest unit tests (37 files) │ ├── setup.js # Test environment setup │ └── jest-shim.js # Polyfills -├── e2e-cypress/ # Cypress E2E tests (99 files) -│ ├── e2e/ # Test specs +├── e2e-playwright/ # Playwright E2E tests (*.spec.ts) +│ ├── {a11y,bugs,features,security}/ # Test specs │ ├── static/ # Fixtures -│ └── support/ # Helpers +│ └── support/ # Helpers, shared fixtures, OAuth2 server └── e2e-selenium/ # Legacy Selenium tests ``` @@ -761,7 +769,7 @@ dist/ # Build output (generated) 4. **Test your changes:** ```bash npm run test:unit # Run unit tests - npm run cy:dev # Interactive E2E testing + npm run e2e:ui # Interactive E2E testing npm run build # Verify build works npm run test:artifact # Verify artifacts ``` @@ -788,7 +796,7 @@ dist/ # Build output (generated) ### Fixing a Bug 1. **Reproduce the bug:** - - Add a failing test in `test/unit/` or `test/e2e-cypress/` + - Add a failing test in `test/unit/` or `test/e2e-playwright/` - Document reproduction steps 2. **Fix the issue:** @@ -858,7 +866,7 @@ dist/ # Build output (generated) - OAS 3.2.x: Use `src/core/plugins/oas32/` **Adding Test Specs:** -- Add to `test/e2e-cypress/static/documents/` +- Add to `test/e2e-playwright/static/documents/` - Reference in E2E tests --- @@ -900,7 +908,7 @@ dist/ # Build output (generated) 11. **Don't render unsanitized HTML** - XSS vulnerability 12. **Don't modify `package-lock.json` manually** 13. **Don't push directly to `main` or `next`** -14. **Don't ignore Cypress test failures** +14. **Don't ignore Playwright test failures** 15. **Don't add dependencies without justification** 16. **Don't break the build** - verify with `npm run build` 17. **Don't import from other plugins** - create self-contained copies instead (e.g., don't import from `oas31` in `oas32`) @@ -969,11 +977,11 @@ npm run dev - State inspection available - Time-travel debugging -**Cypress Interactive Mode:** +**Playwright UI Mode:** ```bash -npm run cy:dev +npm run e2e:ui # Visual test runner -# Step-through debugging +# Time-travel debugging with traces # Network inspection ``` @@ -1007,8 +1015,8 @@ npm run clean # Remove dist/ # Testing npm test # Full test suite (lint + unit + E2E) npm run test:unit # Jest unit tests -npm run cy:dev # Cypress interactive -npm run cy:ci # Cypress CI mode +npm run e2e # Playwright E2E +npm run e2e:ui # Playwright interactive npm run test:artifact # Artifact verification # Linting @@ -1035,7 +1043,7 @@ Components: src/core/components/ Plugins: src/core/plugins/ Styles: src/style/ Tests (Unit): test/unit/ -Tests (E2E): test/e2e-cypress/e2e/ +Tests (E2E): test/e2e-playwright/ Build Output: dist/ ``` diff --git a/README.md b/README.md index d3be6664010..0a58ee1ed4f 100644 --- a/README.md +++ b/README.md @@ -89,18 +89,18 @@ Alternatively, you can set the environment variable `SCARF_ANALYTICS` to `false` ##### Integration Tests -End-to-end tests use [Cypress](https://www.cypress.io/). Run the full suite locally with `npm run cy:ci`, which starts the required servers, runs Cypress headless, and shuts the servers down afterwards - be sure you aren't running a dev server on the same ports when testing! +End-to-end tests use [Playwright](https://playwright.dev/). Install the browser once with `npx playwright install chromium`, then run the full suite locally with `npm run e2e`. Playwright starts the required servers itself (and reuses them if they are already running) - be sure you aren't running a dev server on the same ports when testing, unless you want it reused! -To debug or run individual specs interactively, use `npm run cy:dev` to open the Cypress runner. +To debug or run individual specs interactively, use `npm run e2e:ui` (or `npm run e2e:headed`). -To run a single spec headless, start the servers in one terminal and run that spec in another: +To run a single spec: ```sh -npm run cy:start -# in a second terminal: -npm run cy:run -- --spec "test/e2e-cypress/e2e/features/deep-linking.cy.js" +npm run e2e -- test/e2e-playwright/features/deep-linking.spec.ts ``` +After a run, `npm run e2e:report` opens the HTML report. + ### Browser support Swagger UI works in the latest versions of Chrome, Safari, Firefox, and Edge. diff --git a/cypress.config.js b/cypress.config.js deleted file mode 100644 index a948ea0f97b..00000000000 --- a/cypress.config.js +++ /dev/null @@ -1,19 +0,0 @@ -const { defineConfig } = require("cypress") - -const startOAuthServer = require("./test/e2e-cypress/support/helpers/oauth2-server") - -module.exports = defineConfig({ - fileServerFolder: "test/e2e-cypress/static", - fixturesFolder: "test/e2e-cypress/fixtures", - screenshotsFolder: "test/e2e-cypress/screenshots", - videosFolder: "test/e2e-cypress/videos", - video: false, - e2e: { - baseUrl: "http://localhost:3230/", - supportFile: "test/e2e-cypress/support/e2e.js", - specPattern: "test/e2e-cypress/e2e/**/*.cy.{js,jsx}", - setupNodeEvents: () => { - startOAuthServer() - }, - }, -}) diff --git a/docs/development/scripts.md b/docs/development/scripts.md index 4c746e7f6a6..ec5b6b93663 100644 --- a/docs/development/scripts.md +++ b/docs/development/scripts.md @@ -28,11 +28,15 @@ Script name | Description ### Testing Script name | Description --- | --- -`test` | Run unit tests in Node, run Cypress end-to-end tests, and run ESLint in errors-only mode. +`test` | Run ESLint in errors-only mode, unit tests in Node, and Playwright end-to-end tests. `test:unit` | Run Jest unit tests in Node. -`e2e` | Run end-to-end tests (requires JDK and Selenium). -`e2e-cypress` | Run end-to-end browser tests with Cypress. -`dev-e2e-cypress` | Dev mode, open Cypress runner and manually select tests to run. +`e2e` | Run end-to-end browser tests with Playwright. Starts the webpack dev server and the mock API automatically (reuses them if already running outside CI). +`e2e:ui` | Open the Playwright UI mode to run and debug tests interactively. +`e2e:headed` | Run the Playwright tests in a visible browser. +`e2e:report` | Open the last Playwright HTML report. +`e2e:typecheck` | Type-check the Playwright tests and `playwright.config.ts` with `tsc` (strict). Playwright itself does not type-check. +`e2e:server` | Start only the webpack dev server used by the end-to-end tests (port 3230). +`e2e:mock-api` | Start only the mock API used by the end-to-end tests (port 3204). `lint` | Run ESLint test `test:artifact` | Run list of bundle artifact tests in Jest `test:artifact:umd:bundle` | Run unit test that confirms `swagger-ui-bundle` exports as a Function diff --git a/package-lock.json b/package-lock.json index 3c676c5197e..1ea44cafd17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,9 +60,11 @@ "@commitlint/config-conventional": "^19.8.0", "@jest/globals": "=30.4.1", "@node-oauth/oauth2-server": "=5.3.0", + "@playwright/test": "=1.63.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.6.2", "@release-it/conventional-changelog": "=12.0.0", "@svgr/webpack": "=8.1.0", + "@types/cors": "=2.8.19", "@types/jest": "=30.0.0", "@typescript-eslint/eslint-plugin": "=8.68.0", "@typescript-eslint/parser": "=8.68.0", @@ -78,7 +80,6 @@ "cross-env": "=7.0.3", "css-loader": "=7.1.2", "cssnano": "=7.0.7", - "cypress": "=15.20.1", "dedent": "^1.7.2", "deepmerge": "^4.3.1", "enzyme": "=3.11.0", @@ -126,7 +127,6 @@ "shx": "=0.4.0", "sinon": "21.0.1", "source-map-support": "^0.5.21", - "start-server-and-test": "^2.0.11", "stream-browserify": "^3.0.0", "stylelint": "^16.19.1", "stylelint-prettier": "^5.0.3", @@ -3561,52 +3561,6 @@ "postcss": "^8.4" } }, - "node_modules/@cypress/request": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@cypress/request/-/request-4.0.1.tgz", - "integrity": "sha512-y20e+e6dFYkOUUJLVUZTsJRuTiXZaUQ32WD+R/ux/HBybbTx4ge7cNINcua0pU8+SNkKuRbOF12mBmzuzM8n5w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~4.0.4", - "http-signature": "~1.4.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "performance-now": "^2.1.0", - "qs": "^6.15.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "^5.0.0", - "tunnel-agent": "^0.6.0" - }, - "engines": { - "node": ">= 14.17.0" - } - }, - "node_modules/@cypress/xvfb": { - "version": "1.2.4", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.1.0", - "lodash.once": "^4.1.1" - } - }, - "node_modules/@cypress/xvfb/node_modules/debug": { - "version": "3.2.7", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/@discoveryjs/json-ext": { "version": "0.6.3", "dev": true, @@ -3777,23 +3731,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.13.0", "dev": true, @@ -6332,6 +6269,22 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@playwright/test": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz", + "integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.63.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.6.2.tgz", @@ -6478,30 +6431,6 @@ "hasInstallScript": true, "license": "Apache-2.0" }, - "node_modules/@sideway/address": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", - "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "dev": true, - "license": "BSD-3-Clause" - }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "dev": true, - "license": "BSD-3-Clause" - }, "node_modules/@simple-libs/child-process-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@simple-libs/child-process-utils/-/child-process-utils-2.0.0.tgz", @@ -7792,6 +7721,16 @@ "@types/node": "*" } }, + "node_modules/@types/cors": { + "version": "2.8.19", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", + "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/eslint": { "version": "9.6.1", "dev": true, @@ -8033,16 +7972,6 @@ "@types/send": "<1" } }, - "node_modules/@types/sinonjs__fake-timers": { - "version": "8.1.1", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/sizzle": { - "version": "2.3.9", - "dev": true, - "license": "MIT" - }, "node_modules/@types/sockjs": { "version": "0.3.36", "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", @@ -8060,13 +7989,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/tmp": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@types/tmp/-/tmp-0.2.6.tgz", - "integrity": "sha512-chhaNf2oKHlRkDGt+tiKE2Z5aJ6qalm7Z9rlLdBwmOiAAf09YQvvoLXjWK4HWPF1xU/fqvMgfNfpVoBscA/tKA==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/tough-cookie": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.5.tgz", @@ -9369,14 +9291,6 @@ "dev": true, "license": "MIT" }, - "node_modules/asn1": { - "version": "0.2.6", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, "node_modules/asn1js": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz", @@ -9392,14 +9306,6 @@ "node": ">=12.0.0" } }, - "node_modules/assert-plus": { - "version": "1.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.8" - } - }, "node_modules/ast-types": { "version": "0.13.4", "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", @@ -9443,14 +9349,6 @@ "version": "0.4.0", "license": "MIT" }, - "node_modules/at-least-node": { - "version": "1.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/autolinker": { "version": "3.16.2", "license": "MIT", @@ -9508,19 +9406,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.13.2", - "dev": true, - "license": "MIT" - }, "node_modules/axios": { "version": "1.20.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz", @@ -9986,14 +9871,6 @@ "dev": true, "license": "MIT" }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/before-after-hook": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-4.0.0.tgz", @@ -10012,16 +9889,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/blob-util": { - "version": "2.0.2", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/bluebird": { - "version": "3.7.2", - "dev": true, - "license": "MIT" - }, "node_modules/body-parser": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz", @@ -10522,14 +10389,6 @@ "@keyv/serialize": "^1.0.3" } }, - "node_modules/cachedir": { - "version": "2.4.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/call-bind": { "version": "1.0.8", "license": "MIT", @@ -10633,11 +10492,6 @@ ], "license": "CC-BY-4.0" }, - "node_modules/caseless": { - "version": "0.12.0", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/chalk": { "version": "5.6.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", @@ -10768,14 +10622,6 @@ "dev": true, "license": "MIT" }, - "node_modules/check-more-types": { - "version": "2.24.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/cheerio": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz", @@ -10973,96 +10819,6 @@ "node": ">= 0.2.0" } }, - "node_modules/cli-table3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.1.tgz", - "integrity": "sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==", - "dev": true, - "license": "MIT", - "dependencies": { - "string-width": "^4.2.0" - }, - "engines": { - "node": "10.* || >= 12.*" - }, - "optionalDependencies": { - "colors": "1.4.0" - } - }, - "node_modules/cli-table3/node_modules/colors": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/cli-truncate": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", - "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "slice-ansi": "^8.0.0", - "string-width": "^8.2.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/cli-truncate/node_modules/string-width": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", - "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.5.0", - "strip-ansi": "^7.1.2" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/cli-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", @@ -11280,14 +11036,6 @@ "dev": true, "license": "ISC" }, - "node_modules/common-tags": { - "version": "1.8.2", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/commondir": { "version": "1.0.1", "dev": true, @@ -12217,206 +11965,41 @@ "node": ">=18" } }, - "node_modules/cypress": { - "version": "15.20.1", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-15.20.1.tgz", - "integrity": "sha512-7GV3O7vQQG+EVVv9BGs6lCHY49x25jVi/z1+zdjuuq/o3eZeDwmGPJpRYnOWeGvQxTCtkydXWHBPhV8xuGXPLg==", + "node_modules/dargs": { + "version": "8.1.0", "dev": true, - "hasInstallScript": true, "license": "MIT", - "dependencies": { - "@cypress/request": "^4.0.0", - "@cypress/xvfb": "^1.2.4", - "@types/sinonjs__fake-timers": "8.1.1", - "@types/sizzle": "^2.3.2", - "@types/tmp": "^0.2.3", - "arch": "^3.0.0", - "blob-util": "^2.0.2", - "bluebird": "^3.7.2", - "buffer": "^5.7.1", - "cachedir": "^2.4.0", - "chalk": "^4.1.0", - "ci-info": "^4.1.0", - "cli-table3": "0.6.1", - "commander": "^6.2.1", - "common-tags": "^1.8.0", - "dayjs": "^1.10.4", - "debug": "^4.3.4", - "eventemitter2": "6.4.7", - "execa": "4.1.0", - "executable": "^4.1.1", - "fs-extra": "^9.1.0", - "hasha": "5.2.2", - "is-installed-globally": "~0.4.0", - "listr2": "^9.0.5", - "lodash": "^4.17.23", - "log-symbols": "^4.0.0", - "minimist": "^1.2.8", - "ospath": "^1.2.2", - "pretty-bytes": "^5.6.0", - "process": "^0.11.10", - "proxy-from-env": "1.0.0", - "request-progress": "^3.0.0", - "supports-color": "^8.1.1", - "systeminformation": "^5.31.1", - "tmp": "~0.2.4", - "tree-kill": "1.2.2", - "untildify": "^4.0.0", - "yauzl": "^3.3.1" - }, - "bin": { - "cypress": "bin/cypress" + "engines": { + "node": ">=12" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-8.0.0.tgz", + "integrity": "sha512-6UHfyCux51b8PTGDgveqtz1tvphBku5DrMKKJbFAZAJOI2zsjDpDoYE1+QGj7FOMS4BdTFNJsJiR3zEB0xH0yQ==", + "dev": true, + "license": "MIT", "engines": { - "node": "^20.1.0 || ^22.0.0 || >=24.0.0" + "node": ">= 20" } }, - "node_modules/cypress/node_modules/ansi-styles": { - "version": "4.3.0", + "node_modules/data-urls": { + "version": "5.0.0", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=18" } }, - "node_modules/cypress/node_modules/arch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/arch/-/arch-3.0.0.tgz", - "integrity": "sha512-AmIAC+Wtm2AU8lGfTtHsw0Y9Qtftx2YXEEtiBP10xFUtMOA+sHHx6OAddyL52mUKh1vsXQ6/w1mVDptZCyUt4Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/cypress/node_modules/buffer": { - "version": "5.7.1", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/cypress/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cypress/node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cypress/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/cypress/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/dargs": { - "version": "8.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/data-uri-to-buffer": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-8.0.0.tgz", - "integrity": "sha512-6UHfyCux51b8PTGDgveqtz1tvphBku5DrMKKJbFAZAJOI2zsjDpDoYE1+QGj7FOMS4BdTFNJsJiR3zEB0xH0yQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 20" - } - }, - "node_modules/data-urls": { - "version": "5.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "whatwg-mimetype": "^4.0.0", - "whatwg-url": "^14.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/data-view-buffer": { - "version": "1.0.2", + "node_modules/data-view-buffer": { + "version": "1.0.2", "dev": true, "license": "MIT", "dependencies": { @@ -12463,11 +12046,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/dayjs": { - "version": "1.11.13", - "dev": true, - "license": "MIT" - }, "node_modules/debug": { "version": "4.4.0", "license": "MIT", @@ -12903,20 +12481,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ecc-jsbn/node_modules/jsbn": { - "version": "0.1.1", - "dev": true, - "license": "MIT" - }, "node_modules/ee-first": { "version": "1.1.1", "dev": true, @@ -14023,11 +13587,6 @@ "through": "^2.3.8" } }, - "node_modules/eventemitter2": { - "version": "6.4.7", - "dev": true, - "license": "MIT" - }, "node_modules/eventemitter3": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", @@ -14043,39 +13602,6 @@ "node": ">=0.8.x" } }, - "node_modules/execa": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.0", - "get-stream": "^5.0.0", - "human-signals": "^1.1.1", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.0", - "onetime": "^5.1.0", - "signal-exit": "^3.0.2", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/executable": { - "version": "4.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "pify": "^2.2.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/exit-x": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/exit-x/-/exit-x-0.2.2.tgz", @@ -14278,19 +13804,6 @@ "dev": true, "license": "MIT" }, - "node_modules/extend": { - "version": "3.0.2", - "dev": true, - "license": "MIT" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT" - }, "node_modules/fast-content-type-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", @@ -14678,14 +14191,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": "*" - } - }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", @@ -14760,20 +14265,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fs-extra": { - "version": "9.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/fs-readdir-recursive": { "version": "1.1.0", "dev": true, @@ -14905,20 +14396,6 @@ "node": ">= 0.4" } }, - "node_modules/get-stream": { - "version": "5.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-symbol-description": { "version": "1.1.0", "dev": true, @@ -14950,14 +14427,6 @@ "node": ">= 20" } }, - "node_modules/getpass": { - "version": "0.1.7", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, "node_modules/giget": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/giget/-/giget-3.3.1.tgz", @@ -15097,28 +14566,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/global-dirs": { - "version": "3.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ini": "2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/global-dirs/node_modules/ini": { - "version": "2.0.0", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, "node_modules/global-modules": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", @@ -15298,33 +14745,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=8" - } - }, "node_modules/hasown": { "version": "2.0.2", "license": "MIT", @@ -15675,19 +15095,6 @@ } } }, - "node_modules/http-signature": { - "version": "1.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^2.0.2", - "sshpk": "^1.18.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/https-proxy-agent": { "version": "7.0.6", "dev": true, @@ -15700,14 +15107,6 @@ "node": ">= 14" } }, - "node_modules/human-signals": { - "version": "1.1.1", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=8.12.0" - } - }, "node_modules/humanize": { "version": "0.0.9", "dev": true, @@ -16414,28 +15813,13 @@ "dev": true, "license": "MIT", "dependencies": { - "is-docker": "^3.0.0" - }, - "bin": { - "is-inside-container": "cli.js" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-installed-globally": { - "version": "0.4.0", - "dev": true, - "license": "MIT", - "dependencies": { - "global-dirs": "^3.0.0", - "is-path-inside": "^3.0.2" + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" }, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -16687,22 +16071,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-weakmap": { "version": "2.0.2", "dev": true, @@ -16789,11 +16157,6 @@ "node": ">=0.10.0" } }, - "node_modules/isstream": { - "version": "0.1.2", - "dev": true, - "license": "MIT" - }, "node_modules/issue-parser": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/issue-parser/-/issue-parser-7.0.2.tgz", @@ -18874,20 +18237,6 @@ "dev": true, "license": "MIT" }, - "node_modules/joi": { - "version": "17.13.8", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.8.tgz", - "integrity": "sha512-iPKOGmiRw1jxf/JOPwxmCcUQAOdF359mdzYiP2DJ+TMX0YK2zjK3D+zYOaGjpumWxOFF/l2xVWjRVK5bGSLdEw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@hapi/hoek": "^9.3.0", - "@hapi/topo": "^5.1.0", - "@sideway/address": "^4.1.5", - "@sideway/formula": "^3.0.1", - "@sideway/pinpoint": "^2.0.0" - } - }, "node_modules/js-file-download": { "version": "0.4.12", "license": "MIT" @@ -19049,11 +18398,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-schema": { - "version": "0.4.0", - "dev": true, - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, "node_modules/json-schema-traverse": { "version": "1.0.0", "dev": true, @@ -19254,11 +18598,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "dev": true, - "license": "ISC" - }, "node_modules/json5": { "version": "2.2.3", "dev": true, @@ -19316,20 +18655,6 @@ "node": "*" } }, - "node_modules/jsprim": { - "version": "2.0.2", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "dev": true, @@ -19378,14 +18703,6 @@ "shell-quote": "^1.8.4" } }, - "node_modules/lazy-ass": { - "version": "1.6.0", - "dev": true, - "license": "MIT", - "engines": { - "node": "> 0.8" - } - }, "node_modules/less": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/less/-/less-4.8.1.tgz", @@ -19844,116 +19161,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/listr2": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz", - "integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==", - "dev": true, - "license": "MIT", - "dependencies": { - "cli-truncate": "^5.0.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^6.1.0", - "rfdc": "^1.4.1", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=20.0.0" - } - }, - "node_modules/listr2/node_modules/ansi-regex": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", - "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/listr2/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/listr2/node_modules/emoji-regex": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "dev": true, - "license": "MIT" - }, - "node_modules/listr2/node_modules/eventemitter3": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", - "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/listr2/node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/listr2/node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/listr2/node_modules/wrap-ansi": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/load-json-file": { "version": "4.0.0", "dev": true, @@ -20114,11 +19321,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.once": { - "version": "4.1.1", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.range": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.range/-/lodash.range-3.2.0.tgz", @@ -20166,77 +19368,6 @@ "dev": true, "license": "MIT" }, - "node_modules/log-symbols": { - "version": "4.1.0", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "dev": true, - "license": "MIT" - }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -21769,11 +20900,6 @@ "os-tmpdir": "^1.0.0" } }, - "node_modules/ospath": { - "version": "1.2.2", - "dev": true, - "license": "MIT" - }, "node_modules/own-keys": { "version": "1.0.1", "dev": true, @@ -22199,13 +21325,6 @@ "through": "~2.3" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true, - "license": "MIT" - }, "node_modules/perfect-debounce": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-2.1.0.tgz", @@ -22247,14 +21366,6 @@ "node": ">=0.10" } }, - "node_modules/pify": { - "version": "2.3.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/pirates": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", @@ -22411,22 +21522,51 @@ "node": ">=4" } }, - "node_modules/pkijs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz", - "integrity": "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==", + "node_modules/pkijs": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz", + "integrity": "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@noble/hashes": "1.4.0", + "asn1js": "^3.0.6", + "bytestreamjs": "^2.0.1", + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/playwright": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz", + "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.63.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz", + "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==", "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@noble/hashes": "1.4.0", - "asn1js": "^3.0.6", - "bytestreamjs": "^2.0.1", - "pvtsutils": "^1.3.6", - "pvutils": "^1.1.3", - "tslib": "^2.8.1" + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" }, "engines": { - "node": ">=16.0.0" + "node": ">=20" } }, "node_modules/please-upgrade-node": { @@ -23844,17 +22984,6 @@ "node": ">=6.0.0" } }, - "node_modules/pretty-bytes": { - "version": "5.6.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/pretty-error": { "version": "4.0.0", "dev": true, @@ -24130,68 +23259,12 @@ "node": ">=10" } }, - "node_modules/proxy-from-env": { - "version": "1.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/prr": { "version": "1.0.1", "dev": true, "license": "MIT", "optional": true }, - "node_modules/ps-tree": { - "version": "1.2.0", - "dev": true, - "license": "MIT", - "dependencies": { - "event-stream": "=3.3.4" - }, - "bin": { - "ps-tree": "bin/ps-tree.js" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ps-tree/node_modules/event-stream": { - "version": "3.3.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, - "node_modules/ps-tree/node_modules/map-stream": { - "version": "0.1.0", - "dev": true - }, - "node_modules/ps-tree/node_modules/split": { - "version": "0.3.3", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ps-tree/node_modules/stream-combiner": { - "version": "0.0.4", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1" - } - }, "node_modules/pump": { "version": "3.0.2", "dev": true, @@ -25066,14 +24139,6 @@ "node": ">=0.10" } }, - "node_modules/request-progress": { - "version": "3.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "throttleit": "^1.0.0" - } - }, "node_modules/require-directory": { "version": "2.1.1", "dev": true, @@ -26659,52 +25724,6 @@ "node": ">=6" } }, - "node_modules/slice-ansi": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", - "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.3", - "is-fullwidth-code-point": "^5.1.0" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", - "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.3.1" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/slide": { "version": "1.1.6", "dev": true, @@ -26940,35 +25959,6 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "license": "BSD-3-Clause" }, - "node_modules/sshpk": { - "version": "1.18.0", - "dev": true, - "license": "MIT", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sshpk/node_modules/jsbn": { - "version": "0.1.1", - "dev": true, - "license": "MIT" - }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -26997,72 +25987,6 @@ "dev": true, "license": "MIT" }, - "node_modules/start-server-and-test": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.11.tgz", - "integrity": "sha512-TN39gLzPhHAflxyOkE/oMfQGj+pj3JgF6qVicFH/JrXt7xXktidKXwqfRga+ve7lVA8+RgPZVc25VrEPRScaDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "arg": "^5.0.2", - "bluebird": "3.7.2", - "check-more-types": "2.24.0", - "debug": "4.4.0", - "execa": "5.1.1", - "lazy-ass": "1.6.0", - "ps-tree": "1.2.0", - "wait-on": "8.0.3" - }, - "bin": { - "server-test": "src/bin/start.js", - "start-server-and-test": "src/bin/start.js", - "start-test": "src/bin/start.js" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/start-server-and-test/node_modules/execa": { - "version": "5.1.1", - "dev": true, - "license": "MIT", - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/start-server-and-test/node_modules/get-stream": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/start-server-and-test/node_modules/human-signals": { - "version": "2.1.0", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=10.17.0" - } - }, "node_modules/static-eval": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", @@ -27813,33 +26737,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/systeminformation": { - "version": "5.33.1", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.33.1.tgz", - "integrity": "sha512-DEN6ICHk3Tk0Uf/hrAHh7xlt7iL5CJFBtPZinA0H62DrGG/KPKqq/Nzj6lCXPS4Ay/sf/14zNnk9LpqKzBIc+w==", - "dev": true, - "license": "MIT", - "os": [ - "darwin", - "linux", - "win32", - "freebsd", - "openbsd", - "netbsd", - "sunos", - "android" - ], - "bin": { - "systeminformation": "lib/cli.js" - }, - "engines": { - "node": ">=10.0.0" - }, - "funding": { - "type": "Buy me a coffee", - "url": "https://www.buymeacoffee.com/systeminfo" - } - }, "node_modules/table": { "version": "6.9.0", "resolved": "https://registry.npmjs.org/table/-/table-6.9.0.tgz", @@ -28110,14 +27007,6 @@ "tslib": "^2" } }, - "node_modules/throttleit": { - "version": "1.0.1", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/through": { "version": "2.3.8", "dev": true, @@ -28199,16 +27088,6 @@ "dev": true, "license": "MIT" }, - "node_modules/tmp": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", - "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.14" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -28311,16 +27190,6 @@ "tslib": "2" } }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, - "license": "MIT", - "bin": { - "tree-kill": "cli.js" - } - }, "node_modules/tree-sitter": { "version": "0.21.1", "resolved": "https://registry.npmjs.org/tree-sitter/-/tree-sitter-0.21.1.tgz", @@ -28440,22 +27309,6 @@ "dev": true, "license": "0BSD" }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "dev": true, - "license": "Unlicense" - }, "node_modules/type-check": { "version": "0.4.0", "dev": true, @@ -28774,14 +27627,6 @@ "@unrs/resolver-binding-win32-x64-msvc": "1.11.1" } }, - "node_modules/untildify": { - "version": "4.0.0", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/update-browserslist-db": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.2.tgz", @@ -28946,19 +27791,6 @@ "url": "https://github.com/sponsors/sxzz" } }, - "node_modules/verror": { - "version": "1.10.0", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "license": "MIT", - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "node_modules/w3c-xmlserializer": { "version": "5.0.0", "dev": true, @@ -28970,26 +27802,6 @@ "node": ">=18" } }, - "node_modules/wait-on": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.3.tgz", - "integrity": "sha512-nQFqAFzZDeRxsu7S3C7LbuxslHhk+gnJZHyethuGKAn2IVleIbTB9I3vJSQiSR+DifUqmdzfPMoMPJfLqMF2vw==", - "dev": true, - "license": "MIT", - "dependencies": { - "axios": "^1.8.2", - "joi": "^17.13.3", - "lodash": "^4.17.21", - "minimist": "^1.2.8", - "rxjs": "^7.8.2" - }, - "bin": { - "wait-on": "bin/wait-on" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/walk-up-path": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", @@ -29899,19 +28711,6 @@ "node": ">=12" } }, - "node_modules/yauzl": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-3.4.0.tgz", - "integrity": "sha512-jIH9yLR9wqr0wOS0TpBvo/g/2UgZH5qePVbjgRliiF0BYvOZyaBknKsF+x9Iht0O6sqgnB93rCICdOZFecJuDw==", - "dev": true, - "license": "MIT", - "dependencies": { - "pend": "~1.2.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "dev": true, diff --git a/package.json b/package.json index f9f0eb91c78..1818fa8420d 100644 --- a/package.json +++ b/package.json @@ -56,16 +56,16 @@ "lint-fix": "eslint --ext \".js,.jsx,.ts,.tsx\" src test dev-helpers flavors --fix", "lint-styles": "stylelint \"**/*.scss\"", "lint-styles-fix": "stylelint \"**/*.scss\" --fix", - "test": "run-s lint-errors test:unit cy:ci", + "test": "run-s lint-errors test:unit e2e", "test:artifact": "cross-env NODE_ENV=production BABEL_ENV=commonjs BROWSERSLIST_ENV=node-development jest --config ./config/jest/jest.artifact.config.js", "test:unit": "cross-env NODE_ENV=test BABEL_ENV=commonjs BROWSERSLIST_ENV=node-development jest --config ./config/jest/jest.unit.config.js", - "cy:mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204", - "cy:server": "cross-env NODE_ENV=production BABEL_ENV=production BROWSERSLIST_ENV=browser-production webpack serve --config webpack/dev-e2e.js", - "cy:start": "run-p -r cy:server cy:mock-api", - "cy:open": "cross-env BROWSERSLIST_ENV=browser-production cypress open", - "cy:run": "cross-env BROWSERSLIST_ENV=browser-production cypress run", - "cy:ci": "start-server-and-test cy:start http://localhost:3204 cy:run", - "cy:dev": "start-server-and-test cy:start http://localhost:3204 cy:open", + "e2e:mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204", + "e2e:server": "cross-env NODE_ENV=production BABEL_ENV=production BROWSERSLIST_ENV=browser-production webpack serve --config webpack/dev-e2e.js", + "e2e": "cross-env BROWSERSLIST_ENV=browser-production playwright test", + "e2e:ui": "cross-env BROWSERSLIST_ENV=browser-production playwright test --ui", + "e2e:headed": "cross-env BROWSERSLIST_ENV=browser-production playwright test --headed", + "e2e:report": "playwright show-report", + "e2e:typecheck": "tsc -p test/e2e-playwright/tsconfig.json", "open-static": "npx open-cli http://localhost:3002", "security-audit": "run-s -sc security-audit:all security-audit:prod", "security-audit:prod": "npm-audit-ci-wrapper -p -t low", @@ -125,9 +125,11 @@ "@commitlint/config-conventional": "^19.8.0", "@jest/globals": "=30.4.1", "@node-oauth/oauth2-server": "=5.3.0", + "@playwright/test": "=1.63.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.6.2", "@release-it/conventional-changelog": "=12.0.0", "@svgr/webpack": "=8.1.0", + "@types/cors": "=2.8.19", "@types/jest": "=30.0.0", "@typescript-eslint/eslint-plugin": "=8.68.0", "@typescript-eslint/parser": "=8.68.0", @@ -143,7 +145,6 @@ "cross-env": "=7.0.3", "css-loader": "=7.1.2", "cssnano": "=7.0.7", - "cypress": "=15.20.1", "dedent": "^1.7.2", "deepmerge": "^4.3.1", "enzyme": "=3.11.0", @@ -191,7 +192,6 @@ "shx": "=0.4.0", "sinon": "21.0.1", "source-map-support": "^0.5.21", - "start-server-and-test": "^2.0.11", "stream-browserify": "^3.0.0", "stylelint": "^16.19.1", "stylelint-prettier": "^5.0.3", @@ -223,7 +223,6 @@ "@tree-sitter-grammars/tree-sitter-yaml@0.7.1": true, "tree-sitter-json@0.24.8": true, "fsevents@2.3.3": true, - "cypress@15.20.1": true, "unrs-resolver@1.11.1": true, "@scarf/scarf": false, "core-js-pure": false diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 00000000000..219bf494e13 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,42 @@ +/** + * @prettier + */ +import { defineConfig, devices } from "@playwright/test" + +const isCI = !!process.env.CI + +export default defineConfig({ + testDir: "test/e2e-playwright", + testMatch: "**/*.spec.ts", + globalSetup: "./test/e2e-playwright/support/global-setup.ts", + forbidOnly: isCI, + retries: isCI ? 2 : 0, + reporter: [["list"], ["html", { open: "never" }]], + use: { + baseURL: "http://localhost:3230", + trace: "on-first-retry", + screenshot: "only-on-failure", + video: "off", + }, + projects: [ + { name: "chromium", use: { ...devices["Desktop Chrome"] } }, + // Cypress ran on Chromium only. To add cross-browser coverage later: + // { name: "firefox", use: { ...devices["Desktop Firefox"] } }, + // { name: "webkit", use: { ...devices["Desktop Safari"] } }, + ], + webServer: [ + { + // webpack dev server serving the app and test/e2e-playwright/static + command: "npm run e2e:server", + url: "http://localhost:3230", + reuseExistingServer: !isCI, + timeout: 300_000, + }, + { + command: "npm run e2e:mock-api", + url: "http://localhost:3204", + reuseExistingServer: !isCI, + timeout: 60_000, + }, + ], +}) diff --git a/test/e2e-cypress/.eslintrc b/test/e2e-cypress/.eslintrc deleted file mode 100644 index c9165699940..00000000000 --- a/test/e2e-cypress/.eslintrc +++ /dev/null @@ -1,8 +0,0 @@ -globals: - cy: false - Cypress: false - expect: false - assert: false - -rules: - "no-console": 0 \ No newline at end of file diff --git a/test/e2e-cypress/e2e/a11y/authorize-popup.cy.js b/test/e2e-cypress/e2e/a11y/authorize-popup.cy.js deleted file mode 100644 index 2f8663d62e6..00000000000 --- a/test/e2e-cypress/e2e/a11y/authorize-popup.cy.js +++ /dev/null @@ -1,27 +0,0 @@ -describe("Authorization popup", () => { - it("closes the Available authorizations dialog when Escape is pressed", () => { - cy.visit("/?url=/documents/petstore.swagger.yaml") - .get("button.btn.authorize") - .click() - .get(".dialog-ux") - .should("exist") - - // Trigger on document (what the popup actually listens on) instead of body, - // which skips Cypress's actionability checks against the full-page dialog overlay - cy.document().trigger("keydown", { key: "Escape", eventConstructor: "KeyboardEvent" }) - - cy.get(".dialog-ux").should("not.exist") - }) - - it("closes the Available authorizations dialog when the backdrop is clicked", () => { - cy.visit("/?url=/documents/petstore.swagger.yaml") - .get("button.btn.authorize") - .click() - .get(".dialog-ux") - .should("exist") - .get(".backdrop-ux") - .click({ force: true }) - .get(".dialog-ux") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/a11y/response-tabs.cy.js b/test/e2e-cypress/e2e/a11y/response-tabs.cy.js deleted file mode 100644 index e6f9a454c4a..00000000000 --- a/test/e2e-cypress/e2e/a11y/response-tabs.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -describe("Response tab elements", () => { - describe("ModelExample within Operation", () => { - it("should render Example tabpanel by default", () => { - cy - .visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("#operations-default-addPet") - .click() - .get("div[data-name=examplePanel]") - .first() - .should("have.attr", "aria-hidden", "false") - }) - it("should click Schema tab button and render Schema tabpanel for OpenAPI 3", () => { - cy - .visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("#operations-default-addPet") - .click() - .get("button.tablinks[data-name=model]") - .first() - .click() - .get("div[data-name=modelPanel]") - .first() - .should("have.attr", "aria-hidden", "false") - }) - it("should click Model tab button and render Model tabpanel for OpenAPI 2", () => { - cy - .visit("/?url=/documents/petstore.swagger.yaml") - .get("#operations-pet-addPet") - .click() - .get("button.tablinks[data-name=model]") - .click() - .get("div[data-name=modelPanel]") - .should("have.attr", "aria-hidden", "false") - }) - }) -}) \ No newline at end of file diff --git a/test/e2e-cypress/e2e/bugs/4442.cy.js b/test/e2e-cypress/e2e/bugs/4442.cy.js deleted file mode 100644 index 4dcd1175c78..00000000000 --- a/test/e2e-cypress/e2e/bugs/4442.cy.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @prettier - */ - -describe("UI #4442: Parameter.content display and execution", function () { - it("should display textareas as static documentation according to the `example`", () => { - cy.visit("/?url=/documents/bugs/4442.yaml") - .get(`#operations-default-get_`) - .click() - .get(".btn.try-out__btn") - .click() - .get(`div.json-schema-array > div:nth-child(1) > div > textarea`) - .should("have.value", `{\n "userId": 1,\n "currency": "USD"\n}`) - .get(`div.json-schema-array > div:nth-child(2) > div > textarea`) - .should("have.value", `{\n "userId": 2,\n "currency": "CAD"\n}`) - }) - it("should serialize JSON into a query correctly", () => { - cy.visit("/?url=/documents/bugs/4442.yaml") - .get(`#operations-default-get_`) - .click() - .get(".btn.try-out__btn") - .click() - .get(".btn.execute") - .click() - .get(".request-url pre") - .should( - "have.text", - `http://localhost:3230/?users=${encodeURIComponent( - `[{"userId":1,"currency":"USD"},{"userId":2,"currency":"CAD"}]` - )}` - ) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/4641.cy.js b/test/e2e-cypress/e2e/bugs/4641.cy.js deleted file mode 100644 index 9ba6cf4a07a..00000000000 --- a/test/e2e-cypress/e2e/bugs/4641.cy.js +++ /dev/null @@ -1,95 +0,0 @@ -const clickTryItOutAndExecute = () => { - return cy - .get(".btn.try-out__btn") // expand "try it out" - .click() - .get(".btn.execute") // execute request - .click() -} - -const fillInApiKeyAndAuthorise = apiKey => () => { - return cy - .get("section>input") // type api key into input - .type(apiKey) - .get(".auth-btn-wrapper > .authorize") // authorise button - .click() -} - -const clickLogoutAndReauthorise = () => { - return cy - .get(".auth-btn-wrapper button:nth-child(1)") // logout button - .click() - .get(".auth-btn-wrapper > .authorize") // authorise button - .click() -} - -describe("#4641: The Logout button in Authorize popup not clearing API Key", () => { - beforeEach(() => { - cy.intercept("GET", "/4641*", { - body: "OK", - }).as("request") - }) - - it("should include the given api key in requests", () => { - cy - .visit("/?url=/documents/bugs/4641.yaml") - .get("button.btn.authorize") // open authorize popup - .click() - .get(".modal-ux-content > :nth-child(1)") // only deal with api_key_1 for this test - .within(fillInApiKeyAndAuthorise("my_api_key")) - .get(".close-modal") // close authorise popup button - .click() - .get("#operations-default-get_4641_1") // expand the route details onClick - .click() - .within(clickTryItOutAndExecute) - .wait("@request") - .its("request") - .then((req) => { - expect(req.headers, "request headers").to.have.property("api_key_1", "my_api_key") - }) - }) - - it("should not remember the previous auth value when you logout and reauthorise", () => { - cy - .visit("/?url=/documents/bugs/4641.yaml") - .get("button.btn.authorize") // open authorize popup - .click() - .get(".modal-ux-content > :nth-child(1)") // only deal with api_key_1 for this test - .within(fillInApiKeyAndAuthorise("my_api_key")) - .get(".modal-ux-content > :nth-child(1)") // only deal with api_key_1 for this test - .within(clickLogoutAndReauthorise) - .get(".close-modal") // close authorise popup button - .click() - .get("#operations-default-get_4641_1") // expand the route details onClick - .click() - .within(clickTryItOutAndExecute) - .wait("@request") - .its("request") - .then((req) => { - expect(req.headers, "request headers").not.to.have.property("api_key_1") - }) - }) - - it("should only forget the value of the auth the user logged out from", () => { - cy - .visit("/?url=/documents/bugs/4641.yaml") - .get("button.btn.authorize") // open authorize popup - .click() - .get(".modal-ux-content > :nth-child(1)") // deal with api_key_1 - .within(fillInApiKeyAndAuthorise("my_api_key")) - .get(".modal-ux-content > :nth-child(2)") // deal with api_key_2 - .within(fillInApiKeyAndAuthorise("my_second_api_key")) - .get(".modal-ux-content > :nth-child(1)") // deal with api_key_1 again - .within(clickLogoutAndReauthorise) - .get(".close-modal") // close authorise popup button - .click() - .get("#operations-default-get_4641_2") // expand the route details onClick - .click() - .within(clickTryItOutAndExecute) - .wait("@request") - .its("request") - .then((req) => { - expect(req.headers, "request headers").not.to.have.property("api_key_1") - expect(req.headers, "request headers").to.have.property("api_key_2", "my_second_api_key") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/4838.cy.js b/test/e2e-cypress/e2e/bugs/4838.cy.js deleted file mode 100644 index 6492df4f277..00000000000 --- a/test/e2e-cypress/e2e/bugs/4838.cy.js +++ /dev/null @@ -1,9 +0,0 @@ -describe("#4838: empty request bodies result in endless loading", () => { - it("should render model content changes correctly", () => { - cy - .visit("/?url=/documents/bugs/4838.yaml") - .get("#operations-Some-post_some_route") - .click() - .contains("This should be visible") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/4865.cy.js b/test/e2e-cypress/e2e/bugs/4865.cy.js deleted file mode 100644 index 22db26dc6a6..00000000000 --- a/test/e2e-cypress/e2e/bugs/4865.cy.js +++ /dev/null @@ -1,19 +0,0 @@ -describe("#4865: multiple invocations + OAS3 plugin", () => { - it("control: should render the OAS3 badge correctly", () => { - // This is a sanity check to make sure the badge is present. - // If this is failing, it's probably not related to #4865. - cy.visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("#swagger-ui") - .get("pre.version") - .contains("OAS 3.0") - }) - - it("test: should render the OAS3 badge correctly after re-initializing the UI", () => { - cy.visit("/?url=/documents/petstore-expanded.openapi.yaml") - .window() - .then(win => win.onload()) // re-initializes Swagger UI - .get("#swagger-ui") - .get("pre.version") - .contains("OAS 3.0") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/4867.cy.js b/test/e2e-cypress/e2e/bugs/4867.cy.js deleted file mode 100644 index 2a4ae3f4e73..00000000000 --- a/test/e2e-cypress/e2e/bugs/4867.cy.js +++ /dev/null @@ -1,17 +0,0 @@ -describe("#4867: callback parameter rendering", () => { - it("should render parameters correctly", () => { - cy - .visit("/?url=/documents/bugs/4867.yaml") - .get("#operations-default-myOp") - .click() - .contains("Callbacks") - .click() - - .get(".callbacks-container .opblock-summary-path") - .should("have.attr", "data-path", "http://$request.query.url") - .click() - - .get(".parameters-container") - .contains("myParam") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/4943.cy.js b/test/e2e-cypress/e2e/bugs/4943.cy.js deleted file mode 100644 index 5359754511f..00000000000 --- a/test/e2e-cypress/e2e/bugs/4943.cy.js +++ /dev/null @@ -1,20 +0,0 @@ -describe("#4943: XML example not rendered correctly with oneOf", () => { - it("should render integer property correctly", () => { - cy - .visit("/?url=/documents/bugs/4943.yaml") - .get("#operations-Test-postTest") - .click() - .get(".microlight") - .contains("0") - }) - it("should render oneOf property correctly", () => { - cy - .visit("/?url=/documents/bugs/4943.yaml") - .get("#operations-Test-postTest") - .click() - .get(".try-out__btn") - .click() - .get(".microlight") - .contains("\n\t") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5043.cy.js b/test/e2e-cypress/e2e/bugs/5043.cy.js deleted file mode 100644 index f1fff97d349..00000000000 --- a/test/e2e-cypress/e2e/bugs/5043.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -describe("#5043: path-level $ref path items should inherit global consumes/produces", () => { - it("should render consumes options correctly", () => { - cy - .visit("/?url=/documents/bugs/5043/swagger.yaml") - .get("#operations-pet-findPetsByStatus") - .click() - .get(".try-out__btn") - .click() - .get(".content-type") - .contains("application/json") - .get(".content-type") - .contains("application/xml") - .get(".content-type") - .contains("text/csv") - }) - it("should render produces options correctly", () => { - cy - .visit("/?url=/documents/bugs/5043/swagger.yaml") - .get("#operations-pet-findPetsByStatus") - .click() - .get(".try-out__btn") - .click() - .get(".body-param-content-type select") - .contains("application/json") - .get(".body-param-content-type select") - .contains("application/xml") - .get(".body-param-content-type select") - .contains("text/csv") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5060.cy.js b/test/e2e-cypress/e2e/bugs/5060.cy.js deleted file mode 100644 index 68ce6bc31e8..00000000000 --- a/test/e2e-cypress/e2e/bugs/5060.cy.js +++ /dev/null @@ -1,15 +0,0 @@ -describe("#5060: unwanted smart quotes in rendered Markdown", () => { - it("should not convert regular quotes to smart quotes", () => { - cy - .visit("/?url=/documents/bugs/5060.yaml") - .get("div.description") - .should($el => { - const text = $el.get(0).textContent - expect(text).to.include(`Example of a simple GET request via curl with bearer HTTP Authentication`) - expect(text).to.include(`curl -X GET "https://foobar.com/stuff"`) - expect(text).to.include(`-H "Accept: application/json"`) - expect(text).to.include(`-H "Authorization: Bearer abc123.xyz.789"`) - expect(text.indexOf(`“`)).to.equal(-1) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5070.cy.js b/test/e2e-cypress/e2e/bugs/5070.cy.js deleted file mode 100644 index a27ed782afa..00000000000 --- a/test/e2e-cypress/e2e/bugs/5070.cy.js +++ /dev/null @@ -1,32 +0,0 @@ -describe("#5070: Required field not highlighted on click of Execute button (second time)", () => { - it("should not clear error class=invalid on input field (Swagger)", () => { - cy - .visit("/?url=/documents/petstore.swagger.yaml") - .get("#operations-pet-getPetById") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute without user input - .get(".execute.opblock-control__btn") - .click() - .get(".parameters-col_description input") - .should($el => { - expect($el).to.have.length(1) - const className = $el[0].className - expect(className).to.match(/invalid/i) - }) - // Cancel Try It Out - .get(".cancel") - .click() - // Expand Try It Out (Again) - .get(".try-out__btn") - .click() - .get(".parameters-col_description input") - .should($el => { - expect($el).to.have.length(1) - const className = $el[0].className - expect(className).to.match(/invalid/i) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5072.cy.js b/test/e2e-cypress/e2e/bugs/5072.cy.js deleted file mode 100644 index 267b7c43f9a..00000000000 --- a/test/e2e-cypress/e2e/bugs/5072.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -describe("#5072: x-www-form-urlencoded request body input when `properties` is missing", () => { - it("should provide a JSON input for an empty object schema", () => { - cy - .visit("?url=/documents/bugs/5072/empty.yaml") - .get("#operations-default-postObject") - .click() - .get(".try-out__btn") - .click() - .get(`.opblock-section-request-body textarea`) - .should("have.value", "{}") - }) - it("should provide a JSON input for an additionalProperties object schema", () => { - cy - .visit("?url=/documents/bugs/5072/additional.yaml") - .get("#operations-default-postObject") - .click() - .get(".try-out__btn") - .click() - .get(`.opblock-section-request-body textarea`) - .contains(`"additionalProp1": "string"`) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5129.cy.js b/test/e2e-cypress/e2e/bugs/5129.cy.js deleted file mode 100644 index bd03bc59e9d..00000000000 --- a/test/e2e-cypress/e2e/bugs/5129.cy.js +++ /dev/null @@ -1,121 +0,0 @@ -describe("#5129: parameter required + allowEmptyValue interactions", () => { - describe("allowEmptyValue parameter", () => { - const opId = "#operations-default-get_aev" - it("should omit the parameter by default", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev") - }) - it("should include a value", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=text]`) - .type("asdf") - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev?param=asdf") - }) - it("should include an empty value when empty value box is checked", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=checkbox]`) - .check() - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev?param=") - }) - it("should include a value when empty value box is checked and then input is provided", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=checkbox]`) - .check() - .get(`.parameters-col_description input[type=text]`) - .type("1234") - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev?param=1234") - }) - }) - describe("allowEmptyValue + required parameter", () => { - const opId = "#operations-default-get_aev_and_required" - it("should refuse to execute by default", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(".btn.execute") - .click() - .wait(1000) - .get(".request-url pre") - .should("not.exist") - }) - it("should include a value", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=text]`) - .type("asdf") - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev/and/required?param=asdf") - }) - it("should include an empty value when empty value box is checked", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=checkbox]`) - .check() - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev/and/required?param=") - }) - it("should include a value when empty value box is checked and then input is provided", () => { - cy - .visit("/?url=/documents/bugs/5129.yaml") - .get(opId) - .click() - .get(".btn.try-out__btn") - .click() - .get(`.parameters-col_description input[type=checkbox]`) - .check() - .get(`.parameters-col_description input[type=text]`) - .type("1234") - .get(".btn.execute") - .click() - .get(".request-url pre") - .should("have.text", "http://localhost:3230/aev/and/required?param=1234") - }) - }) -}) \ No newline at end of file diff --git a/test/e2e-cypress/e2e/bugs/5138.cy.js b/test/e2e-cypress/e2e/bugs/5138.cy.js deleted file mode 100644 index 51705a7b313..00000000000 --- a/test/e2e-cypress/e2e/bugs/5138.cy.js +++ /dev/null @@ -1,10 +0,0 @@ -describe("#5138: unwanted `url`/`urls` interactions", () => { - it("should stably render the first `urls` entry", () => { - cy - .visit("/pages/5138/") - .get("h1.title") - .contains("USPTO Data Set API") - .wait(3000) - .contains("USPTO Data Set API") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5164.cy.js b/test/e2e-cypress/e2e/bugs/5164.cy.js deleted file mode 100644 index e8900d89528..00000000000 --- a/test/e2e-cypress/e2e/bugs/5164.cy.js +++ /dev/null @@ -1,19 +0,0 @@ -describe("#5164: multipart property initial values", () => { - it("should provide correct initial values for objects and arrays", () => { - const correctObjectValue = JSON.stringify({ - "one": "abc", - "two": 123 - }, null, 2) - - cy - .visit("?url=/documents/bugs/5164.yaml") - .get("#operations-default-post_") - .click() - .get(".try-out__btn") - .click() - .get(`.parameters[data-property-name="first"] textarea`) - .should("have.value", correctObjectValue) - .get(`.parameters[data-property-name="second"] input`) - .should("have.value", "hi") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5188.cy.js b/test/e2e-cypress/e2e/bugs/5188.cy.js deleted file mode 100644 index 19e8d39ac60..00000000000 --- a/test/e2e-cypress/e2e/bugs/5188.cy.js +++ /dev/null @@ -1,18 +0,0 @@ -describe("#5188: non-string operation summary value", () => { - it("should gracefully handle an object value for an operation summary", () => { - cy - .visit("?url=/documents/bugs/5188.yaml") - .get("#operations-default-objectSummary") - .click() - .get(".opblock-summary-description") - .contains("OrderedMap { \"whatever\": 123 }") - }) - it("should gracefully handle a missing value for an operation summary", () => { - cy - .visit("?url=/documents/bugs/5188.yaml") - .get("#operations-default-noSummary") - .click() - // check for response rendering; makes sure the Operation itself rendered - .contains("Invalid input") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5452.cy.js b/test/e2e-cypress/e2e/bugs/5452.cy.js deleted file mode 100644 index 23eee70c286..00000000000 --- a/test/e2e-cypress/e2e/bugs/5452.cy.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @prettier - */ - -describe("#5452: element", () => { - cy.visit("/?url=/documents/bugs/5455.yaml") - .get("#operations-default-post_foo") - .click() - .get(".opblock-section-request-body > .opblock-description-wrapper") - .should("not.have.descendants", "select") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5458.cy.js b/test/e2e-cypress/e2e/bugs/5458.cy.js deleted file mode 100644 index 3c0ccb67ff4..00000000000 --- a/test/e2e-cypress/e2e/bugs/5458.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -// http://github.com/swagger-api/swagger-ui/issues/5458 - -const expectedValue = `{ - "foo": "custom value" -}` - -describe("#5458: Swagger 2.0 `Response.examples` mappings", () => { - it("should render a custom example when a schema is not defined", () => { - cy.visit("/?url=/documents/bugs/5458.yaml") - .get("#operations-default-get_foo1") - .click() - .get(".model-example .highlight-code") - .contains(expectedValue) - }) - it("should render a custom example when a schema is defined", () => { - cy.visit("/?url=/documents/bugs/5458.yaml") - .get("#operations-default-get_foo2") - .click() - .get(".model-example .highlight-code") - .contains(expectedValue) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/5660.cy.js b/test/e2e-cypress/e2e/bugs/5660.cy.js deleted file mode 100644 index 3a77acc9ac1..00000000000 --- a/test/e2e-cypress/e2e/bugs/5660.cy.js +++ /dev/null @@ -1,20 +0,0 @@ -// http://github.com/swagger-api/swagger-ui/issues/5660 - -const expectedValue = "nullable: true" - -describe("#5660: Nullable object", () => { - it("should render `nullable` marker for object itself", () => { - cy.visit("/?url=/documents/bugs/5660-model.yaml") - .get("#model-SomeObject .model-toggle") - .click() - .get("#model-SomeObject > .model-box") - .contains(expectedValue) - }) - it("should render `nullable` marker for next object in property", () => { - cy.visit("/?url=/documents/bugs/5660-property.yaml") - .get("#model-SomeObject .model-toggle") - .click() - .get("#model-SomeObject > .model-box") - .contains(expectedValue) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6016.cy.js b/test/e2e-cypress/e2e/bugs/6016.cy.js deleted file mode 100644 index d65142f3491..00000000000 --- a/test/e2e-cypress/e2e/bugs/6016.cy.js +++ /dev/null @@ -1,42 +0,0 @@ -describe("Entries should be valid property name", () => { - it("should render a OAS3.0 definition that uses 'entries' as a 'components' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas3.yaml") - .get("#operations-tag-default") - .should("exist") - }) - it("should render expanded Operations of OAS3.0 definition that uses 'entries' as a 'components' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas3.yaml") - .get("#operations-default-test_test__get") - .click() - .get("#operations-default-test_test__get > div .opblock-body") - .should("exist") - - }) - it("should render expanded Models of OAS3.0 definition that uses 'entries' as a 'components' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas3.yaml") - .get("#model-Testmodel > span .model-box") - .click() - .get("div .model-box") - .should("exist") - }) - it("should render a OAS2.0 definition that uses 'entries' as a 'definitions' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas2.yaml") - .get("#operations-default-post_pet") - .should("exist") - }) - it("should render expanded Operations of OAS2.0 definition that uses 'entries' as a 'definitions' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas2.yaml") - .get("#operations-default-post_pet") - .click() - .get("#operations-default-post_pet > div .opblock-body") - .should("exist") - - }) - it("should render expanded Models of OAS2.0 definition that uses 'entries' as a 'defintions' property name", () => { - cy.visit("/?url=/documents/bugs/6016-oas2.yaml") - .get("#model-Pet > span .model-box") - .click() - .get("div .model-box") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6158.cy.js b/test/e2e-cypress/e2e/bugs/6158.cy.js deleted file mode 100644 index 098af8b379e..00000000000 --- a/test/e2e-cypress/e2e/bugs/6158.cy.js +++ /dev/null @@ -1,54 +0,0 @@ -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") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6183.cy.js b/test/e2e-cypress/e2e/bugs/6183.cy.js deleted file mode 100644 index e169f257d43..00000000000 --- a/test/e2e-cypress/e2e/bugs/6183.cy.js +++ /dev/null @@ -1,45 +0,0 @@ -describe("When trying it out", () => { - it("should render the response headers as comma separated lists", () => { - cy.intercept( - { - method: "GET", - url: /^\/response-headers/, - hostname: "httpbin.org", - }, - { - body: { - "Access-Control-Expose-Headers": "X-Header1, X-Header2, X-Header3, Access-Control-Expose-Headers", - "Content-Length": "289", - "Content-Type": "application/json", - "X-Header1": "value1,value2", - "X-Header2": "value3,value4", - "X-Header3": ["value5", "value6"] - }, - headers: { - "access-control-expose-headers": "X-Header1,X-Header2,X-Header3,Access-Control-Expose-Headers", - "content-type": "application/json", - "x-header1": "value1,value2", - "x-header2": "value3,value4", - "x-header3": "value5,value6", - } - }) - - cy.visit("/?url=/documents/bugs/6183.yaml") - .get("#operations-default-get_response_headers") - .click() - .get(".try-out__btn") - .click() - .get(".btn.execute") - .click() - .wait(1000) - .get(".response-col_description .microlight") - .find(("span:contains(\"value1,value2\")")) - .should("exist") - .get(".response-col_description .microlight") - .find(("span:contains(\"value3,value4\")")) - .should("exist") - .get(".response-col_description .microlight") - .find(("span:contains(\"value5,value6\")")) - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6276.cy.js b/test/e2e-cypress/e2e/bugs/6276.cy.js deleted file mode 100644 index e26dbd72b69..00000000000 --- a/test/e2e-cypress/e2e/bugs/6276.cy.js +++ /dev/null @@ -1,43 +0,0 @@ -describe("#6276: Query parameter filter=true is filtering by the value 'true'", () => { - describe("With filter=true", () => { - it("should display the filter bar", () => { - cy.visit("/?url=/documents/petstore.swagger.yaml&filter=true") - .get(".operation-filter-input") - .should("exist") - .should("be.empty") - .get(".opblock-tag[data-tag='pet']") - .should("exist") - .get(".opblock-tag[data-tag='store']") - .should("exist") - .get(".opblock-tag[data-tag='user']") - .should("exist") - }) - }) - describe("With filter=false", () => { - it("should not display the filter bar", () => { - cy.visit("/?url=/documents/petstore.swagger.yaml&filter=false") - .get(".operation-filter-input") - .should("not.exist") - .get(".opblock-tag[data-tag='pet']") - .should("exist") - .get(".opblock-tag[data-tag='store']") - .should("exist") - .get(".opblock-tag[data-tag='user']") - .should("exist") - }) - }) - describe("With filter=pet", () => { - it("should display the filter bar and only show the operations tagged with pet", () => { - cy.visit("/?url=/documents/petstore.swagger.yaml&filter=pet") - .get(".operation-filter-input") - .should("exist") - .should("have.value", "pet") - .get(".opblock-tag[data-tag='pet']") - .should("exist") - .get(".opblock-tag[data-tag='store']") - .should("not.exist") - .get(".opblock-tag[data-tag='user']") - .should("not.exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6351.cy.js b/test/e2e-cypress/e2e/bugs/6351.cy.js deleted file mode 100644 index e1113b4611d..00000000000 --- a/test/e2e-cypress/e2e/bugs/6351.cy.js +++ /dev/null @@ -1,11 +0,0 @@ -// http://github.com/swagger-api/swagger-ui/issues/6351 - -describe("#6351: Server dropdown should change when switched via oas3Actions.setSelectedServer", () => { - it("should show different selected server", () => { - cy.visit("/?url=/documents/bugs/6351.yaml") - .get("select").should("have.value", "http://testserver1.com") - .window() - .then(win => win.ui.oas3Actions.setSelectedServer("http://testserver2.com")) - .get("select").should("have.value", "http://testserver2.com") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6369.cy.js b/test/e2e-cypress/e2e/bugs/6369.cy.js deleted file mode 100644 index 9182f4da60d..00000000000 --- a/test/e2e-cypress/e2e/bugs/6369.cy.js +++ /dev/null @@ -1,44 +0,0 @@ -describe("#6369: Object model render of field: deprecated", () => { - describe("OAS3", () => { - it("should display row with td:deprecated when set to true", () => { - cy.visit("/?url=/documents/bugs/6369-oas3-display.yaml") - .get("#model-IdentificationProfile > .model-box") - .click() - .get("#model-IdentificationProfile .model-box .model .inner-object table") - .find("tr") - .should("have.length", 3) - .contains("td", "deprecated") - }) - it("should not display row with td:deprecated when set to false", () => { - cy.visit("/?url=/documents/bugs/6369-oas3-no-display.yaml") - .get("#model-IdentificationProfile > .model-box") - .click() - .get("#model-IdentificationProfile .model-box .model .inner-object table") - .find("tr") - .should("have.length", 2) - .get("#model-IdentificationProfile .model-box .model .inner-object table") - .find(("td:contains(\"deprecated\")")) - .should("not.exist") - }) - }) - describe ("OAS2", () => { - it("should display row with td:deprecated when set to true", () => { - cy.visit("/?url=/documents/bugs/6369-oas2-display.yaml") - .get("#model-IdentificationProfile > .model-box") - .click() - .get("#model-IdentificationProfile .model-box .model .inner-object") - .contains("td", "deprecated") - }) - it("should not display row with td:deprecated when set to false", () => { - cy.visit("/?url=/documents/bugs/6369-oas2-no-display.yaml") - .get("#model-IdentificationProfile > .model-box") - .click() - .get("#model-IdentificationProfile .model-box .model .inner-object table") - .find("tr") - .should("have.length", 2) - .get("#model-IdentificationProfile .model-box .model .inner-object table") - .find(("td:contains(\"deprecated\")")) - .should("not.exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6442.cy.js b/test/e2e-cypress/e2e/bugs/6442.cy.js deleted file mode 100644 index 206055ab0b3..00000000000 --- a/test/e2e-cypress/e2e/bugs/6442.cy.js +++ /dev/null @@ -1,33 +0,0 @@ -describe("#6442: 'Examples' keyword definitions can not be rendered as xml", () => { - it("should render response examples accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6442.yaml") - .get("#operations-default-xmlTest") - .click() - .get(".responses-wrapper") - .within(() => { - cy - .get(".microlight") - .should("include.text", xmlIndicator) - }) - }) -}) - -describe("#6442: 'Example' keyword definitions can not be rendered as xml", () => { - it("should render response examples accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6442.yaml") - .get("#operations-default-xmlTest2") - .click() - .get(".responses-wrapper") - .within(() => { - cy - .get(".microlight") - .should("include.text", xmlIndicator) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6475.cy.js b/test/e2e-cypress/e2e/bugs/6475.cy.js deleted file mode 100644 index 05fade8003b..00000000000 --- a/test/e2e-cypress/e2e/bugs/6475.cy.js +++ /dev/null @@ -1,65 +0,0 @@ -describe("#6475: 'Examples' keyword definitions can not be rendered as xml", () => { - it("should render requestBody examples preview accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6475.yaml") - .get("#operations-default-xmlTest_examples") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy - .get(".microlight") - .should("include.text", xmlIndicator) - }) - }) - it("should requestBody examples input accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6475.yaml") - .get("#operations-default-xmlTest_examples") - .click() - .get(".btn.try-out__btn") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy - .get("textarea") - .contains(xmlIndicator) - }) - }) -}) - -describe("#6475: 'Example' keyword definitions can not be rendered as xml", () => { - it("should render requestBody examples preview accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6475.yaml") - .get("#operations-default-xmlTest_example") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy - .get(".microlight") - .should("include.text", xmlIndicator) - }) - }) - it("should requestBody examples input accourdingly to content-type xml", () => { - const xmlIndicator = "should be xml" - - cy - .visit("?url=/documents/bugs/6475.yaml") - .get("#operations-default-xmlTest_example") - .click() - .get(".btn.try-out__btn") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy - .get("textarea") - .contains(xmlIndicator) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6540.cy.js b/test/e2e-cypress/e2e/bugs/6540.cy.js deleted file mode 100644 index 62f3948e049..00000000000 --- a/test/e2e-cypress/e2e/bugs/6540.cy.js +++ /dev/null @@ -1,11 +0,0 @@ -describe("#6540: XML example not rendered correctly with oneOf", () => { - it("should render xml like json", () => { - const expected = "\n\n\tstring\n\t0\n\t\n\t\tText\n\t\tThis is a text\n\t\n\t\n\t\timage\n\t\tThis is a image\n\t\n\t\n\t\tText\n\t\tThis is a text\n\t\n\t\n\t\timage\n\t\tThis is a image\n\t\n" - cy - .visit("/?url=/documents/bugs/6540.yaml") - .get("#operations-Test-postTest") - .click() - .get(".microlight") - .contains(expected) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/6627.cy.js b/test/e2e-cypress/e2e/bugs/6627.cy.js deleted file mode 100644 index 716b21fa924..00000000000 --- a/test/e2e-cypress/e2e/bugs/6627.cy.js +++ /dev/null @@ -1,11 +0,0 @@ -describe("#6627: XML example when defined as array", () => { - it("should render xml like json", () => { - const expected = "\n\n\t\n\t\n\t\n\t\n" - cy - .visit("/?url=/documents/bugs/6627.yaml") - .get("#operations-default-get_users") - .click() - .get(".microlight") - .contains(expected) - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/7996.cy.js b/test/e2e-cypress/e2e/bugs/7996.cy.js deleted file mode 100644 index cb042deb427..00000000000 --- a/test/e2e-cypress/e2e/bugs/7996.cy.js +++ /dev/null @@ -1,14 +0,0 @@ -describe("#7996: tag description text fills container when externalDocs section absent", () => { - it("should show externalDocs div when externalDocs present in specification", () => { - cy - .visit("?url=/documents/bugs/7996-tags-externalDocs.yaml") - .get("#operations-tag-foo .info__externaldocs") - .should("exist") - }) - it("should have no externalDocs div when externalDocs absent from specification", () => { - cy - .visit("?url=/documents/bugs/7996-tags-externalDocs.yaml") - .get("#operations-tag-bar .info__externaldocs") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/8217.cy.js b/test/e2e-cypress/e2e/bugs/8217.cy.js deleted file mode 100644 index 2c61c42a937..00000000000 --- a/test/e2e-cypress/e2e/bugs/8217.cy.js +++ /dev/null @@ -1,24 +0,0 @@ -describe("#8217: Reset Request Body not using default values", () => { - it("it reset the user edited value and executes with the default value in case of try out reset. (#6517)", () => { - cy - .visit("?url=/documents/bugs/8217.yaml") - .get("#operations-default-addPet") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // replace default sample with bad value - .get(`.parameters[data-property-name="bodyParameter"] input`) - .type("{selectall}not the default value") - // Reset Try It Out - .get(".try-out__btn.reset") - .click() - // Submit using default value - .get(".btn.execute") - .click() - // No required validation error on body parameter - .get(`.parameters[data-property-name="bodyParameter"] input`) - .should("have.value", "default") - .and("not.have.class", "invalid") - }) -}) \ No newline at end of file diff --git a/test/e2e-cypress/e2e/bugs/editor-1868.cy.js b/test/e2e-cypress/e2e/bugs/editor-1868.cy.js deleted file mode 100644 index 9b5f20c2e32..00000000000 --- a/test/e2e-cypress/e2e/bugs/editor-1868.cy.js +++ /dev/null @@ -1,24 +0,0 @@ -describe("Editor #1868: model changes break rendering", () => { - it("should render model content changes correctly", () => { - cy - .visit("/?url=/documents/bugs/editor-1868.yaml") - - .get(".model-toggle.collapsed") - .click() - - .get("#model-MyModel") - .contains("a") - - .window() - .then(win => { - // Simulate Swagger Editor updating a model - const content = win.ui.specSelectors.specStr() - win.ui.specActions.updateSpec(content + `\n b:\n type: string`) - }) - - .get("#model-MyModel") - .contains("a") - .get("#model-MyModel") - .contains("b") - }) -}) diff --git a/test/e2e-cypress/e2e/bugs/swos-63.cy.js b/test/e2e-cypress/e2e/bugs/swos-63.cy.js deleted file mode 100644 index 0e8199f9705..00000000000 --- a/test/e2e-cypress/e2e/bugs/swos-63.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -describe("SWOS-63: Schema/Model labeling", () => { - describe("SchemaS/Models section", () => { - it("should render `Schemas` for OpenAPI 3", () => { - cy - .visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("section.models > h4") - .contains("Schemas") - }) - it("should render `Models` for OpenAPI 2", () => { - cy - .visit("/?url=/documents/petstore.swagger.yaml") - .get("section.models > h4") - .contains("Models") - }) - }) - describe("ModelExample within Operation", () => { - it("should render `Schemas` for OpenAPI 3", () => { - cy - .visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("#operations-default-findPets") - .click() - .get("button.tablinks[data-name=model]") - .contains("Schema") - }) - it("should render `Models` for OpenAPI 2", () => { - cy - .visit("/?url=/documents/petstore.swagger.yaml") - .get("section.models > h4") - .get("#operations-pet-addPet") - .click() - .get("button.tablinks[data-name=model]") - .contains("Model") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/auth-bearer-flow.cy.js b/test/e2e-cypress/e2e/features/auth-bearer-flow.cy.js deleted file mode 100644 index 49ffbaca4fa..00000000000 --- a/test/e2e-cypress/e2e/features/auth-bearer-flow.cy.js +++ /dev/null @@ -1,51 +0,0 @@ -describe("OAuth2 Bearer flow", () => { - beforeEach(() => { - const staticResponse = { - statusCode: 200, - body: { - name: "not a random secret for test", - } - } - cy.intercept("GET", "/get*", staticResponse).as( - "tokenRequest" - ) - }) - - it("should be focused on input field with aria-label", () => { - cy.visit( - "/?url=/documents/features/auth-bearer-flow.yaml" - ) - .get("button.authorize") - .click() - cy.focused() - .should("have.attr", "aria-label").and("eq", "auth-bearer-value") - }) - it("should make a header request with proper sample cURL header", () => { - cy.visit( - "/?url=/documents/features/auth-bearer-flow.yaml" - ) - .get("button.authorize") - .click() - .get("section > input") - .type("secret_token") - .get(".auth-btn-wrapper > .authorize") - .click() - .get("button.close-modal") - .click() - // Try-it-out - .get("#operations-default-get_get") - .click() - .get(".btn.try-out__btn") - .click() - .get(".btn.execute") - .click() - cy.wait("@tokenRequest") - .its("request") - .its("headers") - .its("authorization") - .should("equal", "Bearer secret_token") - .get(".curl") - .contains("Authorization: Bearer secret_token") - .should("be.visible") - }) -}) diff --git a/test/e2e-cypress/e2e/features/auth-code-flow-pkce-without-secret.cy.js b/test/e2e-cypress/e2e/features/auth-code-flow-pkce-without-secret.cy.js deleted file mode 100644 index 205b5327641..00000000000 --- a/test/e2e-cypress/e2e/features/auth-code-flow-pkce-without-secret.cy.js +++ /dev/null @@ -1,47 +0,0 @@ -describe("Check client_secret for OAuth2 Authorization Code flow with and without PKCE (#6290)", () => { - it("should display client_secret field for authorization code flow with PKCE", () => { - cy.visit( - "/?url=/documents/features/auth-code-flow-pkce-without-secret.yaml" - ) - .window() - .then(win => { - // set auth config to use PKCE - let authConfigs = win.ui.authSelectors.getConfigs() - win.ui.authActions.configureAuth({ - ...authConfigs, - usePkceWithAuthorizationCodeGrant: true, - }) - }) - .get("button.authorize") - .click() - .get("h4") - .contains("authorizationCode with PKCE") - .get(".flow") - .contains("authorizationCode with PKCE") - .get("#client_secret_authorizationCode") - .should("exist") - }) - - it("should display client_secret field for authorization code flow without PKCE", () => { - cy.visit( - "/?url=/documents/features/auth-code-flow-pkce-without-secret.yaml" - ) - .window() - .then(win => { - // set auth config to not use PKCE - let authConfigs = win.ui.authSelectors.getConfigs() - win.ui.authActions.configureAuth({ - ...authConfigs, - usePkceWithAuthorizationCodeGrant: false, - }) - }) - .get("button.authorize") - .click() - .get("h4") - .contains("authorizationCode") - .get(".flow") - .contains("authorizationCode") - .get("#client_secret_authorizationCode") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/deep-linking.cy.js b/test/e2e-cypress/e2e/features/deep-linking.cy.js deleted file mode 100644 index d01e4adb6d1..00000000000 --- a/test/e2e-cypress/e2e/features/deep-linking.cy.js +++ /dev/null @@ -1,292 +0,0 @@ -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 }) { - 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) - }) -} diff --git a/test/e2e-cypress/e2e/features/default-model-rendering.cy.js b/test/e2e-cypress/e2e/features/default-model-rendering.cy.js deleted file mode 100644 index 4c23bbeaa2c..00000000000 --- a/test/e2e-cypress/e2e/features/default-model-rendering.cy.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @prettier - */ - -describe("defaultModelRendering set to model", () => { - it("should not render schemas for responses with no defined schemas", () => { - cy.visit( - "/?defaultModelRendering=model&url=/documents/features/default-model-rendering.yaml" - ) - .get("#operations-default-get_") - .click() - .get( - "#operations-default-get_ [data-code=200] .response-col_description__inner" - ) - .contains("no content") - .get("#operations-default-get_ [data-code=200] .model-example") - .should("not.exist") - .get( - "#operations-default-get_ [data-code=201] .response-col_description__inner" - ) - .contains("no schema but an example") - .get("#operations-default-get_ [data-code=201] .model-example") - .contains('"foo": "bar"') - .should("exist") - .get( - "#operations-default-get_ [data-code=202] .response-col_description__inner" - ) - .contains("no schema but examples") - .get("#operations-default-get_ [data-code=202] .model-example") - .contains('"foo": "bar"') - .should("exist") - .get( - "#operations-default-get_ [data-code=203] .response-col_description__inner" - ) - .contains("no schema no example") - .get("#operations-default-get_ [data-code=203] .model-example") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/dynamic-default-oauth.cy.js b/test/e2e-cypress/e2e/features/dynamic-default-oauth.cy.js deleted file mode 100644 index dfb5d905cc2..00000000000 --- a/test/e2e-cypress/e2e/features/dynamic-default-oauth.cy.js +++ /dev/null @@ -1,26 +0,0 @@ -describe("dynamic default oauth2RedirectUrl", () => { - it("should compute an oauth2RedirectUrl based on the browser's location at runtime", () => { - cy.visit("/") - .window() - .then(win => win.ui.getConfigs()) - .should("include", { oauth2RedirectUrl: "http://localhost:3230/oauth2-redirect.html" }) - }) - it("should compute an oauth2RedirectUrl based on the browser's location at runtime, including the path", () => { - cy.visit("/pages/5085/") - .window() - .then(win => win.ui.getConfigs()) - .should("include", { oauth2RedirectUrl: "http://localhost:3230/pages/5085/oauth2-redirect.html" }) - }) - it("should compute an oauth2RedirectUrl based on the browser's location at runtime, including the path, without confusing the file name for a folder name", () => { - cy.visit("/pages/5085/index.html") - .window() - .then(win => win.ui.getConfigs()) - .should("include", { oauth2RedirectUrl: "http://localhost:3230/pages/5085/oauth2-redirect.html" }) - }) - it("should compute an oauth2RedirectUrl based on the browser's location at runtime, including the path, even it does not end with a slash", () => { - cy.visit("/pages/5085") - .window() - .then(win => win.ui.getConfigs()) - .should("include", { oauth2RedirectUrl: "http://localhost:3230/pages/5085/oauth2-redirect.html" }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/external-docs.cy.js b/test/e2e-cypress/e2e/features/external-docs.cy.js deleted file mode 100644 index 6aa4e417969..00000000000 --- a/test/e2e-cypress/e2e/features/external-docs.cy.js +++ /dev/null @@ -1,108 +0,0 @@ -describe("External docs feature", () => { - describe("in Swagger 2", () => { - ExternalDocsTest("/?url=/documents/features/external-docs.swagger.yaml") - }) - describe("in OpenAPI 3", () => { - ExternalDocsTest("/?url=/documents/features/external-docs.openapi.yaml") - }) -}) - -function ExternalDocsTest(baseUrl) { - describe("for Root", () => { - it("should display link to external docs with description", () => { - cy.visit(baseUrl) - .get(".info__extdocs") - .should("exist") - .and("contain.text", "Read external docs") - .and("have.attr", "href", "http://swagger.io/") - }) - - it("should display link to external docs without description", () => { - cy - .intercept({ - path: /^\/documents\/features\/external-docs\.(swagger|openapi)\.yaml\?intercept$/ - }, (req) => { - delete req.headers["if-none-match"] - delete req.headers["if-modified-since"] - req.continue((res) => { - res.send({body: res.body.replace(" description: Read external docs\n", "")}) - }) - }) - .visit(`${baseUrl}?intercept`) - .get(".info__extdocs") - .should("exist") - .and("contain.text", "http://swagger.io") - .and("have.attr", "href", "http://swagger.io/") - }) - }) - - describe("for Tags", () => { - it("should display link to external docs with description", () => { - cy.visit(baseUrl) - .get(`.opblock-tag[data-tag="pet"] .info__externaldocs`) - .should("exist") - .find("a") - .should("contain.text", "Pet Documentation") - .and("have.attr", "href", "http://swagger.io/") - }) - - it("should display link to external docs without description", () => { - cy.visit(baseUrl) - .get(`.opblock-tag[data-tag="petWithoutDescription"] .info__externaldocs`) - .should("exist") - .find("a") - .should("contain.text", "http://swagger.io") - .and("have.attr", "href", "http://swagger.io/") - }) - }) - - describe("for Schemas", () => { - function SchemaTestFactory(type) { - return () => { - it("should display link with description", () => { - cy.visit(baseUrl) - .get(`.models #model-${type} button`) - .click() - .get(`.models #model-${type} .external-docs a`) - .should("contain.text", `${type} Docs`) - .and("have.attr", "href", "http://swagger.io/") - }) - - it("should display link without description", () => { - cy.visit(baseUrl) - .get(`.models #model-${type}WithoutDescription button`) - .click() - .get(`.models #model-${type}WithoutDescription .external-docs a`) - .should("contain.text", "http://swagger.io") - .and("have.attr", "href", "http://swagger.io/") - }) - } - } - - describe("Primitive Schema", SchemaTestFactory("Primitive")) - describe("Array Schema", SchemaTestFactory("Array")) - describe("Object Schema", SchemaTestFactory("Object")) - }) - - describe("for Operation", () => { - it("should display link to external docs with description", () => { - cy.visit(baseUrl) - .get("#operations-pet-updatePet button.opblock-summary-control") - .click() - .get("#operations-pet-updatePet .opblock-external-docs-wrapper .opblock-external-docs__description") - .should("contain.text", "More details about putting a pet") - .get("#operations-pet-updatePet .opblock-external-docs-wrapper .opblock-external-docs__link") - .should("have.attr", "href", "http://swagger.io/") - }) - - it("should display link to external docs without description", () => { - cy.visit(baseUrl) - .get("#operations-pet-addPet button.opblock-summary-control") - .click() - .get("#operations-pet-addPet .opblock-external-docs-wrapper .opblock-external-docs__description") - .should("not.exist") - .get("#operations-pet-addPet .opblock-external-docs-wrapper .opblock-external-docs__link") - .should("have.attr", "href", "http://swagger.io/") - }) - }) -} diff --git a/test/e2e-cypress/e2e/features/info.cy.js b/test/e2e-cypress/e2e/features/info.cy.js deleted file mode 100644 index 9884f197408..00000000000 --- a/test/e2e-cypress/e2e/features/info.cy.js +++ /dev/null @@ -1,84 +0,0 @@ -describe("Render Info Component", () => { - describe("OpenAPI 2.0", () => { - const baseUrl = "/?url=/documents/features/info-openAPI2.yaml" - - it("should render Info Description", () => { - cy.visit(baseUrl) - .get(".info .description") - .should("contains.text", "This is a sample") - }) - - it("should render Info Main anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info .main > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - - it("should not render Info Summary (an OpenAPI 3.1 field)", () => { - cy.visit(baseUrl) - .get(".info__summary") - .should("not.exist") - }) - }) - - describe("OpenAPI 3.0.x", () => { - const baseUrl = "/?url=/documents/features/info-openAPI30.yaml" - - it("should render Info Description", () => { - cy.visit(baseUrl) - .get(".info .description") - .should("contains.text", "This is a sample") - }) - - it("should render Info Main anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info .main > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - - it("should not render Info Summary (an OpenAPI 3.1 field)", () => { - cy.visit(baseUrl) - .get(".info__summary") - .should("not.exist") - }) - }) - - describe("OpenAPI 3.1.x", () => { - const baseUrl = "/?url=/documents/features/info-openAPI31.yaml" - - it("should render Info Description", () => { - cy.visit(baseUrl) - .get(".info .description") - .should("contains.text", "This is a sample") - }) - - it("should render Info Main anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info .main > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - it("should render Info Summary", () => { - cy.visit(baseUrl) - .get(".info__summary") - .should("exist") - .should("contains.text", "new 3.1.x specific field") - .get(".info .description") - .should("contains.text", "This is a sample") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/license.cy.js b/test/e2e-cypress/e2e/features/license.cy.js deleted file mode 100644 index 8d48f95f9d0..00000000000 --- a/test/e2e-cypress/e2e/features/license.cy.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * @prettier - */ -describe("Render License Component", () => { - describe("OpenAPI 2.0", () => { - const baseUrl = "/?url=/documents/features/license-openAPI2.yaml" - - it("should render License URL", () => { - cy.visit(baseUrl) - .get(".info__license") - .should("exist") - .should("contains.text", "Apache 2.0") - }) - - it("should render License URL anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info__license__url > .link") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - }) - - describe("OpenAPI 3.0.x", () => { - const baseUrl = "/?url=/documents/features/license-openAPI30.yaml" - - it("should render License URL", () => { - cy.visit(baseUrl) - .get(".info__license__url") - .should("exist") - .should("contains.text", "Apache 2.0") - }) - - it("should render URL anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info__license__url > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - }) - - describe("OpenAPI 3.1.x", () => { - describe("given URL field", () => { - const baseUrl = "/?url=/documents/features/license-openAPI31-url.yaml" - - it("should render URL", () => { - cy.visit(baseUrl) - .get(".info__license__url") - .should("exist") - .should("contains.text", "Apache 2.0") - .get(".info__license__url > a") - .should("have.attr", "href") - .and("equal", "https://www.apache.org/licenses/LICENSE-2.0.html") - }) - - it("should render URL anchor target xss link with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info__license__url > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - }) - - describe("given identifier field", () => { - const baseUrl = - "/?url=/documents/features/license-openAPI31-identifier.yaml" - - it("should render URL using identifier", () => { - cy.visit(baseUrl) - .get(".info__license__url") - .should("exist") - .should("contains.text", "Apache 2.0") - .get(".info__license__url > a") - .should("have.attr", "href") - .and("equal", "https://spdx.org/licenses/Apache-2.0.html") - }) - - it("should render URL anchor target xss links with safe `rel` attributes", () => { - cy.visit(baseUrl) - .get(".info__license__url > a") - .should("have.attr", "rel") - .and("include", "noopener") - .and("include", "noreferrer") - .get(".info .main > a") - .should("have.attr", "target") - .and("equal", "_blank") - }) - }) - - describe("URL and SPX are mutually exclusive", () => { - it("should render nothing if both URL & SPDX exists", () => { - const baseUrl = - "/?url=/documents/features/license-openAPI31-error-both-identifier-and-url.yaml" - cy.visit(baseUrl) - .get(".info__license__identifier") - .should("not.exist") - .get(".info__license__url") - .should("not.exist") - }) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/model-collapse.cy.js b/test/e2e-cypress/e2e/features/model-collapse.cy.js deleted file mode 100644 index 32b6884607c..00000000000 --- a/test/e2e-cypress/e2e/features/model-collapse.cy.js +++ /dev/null @@ -1,50 +0,0 @@ -describe("Model collapse/expand feature", () => { - describe("in Swagger 2", () => { - const swagger2BaseUrl = "/?deepLinking=true&url=/documents/features/models.swagger.yaml" - const urlFragment = "#/definitions/Pet" - ModelCollapseTest(swagger2BaseUrl, urlFragment) - }) - describe("in OpenAPI 3", () => { - const openAPI3BaseUrl = "/?deepLinking=true&url=/documents/features/models.openapi.yaml" - ModelCollapseTest(openAPI3BaseUrl) - }) -}) - -function ModelCollapseTest(baseUrl) { - it("Models section should be expanded on load", () => { - cy.visit(baseUrl) - .get(".models") - .should("have.class", "is-open") - .get("#model-Pet") - .should("exist") - }) - - it("Models section should collapse and expand when toggled", () => { - cy.visit(baseUrl) - .get(".models h4 .models-control") - .click() - .get(".models") - .should("not.have.class", "is-open") - .get("#model-Order") - .should("not.exist") - .get(".models h4 .models-control") - .click() - .get(".models") - .should("have.class", "is-open") - .get("#model-Order") - .should("exist") - }) - - it("Model should collapse and expand when toggled clicking button", () => { - cy.visit(baseUrl) - .get("#model-User .model-box .model-box-control") - .click() - .get("#model-User .model-box .model .inner-object") - .should("exist") - .get("#model-User .model-box .model-box-control") - .first() - .click() - .get("#model-User .model-box .model .inner-object") - .should("not.exist") - }) -} diff --git a/test/e2e-cypress/e2e/features/models-virtualization.cy.js b/test/e2e-cypress/e2e/features/models-virtualization.cy.js deleted file mode 100644 index 9e76a67aa48..00000000000 --- a/test/e2e-cypress/e2e/features/models-virtualization.cy.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * @prettier - */ - -describe("Models list virtualization", () => { - describe("non-virtualized path — below threshold (OpenAPI 2.0)", () => { - it("renders all model-container elements without a scroll wrapper", () => { - cy.visit("/?url=/documents/features/models.swagger.yaml") - cy.get(".models-scroll").should("not.exist") - cy.get(".model-container").should("have.length", 3) - }) - }) - - describe("virtualized path — above threshold (OpenAPI 2.0)", () => { - const baseUrl = "/?url=/documents/perf/many-schemas.swagger.yaml" - - it("renders a scroll wrapper and mounts only a windowed subset", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - cy.get(".model-container").should("have.length.lessThan", 240) - }) - - it("section header collapse and expand still works", () => { - cy.visit(baseUrl) - cy.get(".models").should("have.class", "is-open") - cy.get(".models h4 .models-control").click() - cy.get(".models").should("not.have.class", "is-open") - cy.get(".models-scroll").should("not.exist") - cy.get(".models h4 .models-control").click() - cy.get(".models").should("have.class", "is-open") - cy.get(".models-scroll").should("exist") - }) - - it("scrolling renders new items and unmounts old ones", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - cy.get("#model-PerfModel001").should("exist") - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - cy.wait(200) - cy.get("#model-PerfModel001").should("not.exist") - cy.get("#model-PerfModel240").should("exist") - cy.get(".model-container").should("have.length.lessThan", 240) - }) - }) - - it("expanded model state is preserved when scrolled out of view and back", () => { - cy.visit(baseUrl) - // expand first visible model - cy.get(".models-scroll").should("exist") - cy.get("#model-PerfModel001 span.inner-object").should("not.exist") - cy.get("#model-PerfModel001 .model-box-control").click() - cy.get("#model-PerfModel001 span.inner-object").should("exist") - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - }) - cy.wait(200) - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = 0 - }) - cy.wait(200) - - cy.get("#model-PerfModel001 span.inner-object").should("exist") - }) - - it("expanded nested property state is preserved when scrolled out of view and back", () => { - cy.visit(baseUrl) - cy.get("#model-PerfModel001 .model-box-control").first().click() - cy.get("#model-PerfModel001 span.inner-object").should("exist") - cy.get("#model-PerfModel001 span.inner-object .prop-type").should( - "not.exist" - ) - cy.get("#model-PerfModel001 span.inner-object .model-box-control") - .first() - .click() - cy.get("#model-PerfModel001 span.inner-object .prop-type").should("exist") - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - }) - cy.wait(200) - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = 0 - }) - cy.wait(200) - - cy.get("#model-PerfModel001 span.inner-object .prop-type").should("exist") - }) - }) - - describe("virtualized path — above threshold (OpenAPI 3.0)", () => { - it("renders a scroll wrapper and mounts only a windowed subset", () => { - cy.visit("/?url=/documents/perf/many-schemas.openapi.yaml") - cy.get(".models-scroll").should("exist") - cy.get(".model-container").should("have.length.lessThan", 240) - }) - }) - - describe("non-virtualized path — below threshold (OpenAPI 3.1)", () => { - it("renders all schemas without a scroll wrapper", () => { - cy.visit("/?url=/documents/features/oas31-schema-expansion.yaml") - cy.get(".models-scroll").should("not.exist") - cy.get(".json-schema-2020-12:not(.json-schema-2020-12--embedded)").should( - "have.length", - 1 - ) - }) - }) - - describe("virtualized path — above threshold (OpenAPI 3.1)", () => { - const baseUrl = "/?url=/documents/perf/many-schemas.openapi31.yaml" - - it("renders a scroll wrapper and mounts only a windowed subset", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - cy.get(".json-schema-2020-12:not(.json-schema-2020-12--embedded)").should( - "have.length.lessThan", - 240 - ) - }) - - it("section header collapse and expand still works", () => { - cy.visit(baseUrl) - cy.get(".models").should("have.class", "is-open") - cy.get(".models h4 .models-control").click() - cy.get(".models").should("not.have.class", "is-open") - cy.get(".models-scroll").should("not.exist") - cy.get(".models h4 .models-control").click() - cy.get(".models").should("have.class", "is-open") - cy.get(".models-scroll").should("exist") - }) - - it("scrolling renders new items and unmounts old ones", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - cy.contains(".json-schema-2020-12-accordion", "PerfModel001").should( - "exist" - ) - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - cy.wait(200) - cy.contains(".json-schema-2020-12-accordion", "PerfModel001").should( - "not.exist" - ) - cy.contains(".json-schema-2020-12-accordion", "PerfModel240").should( - "exist" - ) - cy.get( - ".json-schema-2020-12:not(.json-schema-2020-12--embedded)" - ).should("have.length.lessThan", 240) - }) - }) - - it("expanded schema state is preserved when scrolled out of view and back", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .find(".json-schema-2020-12-body") - .first() - .should("have.class", "json-schema-2020-12-body--collapsed") - cy.contains(".json-schema-2020-12-accordion", "PerfModel001").click() - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .find(".json-schema-2020-12-body") - .first() - .should("not.have.class", "json-schema-2020-12-body--collapsed") - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - }) - cy.wait(200) - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = 0 - }) - cy.wait(200) - - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .find(".json-schema-2020-12-body") - .first() - .should("not.have.class", "json-schema-2020-12-body--collapsed") - }) - - it("collapsed nested property state is preserved when scrolled out of view and back", () => { - cy.visit(baseUrl) - cy.get(".models-scroll").should("exist") - - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .find(".json-schema-2020-12-expand-deep-button") - .first() - .click() - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .contains("Items") - .should("exist") - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .contains(".json-schema-2020-12-accordion", "tags") - .click() - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .contains("Items") - .should("not.exist") - - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = $scroll[0].scrollHeight - }) - cy.wait(200) - cy.get(".models-scroll").then(($scroll) => { - $scroll[0].scrollTop = 0 - }) - cy.wait(200) - - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .find(".json-schema-2020-12-body") - .first() - .should("not.have.class", "json-schema-2020-12-body--collapsed") - cy.contains(".json-schema-2020-12-accordion", "PerfModel001") - .closest(".json-schema-2020-12") - .contains("Items") - .should("not.exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/multiple-examples-core.cy.js b/test/e2e-cypress/e2e/features/multiple-examples-core.cy.js deleted file mode 100644 index bc351585e3b..00000000000 --- a/test/e2e-cypress/e2e/features/multiple-examples-core.cy.js +++ /dev/null @@ -1,665 +0,0 @@ -/** - * @prettier - */ -const { - ParameterPrimitiveTestCases, - RequestBodyPrimitiveTestCases, - ResponsePrimitiveTestCases, -} = require("../../support/helpers/multiple-examples") -describe("OpenAPI 3.0 Multiple Examples - core features", () => { - describe("/String", () => { - describe("in a parameter", () => { - ParameterPrimitiveTestCases({ - operationDomId: "#operations-default-post_String", - parameterName: "message", - exampleA: { - key: "StringExampleA", - value: "hello world", - }, - exampleB: { - key: "StringExampleB", - value: "The quick brown fox jumps over the lazy dog", - }, - customUserInput: "OpenAPIs.org <3", - }) - }) - describe("in a Request Body", () => { - RequestBodyPrimitiveTestCases({ - operationDomId: "#operations-default-post_String", - exampleA: { - key: "StringExampleA", - value: "hello world", - serializedValue: "hello world", - summary: "Don't just string me along...", - }, - exampleB: { - key: "StringExampleB", - value: "The quick brown fox jumps over the lazy dog", - serializedValue: "The quick brown fox jumps over the lazy dog", - summary: "I'm a pangram!", - }, - customUserInput: "OpenAPIs.org <3", - }) - }) - describe("in a Response", () => { - ResponsePrimitiveTestCases({ - operationDomId: "#operations-default-post_String", - exampleA: { - key: "StringExampleA", - value: "hello world", - summary: "Don't just string me along...", - }, - exampleB: { - key: "StringExampleB", - value: "The quick brown fox jumps over the lazy dog", - summary: "I'm a pangram!", - }, - exampleC: { - key: "StringExampleC", - value: "JavaScript rules", - summary: "A third example, for use in special places...", - }, - }) - }) - }) - describe("/Number", () => { - describe("in a parameter", () => { - ParameterPrimitiveTestCases({ - operationDomId: "#operations-default-post_Number", - parameterName: "message", - exampleA: { - key: "NumberExampleA", - value: "7710263025", - }, - exampleB: { - key: "NumberExampleB", - value: "9007199254740991", - }, - exampleC: { - key: "NumberExampleC", - value: "0", - }, - customUserInput: "9001", - }) - }) - describe("in a Request Body", () => { - RequestBodyPrimitiveTestCases({ - operationDomId: "#operations-default-post_Number", - exampleA: { - key: "NumberExampleA", - value: "7710263025", - summary: "World population", - }, - exampleB: { - key: "NumberExampleB", - value: "9007199254740991", - summary: "Number.MAX_SAFE_INTEGER", - }, - exampleC: { - key: "NumberExampleC", - value: "0", - }, - customUserInput: "1337", - }) - }) - describe("in a Response", () => { - ResponsePrimitiveTestCases({ - operationDomId: "#operations-default-post_Number", - exampleA: { - key: "NumberExampleA", - value: "7710263025", - summary: "World population", - }, - exampleB: { - key: "NumberExampleB", - value: "9007199254740991", - summary: "Number.MAX_SAFE_INTEGER", - }, - exampleC: { - key: "NumberExampleC", - value: "0", - }, - }) - }) - }) - describe("/Boolean", () => { - describe("in a parameter", () => { - it("should render and apply the first example and value by default", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Boolean") - .click() - // Assert on the initial dropdown value - .get("table.parameters .examples-select > select") - .find(":selected") - .should("have.text", "The truth will set you free") - // Assert on the initial JsonSchemaForm value - .get(".parameters-col_description > select") - .should("have.attr", "disabled") - .get(".parameters-col_description > select") - .find(":selected") - .should("have.text", "true") - // Execute - .get(".try-out__btn") - .click() - .get(".execute") - .click() - // Assert on the request URL - .get(".request-url") - .contains(`?message=true`) - }) - it("should render and apply the second value when chosen", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Boolean") - .click() - // Set the dropdown value, then assert on it - .get("table.parameters .examples-select > select") - .select("BooleanExampleB") - .find(":selected") - .should("have.text", "Friends don't lie to friends") - // Set the JsonSchemaForm value, then assert on it - .get(".parameters-col_description > select") - .find(":selected") - .should("have.text", "false") - // Execute - .get(".try-out__btn") - .click() - .get(".execute") - .click() - // Assert on the request URL - .get(".request-url") - .contains(`?message=false`) - }) - it("should track value changes against valid examples", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Boolean") - .click() - .get(".try-out__btn") - .click() - // Set the JsonSchemaForm value, then assert on it - .get(".parameters-col_description > select") - .select("false") - .find(":selected") - .should("have.text", "false") - // Assert on the dropdown value - .get("table.parameters .examples-select > select") - .find(":selected") - .should("have.text", "Friends don't lie to friends") - // Execute - .get(".execute") - .click() - // Assert on the request URL - .get(".request-url") - .contains(`?message=false`) - }) - }) - describe("in a Request Body", () => { - RequestBodyPrimitiveTestCases({ - operationDomId: "#operations-default-post_Boolean", - exampleA: { - key: "BooleanExampleA", - value: "true", - summary: "The truth will set you free", - }, - exampleB: { - key: "BooleanExampleB", - value: "false", - summary: "Friends don't lie to friends", - }, - customUserInput: "tralse", - }) - }) - describe("in a Response", () => { - it("should render and apply the first example and value by default", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Boolean") - .click() - // Assert on the initial dropdown value - .get(".responses-wrapper .examples-select > select") - .find(":selected") - .should("have.text", "The truth will set you free") - // Assert on the example value - .get(".example.microlight") - .should("have.text", "true") - }) - it("should render and apply the second value when chosen", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Boolean") - .click() - // Set the dropdown value, then assert on it - .get(".responses-wrapper .examples-select > select") - .select("BooleanExampleB") - .find(":selected") - .should("have.text", "Friends don't lie to friends") - // Assert on the example value - .get(".example.microlight") - .should("have.text", "false") - }) - }) - }) - describe("/Array", () => { - describe("in a Parameter", () => { - it("should have the first example's array entries by default", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "a", - "b", - "c", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of strings") - }) - it("should switch to the second array's entries via dropdown", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of numbers") - }) - it("should not allow modification of values in static mode", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item > input") - .should("have.attr", "disabled") - }) - it("should allow modification of values in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}5") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - "5", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - }) - - it("should retain a modified value, and support returning to it", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}5") - // Reset to an example - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of numbers") - // Return to the modified value - .get(".parameters-col_description .examples-select > select") - .select("__MODIFIED__VALUE__") - // Assert that our modified value is back - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - "5", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - }) - }) - describe("in a Request Body", () => { - it("should have the first example's array entries by default", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Check HighlightCode value - .get(".opblock-section-request-body .highlight-code") - .should("include.text", JSON.stringify(["a", "b", "c"], null, 2)) - // Check dropdown value - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of strings") - // Switch to Try-It-Out - .get(".try-out__btn") - .click() - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("have.value", JSON.stringify(["a", "b", "c"], null, 2)) - // Check dropdown value - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of strings") - }) - it("should switch to the second array's entries via dropdown", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - .get(".opblock-section-request-body .examples-select > select") - .select("ArrayExampleB") - .get(".opblock-section-request-body .highlight-code") - .should("include.text", JSON.stringify([1, 2, 3, 4], null, 2)) - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of numbers") - // Switch to Try-It-Out - .get(".try-out__btn") - .click() - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("include.text", JSON.stringify([1, 2, 3, 4], null, 2)) - // Check dropdown value - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of numbers") - }) - it("should allow modification of values", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Switch to Try-It-Out - .get(".try-out__btn") - .click() - // Choose the second example - .get(".opblock-section-request-body .examples-select > select") - .select("ArrayExampleB") - // Change the value - .get(".opblock-section-request-body textarea") - .type(`{leftarrow}{leftarrow},{enter} 5`) - // Check that [Modified value] is displayed in dropdown - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2)) - }) - - it("should retain a modified value, and support returning to it", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Switch to Try-It-Out - .get(".try-out__btn") - .click() - // Choose the second example as the example to start with - .get(".opblock-section-request-body .examples-select > select") - .select("ArrayExampleB") - // Change the value - .get(".opblock-section-request-body textarea") - .type(`{leftarrow}{leftarrow},{enter} 5`) - // Check that [Modified value] is displayed in dropdown - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2)) - // Choose the second example - .get(".opblock-section-request-body .examples-select > select") - .select("ArrayExampleB") - // Check that the example is displayed in dropdown - .get(".opblock-section-request-body .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of numbers") - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("include.text", JSON.stringify([1, 2, 3, 4], null, 2)) - // Switch back to the modified value - .get(".opblock-section-request-body .examples-select > select") - .select("__MODIFIED__VALUE__") - // Check textarea value - .get(".opblock-section-request-body textarea") - .should("include.text", JSON.stringify([1, 2, 3, 4, 5], null, 2)) - }) - }) - describe("in a Response", () => { - it("should render and apply the first example and value by default", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Assert on the initial dropdown value - .get(".responses-wrapper .examples-select > select") - .find(":selected") - .should("have.text", "A lowly array of strings") - // Assert on the example value - .get(".example.microlight") - .should("include.text", JSON.stringify(["a", "b", "c"], null, 2)) - }) - it("should render and apply the second value when chosen", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Set the dropdown value, then assert on it - .get(".responses-wrapper .examples-select > select") - .select("ArrayExampleB") - .find(":selected") - .should("have.text", "A lowly array of numbers") - // Assert on the example value - .get(".example.microlight") - .should("include.text", JSON.stringify([1, 2, 3, 4], null, 2)) - }) - }) - }) - describe("/Object", () => { - describe("in a Parameter", () => { - ParameterPrimitiveTestCases({ - operationDomId: "#operations-default-post_Object", - parameterName: "data", - customUserInput: `{{} "openapiIsCool": true }`, - customExpectedUrlSubstring: "?openapiIsCool=true", - exampleA: { - key: "ObjectExampleA", - serializedValue: - "firstName=Kyle&lastName=Shockey&email=kyle.shockey%40smartbear.com", - value: JSON.stringify( - { - firstName: "Kyle", - lastName: "Shockey", - email: "kyle.shockey@smartbear.com", - }, - null, - 2 - ), - }, - exampleB: { - key: "ObjectExampleB", - serializedValue: - "name=Abbey&type=kitten&color=calico&gender=female&age=11%20weeks", - value: JSON.stringify( - { - name: "Abbey", - type: "kitten", - color: "calico", - gender: "female", - age: "11 weeks", - }, - null, - 2 - ), - }, - }) - }) - describe("in a Request Body", () => { - const exampleA = JSON.stringify( - { - firstName: "Kyle", - lastName: "Shockey", - email: "kyle.shockey@smartbear.com", - }, - null, - 2 - ) - const exampleB = JSON.stringify( - { - name: "Abbey", - type: "kitten", - color: "calico", - gender: "female", - age: "11 weeks", - }, - null, - 2 - ) - RequestBodyPrimitiveTestCases({ - operationDomId: "#operations-default-post_Object", - primaryMediaType: "application/json", - // ↓ not a typo, Cypress requires escaping { when using `cy.type` - customUserInput: `{{} "openapiIsCool": true }`, - customExpectedUrlSubstring: "?openapiIsCool=true", - customUserInputExpectedCurlSubstring: `{ "openapiIsCool": true }`, - exampleA: { - key: "ObjectExampleA", - serializedValue: exampleA, - value: exampleA, - summary: "A user's contact info", - }, - exampleB: { - key: "ObjectExampleB", - serializedValue: exampleB, - value: exampleB, - summary: "A wonderful kitten's info", - }, - }) - it("should display an error message when input validation fails", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - // Expand the operation - .get("#operations-default-post_Object") - .click() - // Switch to Try-It-Out - .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" - ) - .type("{{{{ [[[[ <<<< invalid JSON here.") - // Execute the operation - .get(".execute") - .click() - // Verify that an error is shown - .get(".validation-errors") - .contains("Parameter string value must be valid JSON") - }) - }) - describe("in a Response", () => { - ResponsePrimitiveTestCases({ - operationDomId: "#operations-default-post_Object", - exampleA: { - key: "ObjectExampleA", - value: JSON.stringify( - { - firstName: "Kyle", - lastName: "Shockey", - email: "kyle.shockey@smartbear.com", - }, - null, - 2 - ), - summary: "A user's contact info", - }, - exampleB: { - key: "ObjectExampleB", - value: JSON.stringify( - { - name: "Abbey", - type: "kitten", - color: "calico", - gender: "female", - age: "11 weeks", - }, - null, - 2 - ), - summary: "A wonderful kitten's info", - }, - }) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas-badge.cy.js b/test/e2e-cypress/e2e/features/oas-badge.cy.js deleted file mode 100644 index 8656d915a5a..00000000000 --- a/test/e2e-cypress/e2e/features/oas-badge.cy.js +++ /dev/null @@ -1,33 +0,0 @@ -describe("OpenAPI Badge", () => { - it("should display light green badge with version indicator for Swagger 2.0", () => { - cy.visit("/?url=/documents/features/info-openAPI2.yaml") - .get("#swagger-ui") - .get('*[class^="version-stamp"]') - .get("pre.version") - .contains("OAS 2.0") - }) - - it("should display light green badge with version indicator for OpenAPI 3.0.x", () => { - cy.visit("/?url=/documents/petstore-expanded.openapi.yaml") - .get("#swagger-ui") - .get('*[class^="version-stamp"]') - .get("pre.version") - .contains("OAS 3.0") - }) - - it("should display light green badge with version indicator for OpenAPI 3.1.0", () => { - cy.visit("/?url=/documents/features/info-openAPI31.yaml") - .get("#swagger-ui") - .get('*[class^="version-stamp"]') - .get("pre.version") - .contains("OAS 3.1") - }) - - it("should display light green badge with version indicator for OpenAPI 3.2.0", () => { - cy.visit("/?url=/documents/oas32/oas32-features.yaml") - .get("#swagger-ui") - .get('*[class^="version-stamp"]') - .get("pre.version") - .contains("OAS 3.2") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-callbacks.cy.js b/test/e2e-cypress/e2e/features/oas3-callbacks.cy.js deleted file mode 100644 index 26d92e7fb20..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-callbacks.cy.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Related to // https://github.com/swagger-api/swagger-ui/issues/9222. - */ - -describe("OpenAPI 3.0 Callbacks", () => { - it("should render all defined callbacks", () => { - cy.visit( - "/?url=/documents/features/oas3-callbacks.yaml" - ) - .get("#operations-Device-register") - .click() - .get(".opblock-section-header .tab-item.false") - .click() - .get("#operations-callbacks-callbackOne") - .should("be.visible") - .get("#operations-callbacks-callbackTwo") - .should("be.visible") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-extension.cy.js b/test/e2e-cypress/e2e/features/oas3-extension.cy.js deleted file mode 100644 index f9feb76f89a..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-extension.cy.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 extensions", () => { - describe("displays extensions", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas3-extension.yaml&showExtensions=true" - ) - - cy.get(".model-box-control").contains("User").click() - cy.get(".property-row").contains("[...]").click() - }) - - it("object extensions are visible", () => { - cy.get(".extension").contains(`x-object-extension`).should("be.visible") - cy.get(".extension") - .contains(`x-object-objectExtension`) - .should("be.visible") - }) - - it("primitive extensions are visible", () => { - cy.get(".extension") - .contains(`x-primitive-extension`) - .should("be.visible") - cy.get(".extension") - .contains(`x-primitive-objectExtension`) - .should("be.visible") - }) - }) - - it("should hide extensions if showExtensions option is set to false", () => { - cy.visit("/?url=/documents/features/oas3-extension.yaml") - cy.get(".model-box-control").contains("User").click() - cy.get(".property-row").contains("[...]").click() - - cy.contains("x-primitive-extension").should("not.exist") - cy.contains("x-primitive-objectExtension").should("not.exist") - cy.contains("x-object-extension").should("not.exist") - cy.contains("x-object-objectExtension").should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-multiple-media-type.cy.js b/test/e2e-cypress/e2e/features/oas3-multiple-media-type.cy.js deleted file mode 100644 index fc2ac521d41..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-multiple-media-type.cy.js +++ /dev/null @@ -1,184 +0,0 @@ -// https://github.com/swagger-api/swagger-ui/issues/6201 -// https://github.com/swagger-api/swagger-ui/issues/6250 -// https://github.com/swagger-api/swagger-ui/issues/6476 - -describe("OpenAPI 3.0 Multiple Media Types with different schemas", () => { - const mediaTypeFormData = "multipart/form-data" - const mediaTypeUrlencoded = "application/x-www-form-urlencoded" - const mediaTypeJson = "application/json" - - beforeEach(() => { - cy.intercept({ - method: "POST", - url: "/post", - hostname: "httpbin.org", - }, {}) - - cy.visit( - "/?url=/documents/features/oas3-multiple-media-type.yaml" - ) - .get("#operations-default-post_post") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // @alias Execute Button - cy.get(".execute.opblock-control__btn").as("executeBtn") - // @alias Media Type Dropdown - cy.get(".opblock-section-request-body .content-type").as("selectMediaType") - }) - - // In all cases, - // - assume that examples are populated based on schema (not explicitly tested) - // - assume validation passes based on successful "execute" - // - expect final cURL command result doees not contain unexpected artifacts from other content-type schemas - describe("multipart/form-data (only 'bar')", () => { - it("should execute multipart/form-data", () => { - cy.get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeFormData) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "bar") - .should("not.contains.text", "foo") - }) - it("should execute application/x-www-form-urlencoded THEN execute multipart/form-data", () => { - cy.get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeFormData) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "bar") - .should("not.contains.text", "foo") - }) - it("should execute application/json THEN execute multipart/form-data", () => { - cy.get("@selectMediaType") - .select(mediaTypeJson) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeFormData) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "bar") - .should("not.contains.text", "foo") - }) - }) - - describe("application/x-www-form-urlencoded (only 'foo')", () => { - it("should execute application/x-www-form-urlencoded", () => { - cy.get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("not.contains.text", "bar") - }) - it("should execute multipart/form-data THEN execute application/x-www-form-urlencoded", () => { - cy.get("@selectMediaType") - .select(mediaTypeFormData) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("not.contains.text", "bar") - }) - it("should execute application/json THEN execute application/x-www-form-urlencoded", () => { - cy.get("@selectMediaType") - .select(mediaTypeJson) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("not.contains.text", "bar") - }) - }) - - describe("application/json (both 'foo' and 'bar')", () => { - // note: form input for "application/json" is a string; not multiple form fields - it("should execute application/json", () => { - // final curl should have both "bar" and "foo" - cy.get("@selectMediaType") - .select(mediaTypeJson) - .get("@executeBtn") - .click() - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("contains.text", "bar") - }) - it("should execute multipart/form-data THEN execute application/json", () => { - cy.get("@selectMediaType") - .select(mediaTypeFormData) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeJson) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("contains.text", "bar") - }) - it("should execute application/x-www-form-urlencoded THEN execute application/json", () => { - // final curl should have both "bar" and "foo" - cy.get("@selectMediaType") - .select(mediaTypeUrlencoded) - .get("@executeBtn") - .click() - .get("@selectMediaType") - .select(mediaTypeJson) - .get("@executeBtn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "foo") - .should("contains.text", "bar") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-multiple-servers.cy.js b/test/e2e-cypress/e2e/features/oas3-multiple-servers.cy.js deleted file mode 100644 index de4cb39f99d..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-multiple-servers.cy.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 Multiple Servers", () => { - it("should render and execute for server '/test-url-1'", () => { - cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml") - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-1") - .get("#operations-default-get_") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - .get(".responses-wrapper .request-url") - .should("contains.text", "/test-url-1") - }) - it("should render and execute for server '/test-url-2'", () => { - cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml") - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-2") - .get("#operations-default-get_") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - .get(".responses-wrapper .request-url") - .should("contains.text", "/test-url-2") - }) - it("should render and execute for server '/test-url-1' after sequence: select '/test-url-2' -> Try-It-Out -> select '/test-url-1'", () => { - cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml") - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-2") - .get("#operations-default-get_") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Select a different server - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-1") - // Execute - .get(".execute.opblock-control__btn") - .click() - .get(".responses-wrapper .request-url") - .should("contains.text", "/test-url-1") - }) - it("should render and execute for server '/test-url-switch-1' after changing api definition", () => { - cy.visit("/?url=/documents/features/oas3-multiple-servers.yaml") - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-2") - cy.visit("/?url=/documents/features/oas3-multiple-servers-switch.yaml") - .get(".scheme-container .schemes .servers label > select") - .select("/test-url-switch-2") - .get("#operations-default-get_") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - .get(".responses-wrapper .request-url") - .should("contains.text", "/test-url-switch-2") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-request-body-allow-empty-values.cy.js b/test/e2e-cypress/e2e/features/oas3-request-body-allow-empty-values.cy.js deleted file mode 100644 index d487cf522d0..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-request-body-allow-empty-values.cy.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 Allow Empty Values in Request Body", () => { - it("should not apply or render to required fields", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Request Body - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .should("not.exist") - }) - - it("by default, should be checked for all non-required fields", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Request Body - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove" - ) - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .should("be.checked") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select" - ) - .select("--") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .should("be.checked") - }) - - it("checkbox should be toggle-able", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Request Body - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove" - ) - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .should("be.checked") - .uncheck() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .should("not.be.checked") - }) - - it("on execute, should allow send with all empty values", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Remove example values - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove" - ) - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select" - ) - .select("--") - // Execute - .get(".execute.opblock-control__btn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "tags=&status=") - }) - - it("on execute, should allow send with some empty values", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Request Body - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove" - ) - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .uncheck() - // add item to pass required validation - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(4) input" - ) - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "&status=") - .should("not.contains.text", "tags=") - }) - - it("on execute, should allow send with skip all empty values", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Request Body - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .json-schema-form-item-remove" - ) - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(5) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .uncheck() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description select" - ) - .select("--") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(6) > .parameters-col_description .parameter__empty_value_toggle input" - ) - .uncheck() - // Execute - .get(".execute.opblock-control__btn") - .click() - // cURL component - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("not.contains.text", "tags=") - .should("not.contains.text", "status=") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-request-body-default-views.cy.js b/test/e2e-cypress/e2e/features/oas3-request-body-default-views.cy.js deleted file mode 100644 index d75c86a5e9a..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-request-body-default-views.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -describe("OAS3 default views", () => { - describe("multipart/form-data", () => { - it("should display calculated object string, when no examples provided (#7268)", () => { - cy.visit( - "/?url=/documents/features/request-body/multipart/default-views.yaml", - ) - .get("#operations-default-post_test") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description textarea") - .should("contains.text", "\"stuff\": \"string\"") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-request-body-required.cy.js b/test/e2e-cypress/e2e/features/oas3-request-body-required.cy.js deleted file mode 100644 index 4da95e67f3c..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-request-body-required.cy.js +++ /dev/null @@ -1,252 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 Validation for Required Request Body and Request Body Fields", () => { - describe("Request Body required bug/5181", () => { - beforeEach(() => { - cy.intercept( - { - method: "POST", - url: "/anything/foos", - hostname: "httpbin.org", - }, - {} - ) - }) - - it("on execute, if empty value, SHOULD render class 'invalid' and should NOT render cURL component", () => { - cy.visit("/?url=/documents/bugs/5181.yaml") - .get("#operations-default-post_foos") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // get input - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(1) > .parameters-col_description input" - ) - .clear() - .should("not.have.class", "invalid") - // Execute - .get(".execute.opblock-control__btn") - .click() - // class "invalid" should now exist (and render red, which we won't check) - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(1) > .parameters-col_description input" - ) - .should("have.class", "invalid") - // cURL component should not exist - .get(".responses-wrapper .curl-command") - .should("not.exist") - }) - it("on execute, if value exists, should NOT render class 'invalid' and SHOULD render cURL component", () => { - cy.visit("/?url=/documents/bugs/5181.yaml") - .get("#operations-default-post_foos") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // get input - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(1) > .parameters-col_description input" - ) - .type("abc") - // Execute - .get(".execute.opblock-control__btn") - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(1) > .parameters-col_description input" - ) - .should("not.have.class", "invalid") - // cURL component should exist - .get(".responses-wrapper .curl-command") - .should("exist") - }) - }) - - describe("Request Body required fields - application/json", () => { - it("on execute, if empty value, SHOULD render class 'invalid' and should NOT render cURL component", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // get and clear textarea - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("not.have.class", "invalid") - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - // class "invalid" should now exist (and render red, which we won't check) - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("have.class", "invalid") - // cURL component should not exist - .get(".responses-wrapper .curl-command") - .should("not.exist") - }) - it("on execute, if value exists, even if just single space, should NOT render class 'invalid' and SHOULD render cURL component that contains the single space", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // get, clear, then modify textarea - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .clear() - .type(" ") - // Execute - .get(".execute.opblock-control__btn") - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("not.have.class", "invalid") - // cURL component should exist - .get(".responses-wrapper .curl-command") - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "' '") - }) - }) - - /* - petstore ux notes: - - required field, but if example value exists, will populate the field. So this test will clear the example value. - - "add item" will insert an empty array, and display an input text box. This establishes a value for the field. - */ - describe("Request Body required fields - application/x-www-form-urlencoded", () => { - it("on execute, if empty value, SHOULD render class 'invalid' and should NOT render cURL component", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // get and clear input populated from example value - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - // class "invalid" should now exist (and render red, which we won't check) - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .should("have.class", "invalid") - // cURL component should not exist - .get(".responses-wrapper .curl-command") - .should("not.exist") - }) - it("on execute, if all values exist, even if array exists but is empty, should NOT render class 'invalid' and SHOULD render cURL component", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .should("have.value", "doggie") - .should("not.have.class", "invalid") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(4) > .parameters-col_description input" - ) - .should("have.value", "string") - .should("not.have.class", "invalid") - // cURL component should exist - .get(".responses-wrapper .curl-command") - .should("exist") - }) - }) - - describe("Request Body: switching between Content Types", () => { - it("after application/json 'invalid' error, on switch content type to application/x-www-form-urlencoded, SHOULD be free of errors", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // get and clear textarea - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("not.have.class", "invalid") - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("have.class", "invalid") - // switch content type - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .should("not.have.class", "invalid") - }) - it("after application/x-www-form-urlencoded 'invalid' error, on switch content type to application/json, SHOULD be free of errors", () => { - cy.visit("/?url=/documents/features/petstore-only-pet.openapi.yaml") - .get("#operations-pet-addPet") - .click() - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/x-www-form-urlencoded") - // Expand Try It Out - .get(".try-out__btn") - .click() - // get and clear input - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - // class "invalid" should now exist (and render red, which we won't check) - .get( - ".opblock-body .opblock-section .opblock-section-request-body .parameters:nth-child(2) > .parameters-col_description input" - ) - .should("have.class", "invalid") - // switch content type - .get( - ".opblock-section .opblock-section-request-body .body-param-content-type > select" - ) - .select("application/json") - .get( - ".opblock-body .opblock-section .opblock-section-request-body .body-param textarea" - ) - .should("not.have.class", "invalid") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-user-edit-request-body-flows.cy.js b/test/e2e-cypress/e2e/features/oas3-user-edit-request-body-flows.cy.js deleted file mode 100644 index 2a213a72a11..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-user-edit-request-body-flows.cy.js +++ /dev/null @@ -1,106 +0,0 @@ -function getExpandedTryout(page = null, operationId = "#operations-pet-addPet") { - return (page || cy.visit( - "/?url=/documents/features/petstore-only-pet.openapi.yaml", - )) - .get(operationId) - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() -} - -const getRequestBodyFromCY = (page = null, operationId = "#operations-pet-addPet") => - getExpandedTryout(page, operationId) - // get textarea - .get(".opblock-body .opblock-section .opblock-section-request-body .body-param textarea") - -const xmlIndicator = "\n" -const userEditXmlSample = xmlIndicator + - "\n" + - "\t420\n" + - "\tdoggie<3\n" + - "\t\n" + - "\t\t99999999999\n" + - "\t\tDogiiiiiiiieeee\n" + - "\t\n" + - "\t\n" + - "\t\tstring\n" + - "\t\n" + - "\t\n" + - "\t\t\n" + - "\t\t\t0\n" + - "\t\t\tstring\n" + - "\t\t\n" + - "\t\n" + - "\tavailable\n" + - "" - -describe("OAS3 Request Body user edit flows", () => { - // Case: Copy xml from email, paste into request body editor, change media-type to xml - it("it should never overwrite user edited value in case of media-type change", () => { - getRequestBodyFromCY() - // replace default sample with xml edited value - .type(`{selectall}${userEditXmlSample}`) - // change media type to xml, because I have forgotten it - .get(".opblock-section .opblock-section-request-body .body-param-content-type > select") - .select("application/xml") - // Ensure user edited body is not overwritten - .get(".opblock-section-request-body") - .within(() => { - cy - .get("textarea") - .should(($div) => { - expect($div.get(0).textContent).to.eq(userEditXmlSample) - }) - }) - }) - // Case: User really wants to try out the brand new xml content-type - it("it should overwrite default value in case of content-type change, even within request body editor(#6836)", () => { - getRequestBodyFromCY() - // change media type to xml, because I have forgotten it (sry really wanted to try out the new xml content-type) - .get(".opblock-section .opblock-section-request-body .body-param-content-type > select") - .select("application/xml") - // Ensure default value is xml after content type change - .get(".opblock-section-request-body") - .within(() => { - cy - .get("textarea") - .should(($div) => { - expect($div.get(0).textContent).to.contain(xmlIndicator) - }) - }) - }) - // Case: User wants to get the default value back - it("it reset the user edited value and render the default value in case of try out reset. (#6517)", () => { - getRequestBodyFromCY() - // replace default sample with bad value - .type("{selectall}ups that should not have happened") - // Cancel Try It Out - .get(".try-out__btn.reset") - .click() - // Ensure default value is xml after content type change - .get(".opblock-section-request-body") - .within(() => { - cy - .get("textarea") - .should(($div) => { - expect($div.get(0).textContent).to.not.contain("ups that should not have happened") - }) - }) - }) - describe("multipart/", () => { - // Case: User wants to execute operation with media-type multipart/ with a enum property. The user expects the first enum value to be used when executed. - it("should use the first enum value on execute if not changed by user (#6976)", () => { - // test/e2e-cypress/static/documents/features/request-body/multipart/enum.yaml - getExpandedTryout( - cy.visit( - "/?url=/documents/features/request-body/multipart/enum.yaml", - ), "#operations-default-post_test") - .get(".execute") - .click() - // Assert on the request URL - .get(".curl") - .contains("test_enum=A") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas3-xml.cy.js b/test/e2e-cypress/e2e/features/oas3-xml.cy.js deleted file mode 100644 index e7f28369536..00000000000 --- a/test/e2e-cypress/e2e/features/oas3-xml.cy.js +++ /dev/null @@ -1,70 +0,0 @@ -describe("XML schema rendering examples", () => { - it("Should render RequestBody example value when schema contains `oneOf` for mediaType `text/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foo") - .click() - .get("label > .content-type-wrapper > .content-type option:selected") - .should("have.text", "text/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render RequestBody example value when schema contains `anyOf` for mediaType `text/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_bar") - .click() - .get("label > .content-type-wrapper > .content-type option:selected") - .should("have.text", "text/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render RequestBody example value when schema contains `oneOf` for mediaType `application/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foobar") - .click() - .get("label > .content-type-wrapper > .content-type option:selected") - .should("have.text", "application/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render RequestBody example value when schema contains `anyOf` for mediaType `application/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_barfoo") - .click() - .get("label > .content-type-wrapper > .content-type option:selected") - .should("have.text", "application/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render RequestBody example value when switching mediaType to `text/xml` with singular content schema", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_barfoo") - .click() - .get("label > .content-type-wrapper > .content-type") - .select("text/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render RequestBody example value when switching mediaType to `application/xml` with singular content schema", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foo") - .click() - .get("label > .content-type-wrapper > .content-type") - .select("application/xml") - .get(".body-param__example") - .should("contains.text", "") - }) - it("Should render Response example value for mediaType `application/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foo") - .click() - .get(".response-col_description > .model-example") - .should("contains.text", "") - }) - it("Should render Response example value for mediaType `text/xml`", () => { - cy.visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foobar") - .click() - .get(".response-col_description > .model-example") - .should("contains.text", "") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas31-auth-mutual-tls.cy.js b/test/e2e-cypress/e2e/features/oas31-auth-mutual-tls.cy.js deleted file mode 100644 index 6bd657301f1..00000000000 --- a/test/e2e-cypress/e2e/features/oas31-auth-mutual-tls.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -describe("MutualTLS Authorization", () => { - - it("should open authorization popup", () => { - cy.visit( - "/?url=/documents/security/mutual-tls.yaml" - ) - .get("button.authorize") - .click() - .get(".auth-container h4") - .contains("mutual (mutualTLS)") - }) - it("should have description given by user", () => { - cy.visit( - "/?url=/documents/security/mutual-tls.yaml" - ) - .get("button.authorize") - .click() - .get(".auth-container p:nth-of-type(2)") - .contains("Mutual TLS description") - }) - it("should not display Authorize or Logout buttons", () => { - cy.visit( - "/?url=/documents/security/mutual-tls.yaml" - ) - .get("button.authorize") - .click() - .get(".auth-button-wrapper") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas31-extension.cy.js b/test/e2e-cypress/e2e/features/oas31-extension.cy.js deleted file mode 100644 index a8ef4269816..00000000000 --- a/test/e2e-cypress/e2e/features/oas31-extension.cy.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @prettier - */ - -const showsExtensions = (keyword) => { - it("extensions are visible on keyword click", () => { - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-primitiveExtension") - .should("not.be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-arrayExtension") - .should("not.be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-objectExtension") - .should("not.be.visible") - - cy.get(".json-schema-2020-12-keyword__name").contains(keyword).click() - - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-primitiveExtension") - .should("be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-arrayExtension") - .should("be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-objectExtension") - .should("be.visible") - }) -} - -describe("OpenAPI 3.1 extension keyword", () => { - describe("displays extensions", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas31-extension.yaml&showExtensions=true" - ) - }) - - describe("Discriminator extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - }) - showsExtensions("Discriminator") - }) - - describe("External documentation extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("Object").click() - }) - showsExtensions("External documentation") - }) - - describe("XML extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("Book").click() - }) - showsExtensions("XML") - }) - }) - - it("should hide extensions if showExtensions option is set to false", () => { - cy.visit( - "/?url=/documents/features/oas31-extension.yaml&showExtensions=false" - ) - cy.get(".json-schema-2020-12").contains("Object").click() - cy.get(".json-schema-2020-12-keyword__name") - .contains("External documentation") - .click() - - cy.get(".json-schema-2020-12-keyword__name--secondary") - .contains("url") - .should("be.visible") - - cy.contains("x-primitiveExtension").should("not.exist") - cy.contains("x-arrayExtension").should("not.exist") - cy.contains("x-objectExtension").should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32-contact-and-license.cy.js b/test/e2e-cypress/e2e/features/oas32-contact-and-license.cy.js deleted file mode 100644 index 0c7aca1c21e..00000000000 --- a/test/e2e-cypress/e2e/features/oas32-contact-and-license.cy.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @prettier - */ -describe("Render Contact and License in OAS 3.2.0", () => { - const baseUrl = "/?url=/documents/oas32/contact-and-license.yaml" - - it("should render contact with all fields", () => { - cy.visit(baseUrl) - .get(".info__contact") - .should("exist") - .find("a") - .first() - .should("contain.text", "API Support Team") - .should("have.attr", "href", "https://www.example.com/support") - .should("have.attr", "rel") - .and("include", "noopener") - }) - - it("should render license with all fields", () => { - cy.visit(baseUrl) - .get(".info__license") - .should("exist") - .get(".info__license__url") - .should("contain.text", "Apache 2.0") - .find("a") - .should( - "have.attr", - "href", - "https://www.apache.org/licenses/LICENSE-2.0.html" - ) - .should("have.attr", "rel") - .and("include", "noopener") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32-extension.cy.js b/test/e2e-cypress/e2e/features/oas32-extension.cy.js deleted file mode 100644 index 373bb2ff08b..00000000000 --- a/test/e2e-cypress/e2e/features/oas32-extension.cy.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @prettier - */ - -const showsExtensions = (keyword) => { - it("extensions are visible on keyword click", () => { - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-primitiveExtension") - .should("not.be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-arrayExtension") - .should("not.be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-objectExtension") - .should("not.be.visible") - - cy.get(".json-schema-2020-12-keyword__name").contains(keyword).click() - - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-primitiveExtension") - .should("be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-arrayExtension") - .should("be.visible") - cy.get(".json-schema-2020-12-json-viewer__name") - .contains("x-objectExtension") - .should("be.visible") - }) -} - -describe("OpenAPI 3.2 extension keyword", () => { - describe("displays extensions", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas32-extension.yaml&showExtensions=true" - ) - }) - - describe("Discriminator extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - }) - showsExtensions("Discriminator") - }) - - describe("External documentation extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("Object").click() - }) - showsExtensions("External documentation") - }) - - describe("XML extension", () => { - beforeEach(() => { - cy.get(".json-schema-2020-12").contains("Book").click() - }) - showsExtensions("XML") - }) - }) - - it("should hide extensions if showExtensions option is set to false", () => { - cy.visit( - "/?url=/documents/features/oas32-extension.yaml&showExtensions=false" - ) - cy.get(".json-schema-2020-12").contains("Object").click() - cy.get(".json-schema-2020-12-keyword__name") - .contains("External documentation") - .click() - - cy.get(".json-schema-2020-12-keyword__name--secondary") - .contains("url") - .should("be.visible") - - cy.contains("x-primitiveExtension").should("not.exist") - cy.contains("x-arrayExtension").should("not.exist") - cy.contains("x-objectExtension").should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32-query-operation.cy.js b/test/e2e-cypress/e2e/features/oas32-query-operation.cy.js deleted file mode 100644 index b79247b783a..00000000000 --- a/test/e2e-cypress/e2e/features/oas32-query-operation.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2 QUERY operation rendering", () => { - const baseUrl = "/?url=/documents/features/oas32-query-operation.yaml" - - it("should render QUERY operation with all fields", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .should("exist") - .find(".opblock-summary-method") - .should("contain", "QUERY") - .get("#operations-Search-searchWithQuery") - .click() - .should("have.class", "is-open") - .find(".opblock-body") - .should("exist") - }) - - it("should render multiple operations including QUERY", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchProducts") - .should("exist") - .get("#operations-Search-advancedSearchProducts") - .should("exist") - .get("#operations-Search-searchWithQuery") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32/oas32-component-only.cy.js b/test/e2e-cypress/e2e/features/oas32/oas32-component-only.cy.js deleted file mode 100644 index 2c8fbb712c8..00000000000 --- a/test/e2e-cypress/e2e/features/oas32/oas32-component-only.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2.0 - Component-Only Specification", () => { - const baseUrl = "/?url=/documents/oas32/component-only.yaml" - - it("should render component-only spec with all fields", () => { - cy.visit(baseUrl) - .get(".version-pragma__message--missing") - .should("not.exist") - .get(".information-container") - .should("exist") - .find(".title") - .should("contain", "Component-Only Specification") - .get(".information-container .description") - .should("contain", "valid OAS 3.2.0 specification") - .get(".opblock-tag-section") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32/oas32-query-operation.cy.js b/test/e2e-cypress/e2e/features/oas32/oas32-query-operation.cy.js deleted file mode 100644 index 6df62d3140c..00000000000 --- a/test/e2e-cypress/e2e/features/oas32/oas32-query-operation.cy.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @prettier - */ -describe("OAS 3.2 QUERY Operation Support", () => { - const baseUrl = "/?url=/documents/features/oas32-query-operation.yaml" - - describe("QUERY Operation Rendering", () => { - it("should render QUERY operation in the operations list", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .should("exist") - }) - - it("should display QUERY method with correct styling", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .should("have.class", "opblock-query") - }) - - it("should render QUERY operation summary", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .within(() => { - cy.get(".opblock-summary-description").should( - "contain.text", - "Search with complex query payload" - ) - }) - }) - - it("should display QUERY badge/label", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .within(() => { - cy.get(".opblock-summary-method").should("contain.text", "QUERY") - }) - }) - }) - - describe("QUERY Operation Expansion", () => { - it("should expand QUERY operation when clicked", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .should("have.class", "is-open") - }) - - it("should display operation description when expanded", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .within(() => { - cy.get(".opblock-description-wrapper").should("exist") - cy.get(".renderedMarkdown").should( - "contain.text", - "QUERY HTTP method" - ) - }) - }) - }) - - describe("QUERY Operation Request Body", () => { - it("should render request body section", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".opblock-section-request-body") - .should("exist") - }) - - it("should show request body is required", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".opblock-section-request-body") - .should("exist") - .within(() => { - cy.get(".opblock-description-wrapper").should("exist") - }) - }) - - it("should render request body schema with properties", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy.contains("query").should("exist") - cy.contains("filters").should("exist") - cy.contains("pagination").should("exist") - }) - }) - }) - - describe("QUERY Operation Responses", () => { - it("should render response section", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".responses-wrapper") - .should("exist") - }) - - it("should display 200 response", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".responses-wrapper") - .within(() => { - cy.contains("200").should("exist") - cy.contains("Search results").should("exist") - }) - }) - - it("should display error responses", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchWithQuery") - .click() - .get(".responses-wrapper") - .within(() => { - cy.contains("400").should("exist") - cy.contains("413").should("exist") - }) - }) - }) - - describe("Mixed Operations on Same Path", () => { - it("should render both GET and QUERY operations for /products/search", () => { - cy.visit(baseUrl) - cy.get("#operations-Search-searchProducts").should("exist") - cy.get("#operations-Search-advancedSearchProducts").should("exist") - }) - - it("should distinguish GET and QUERY operations visually", () => { - cy.visit(baseUrl) - cy.get("#operations-Search-searchProducts") - .should("have.class", "opblock-get") - .within(() => { - cy.get(".opblock-summary-method").should("contain.text", "GET") - }) - - cy.get("#operations-Search-advancedSearchProducts") - .should("have.class", "opblock-query") - .within(() => { - cy.get(".opblock-summary-method").should("contain.text", "QUERY") - }) - }) - - it("should show GET operation with query parameters", () => { - cy.visit(baseUrl) - .get("#operations-Search-searchProducts") - .click() - .within(() => { - cy.contains("Parameters").should("exist") - cy.contains("q").should("exist") - }) - }) - - it("should show QUERY operation with request body", () => { - cy.visit(baseUrl) - .get("#operations-Search-advancedSearchProducts") - .click() - .get(".opblock-section-request-body") - .should("exist") - .within(() => { - cy.contains("priceRange").should("exist") - cy.contains("specifications").should("exist") - }) - }) - }) - - describe("OAS Version Detection", () => { - it("should display OAS 3.2 badge", () => { - cy.visit(baseUrl) - .get(".info .version-stamp") - .contains("OAS 3.2") - .should("exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/oas32/oas32-version-detection.cy.js b/test/e2e-cypress/e2e/features/oas32/oas32-version-detection.cy.js deleted file mode 100644 index e75f0aeaefa..00000000000 --- a/test/e2e-cypress/e2e/features/oas32/oas32-version-detection.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2.0 - Version Detection", () => { - const baseUrl = "/?url=/documents/oas32/oas32-features.yaml" - - it("should detect and render OAS 3.2.0 spec with all info fields", () => { - cy.visit(baseUrl) - .get(".information-container") - .should("exist") - .find(".title") - .should("contain", "OAS 3.2.0 Basic Features") - .get(".information-container .description") - .should("contain", "basic features implemented for OpenAPI 3.2.0") - .get(".information-container .info__summary") - .should("contain", "Demonstrates basic OpenAPI 3.2.0 implementation") - .get(".version-pragma__message--missing") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js b/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js deleted file mode 100644 index 7820b5cceae..00000000000 --- a/test/e2e-cypress/e2e/features/oauth2-flows/application.cy.js +++ /dev/null @@ -1,71 +0,0 @@ -describe("OAuth2 Application flow", function() { - beforeEach(() => { - cy.intercept("POST", "**/oauth/*").as("tokenRequest") - }) - - // https://github.com/swagger-api/swagger-ui/issues/6395 - it("should have first authorization input autofocused", () => { - cy - .visit("/?url=http://localhost:3231/swagger.yaml") - .get(".btn.authorize") - .click() - - cy.focused() - .should("have.id", "oauth_username") - }) - - it("should have specific OAuth2 description for authorization button", () => { - cy - .visit("/?url=http://localhost:3231/swagger.yaml") - .get(".btn.authorize") - .click() - .get(".auth-btn-wrapper > .authorize") - .should("have.attr", "aria-label", "Apply given OAuth2 credentials") - }) - - it("should make an application flow Authorization header request", () => { - cy - .visit("/?url=http://localhost:3231/swagger.yaml") - .get(".btn.authorize") - .click() - - .get("div.modal-ux-content > div:nth-child(2)").within(() => { - cy.get("#client_id_application") - .clear() - .type("confidentialApplication") - - .get("#client_secret_application") - .clear() - .type("topSecret") - - .get("button.btn.modal-btn.auth.authorize.button") - .click() - }) - - cy.get("button.close-modal") - .click() - - .get("#operations-default-get_application") - .click() - - .get(".btn.try-out__btn") - .click() - - .get(".btn.execute") - .click() - - cy.get("@tokenRequest") - .its("request") - .its("body") - .should("equal", "grant_type=client_credentials") - - cy.get("@tokenRequest") - .its("request") - .its("headers") - .its("authorization") - .should("equal", "Basic Y29uZmlkZW50aWFsQXBwbGljYXRpb246dG9wU2VjcmV0") - - .get(".live-responses-table .response-col_status") - .contains("200") - }) -}) diff --git a/test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js b/test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js deleted file mode 100644 index 7adead541ba..00000000000 --- a/test/e2e-cypress/e2e/features/oauth2-flows/password.cy.js +++ /dev/null @@ -1,118 +0,0 @@ -describe("OAuth2 Password flow", function() { - beforeEach(() => { - cy.intercept("POST", "**/oauth/*").as("tokenRequest") - }) - - it("should make a password flow Authorization header request", () => { - cy - .visit("/?url=http://localhost:3231/swagger.yaml") - .get(".btn.authorize") - .click() - - .get("#oauth_username") - .type("swagger") - - .get("#oauth_password") - .type("password") - - .get("#password_type") - .select("basic") - - .get("#client_id_password") - .clear() - .type("application") - - .get("#client_secret_password") - .clear() - .type("secret") - - .get("div.modal-ux-content > div:nth-child(1) > div > div:nth-child(2) > div > div.auth-btn-wrapper > button.btn.modal-btn.auth.authorize.button") - .click() - - .get("button.close-modal") - .click() - - .get("#operations-default-get_password") - .click() - - .get(".btn.try-out__btn") - .click() - - .get(".btn.execute") - .click() - - cy.get("@tokenRequest") - .its("request") - .its("body") - .should("include", "grant_type=password") - .should("include", "username=swagger") - .should("include", "password=password") - .should("not.include", "client_id") - .should("not.include", "client_secret") - - cy.get("@tokenRequest") - .its("request") - .its("headers") - .its("authorization") - .should("equal", "Basic YXBwbGljYXRpb246c2VjcmV0") - - .get(".live-responses-table .response-col_status") - .contains("200") - }) - - it("should make a Password flow request-body request", () => { - cy - .visit("/?url=http://localhost:3231/swagger.yaml") - .get(".btn.authorize") - .click() - - .get("#oauth_username") - .type("swagger") - - .get("#oauth_password") - .type("password") - - .get("#password_type") - .select("request-body") - - .get("#client_id_password") - .clear() - .type("application") - - .get("#client_secret_password") - .clear() - .type("secret") - - .get("div.modal-ux-content > div:nth-child(1) > div > div:nth-child(2) > div > div.auth-btn-wrapper > button.btn.modal-btn.auth.authorize.button") - .click() - - .get("button.close-modal") - .click() - - .get("#operations-default-get_password") - .click() - - .get(".btn.try-out__btn") - .click() - - .get(".btn.execute") - .click() - - cy.get("@tokenRequest") - .its("request") - .its("body") - .should("include", "grant_type=password") - .should("include", "username=swagger") - .should("include", "password=password") - .should("include", "client_id=application") - .should("include", "client_secret=secret") - - cy.get("@tokenRequest") - .its("request") - .its("headers") - .should("not.have.property", "authorization") - - .get(".live-responses-table .response-col_status") - .contains("200") - }) -}) diff --git a/test/e2e-cypress/e2e/features/operations-virtualization.cy.js b/test/e2e-cypress/e2e/features/operations-virtualization.cy.js deleted file mode 100644 index 77ce4d30c74..00000000000 --- a/test/e2e-cypress/e2e/features/operations-virtualization.cy.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @prettier - */ -import { - VIRTUALIZE_OPERATIONS_TAG_ESTIMATE_SIZE, - VIRTUALIZE_OPERATIONS_ESTIMATE_SIZE, -} from "core/utils/virtualization" - -describe("Operations list virtualization", () => { - describe("non-virtualized path", () => { - it("renders .opblock-tag-section wrappers and all operations", () => { - cy.visit("/?url=/documents/features/deep-linking.swagger.yaml") - cy.get(".opblock-tag-section").should("exist") - cy.get(".opblock").should("have.length", 5) - }) - }) - - describe("virtualized path", () => { - const baseUrl = "/?url=/documents/perf/many-operations.yaml" - - it("does not render .opblock-tag-section wrappers", () => { - cy.visit(baseUrl) - cy.get("#operations-tag-perfTag01").should("exist") - cy.get(".opblock-tag-section").should("not.exist") - }) - - it("mounts only a windowed subset of operations", () => { - cy.visit(baseUrl) - cy.get("#operations-tag-perfTag01").should("exist") - cy.get(".opblock").should("have.length.lessThan", 529) - }) - - it("scrolling renders new items and unmounts old ones", () => { - cy.visit(baseUrl) - cy.get("#operations-perfTag01-perfOp01_01").should("exist") - cy.scrollTo("bottom") - cy.wait(200) - cy.get("#operations-perfTag24-perfOp24_22").should("exist") - cy.get("#operations-perfTag01-perfOp01_01").should("not.exist") - }) - - it("collapsing a tag removes its operations, expanding restores them", () => { - cy.visit(baseUrl) - cy.get("#operations-tag-perfTag01[data-is-open='true']").should("exist") - cy.get("#operations-perfTag01-perfOp01_01").should("exist") - - cy.get("#operations-tag-perfTag01").click() - cy.get("#operations-tag-perfTag01[data-is-open='false']").should("exist") - cy.get("#operations-perfTag01-perfOp01_01").should("not.exist") - - cy.get("#operations-tag-perfTag01").click() - cy.get("#operations-tag-perfTag01[data-is-open='true']").should("exist") - cy.get("#operations-perfTag01-perfOp01_01").should("exist") - }) - - it("expanding an operation does not reset on scroll", () => { - cy.visit(baseUrl) - cy.get("#operations-tag-perfTag01[data-is-open='true']").should("exist") - - cy.get(".opblock").first().as("firstOp") - cy.get("@firstOp").find(".opblock-summary").click() - cy.get("@firstOp").find(".opblock-body").should("be.visible") - - cy.scrollTo("bottom") - cy.wait(300) - cy.scrollTo("top") - cy.wait(300) - - cy.get(".opblock").first().find(".opblock-body").should("be.visible") - }) - - it("multi-tag operation is rendered under both of its tags", () => { - cy.visit(baseUrl) - cy.get("#operations-tag-perfTag01").should("exist") - - // perfTag01 header + 22 regular ops before multiTagged - const multiTaggedUnderTag01 = - VIRTUALIZE_OPERATIONS_TAG_ESTIMATE_SIZE + - 22 * VIRTUALIZE_OPERATIONS_ESTIMATE_SIZE - cy.window().then((win) => win.scrollTo(0, multiTaggedUnderTag01)) - cy.wait(200) - cy.get("#operations-perfTag01-multiTagged").should("exist") - cy.get("#operations-perfTag01-multiTagged") - .find(".opblock-summary") - .click() - cy.get("#operations-perfTag01-multiTagged") - .find(".opblock-body") - .should("be.visible") - - // scroll past first multiTagged and through perfTag02 to its multiTagged - cy.window().then((win) => - win.scrollTo( - 0, - 2 * multiTaggedUnderTag01 + VIRTUALIZE_OPERATIONS_ESTIMATE_SIZE - ) - ) - cy.wait(200) - cy.get("#operations-perfTag02-multiTagged").should("exist") - cy.get("#operations-perfTag02-multiTagged") - .find(".opblock-body") - .should("not.exist") - }) - }) - - describe("deep linking", () => { - it("deep link to an operation scrolls to it", () => { - cy.visit( - "/?deepLinking=true&url=/documents/perf/many-operations.yaml#/perfTag15/perfOp15_01" - ) - cy.get("#operations-tag-perfTag15[data-is-open='true']", { - timeout: 8000, - }).should("exist") - }) - - it("deep link to a tag header scrolls to it", () => { - cy.visit( - "/?deepLinking=true&url=/documents/perf/many-operations.yaml#/perfTag15" - ) - cy.get("#operations-tag-perfTag15", { timeout: 8000 }).should("exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/parameter-array-missing-items.cy.js b/test/e2e-cypress/e2e/features/parameter-array-missing-items.cy.js deleted file mode 100644 index b6b3b22e19a..00000000000 --- a/test/e2e-cypress/e2e/features/parameter-array-missing-items.cy.js +++ /dev/null @@ -1,10 +0,0 @@ -describe("Parameter - Invalid definition with missing array 'items' (#7375)", () => { - it("should render gracefully with fallback to default value", () => { - cy.visit("/?url=/documents/features/parameter-array-missing-items.yaml") - .get("#operations-default-get_example1") - .click() - .get("tbody > tr > .parameters-col_description textarea") - .should("exist") - .should("contains.text", "{}") - }) -}) diff --git a/test/e2e-cypress/e2e/features/parameter-order.cy.js b/test/e2e-cypress/e2e/features/parameter-order.cy.js deleted file mode 100644 index f6509292ac8..00000000000 --- a/test/e2e-cypress/e2e/features/parameter-order.cy.js +++ /dev/null @@ -1,30 +0,0 @@ -describe("Parameter order", () => { - - it("should be well ordered", () => { - cy.visit("/?url=/documents/features/parameter-order.yaml") - .get("#operations-default-post_test__id__related__relatedId_") - .click() - .get(".parameters > tbody") - .children() - .each((tr, i, arr) => { - const parameterTableRows = Array.from(arr) - expect(tr).to.have.attr("data-param-in") - if (i === 0) { - return - } - const inValue = tr[0].getAttribute("data-param-in") - if (!inValue) { - return - } - const beforeInValue = parameterTableRows[i - 1].getAttribute("data-param-in") - const sameAsBefore = beforeInValue === inValue - if (sameAsBefore) { - expect(parameterTableRows[i - 1]).to.have.attr("data-param-in", inValue) - return - } - for (let x = i + 1; x < parameterTableRows.length; x++) { - expect(parameterTableRows[x]).to.not.have.attr("data-param-in", beforeInValue) - } - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/parameter-schema.cy.js b/test/e2e-cypress/e2e/features/parameter-schema.cy.js deleted file mode 100644 index 2a42e3e63fb..00000000000 --- a/test/e2e-cypress/e2e/features/parameter-schema.cy.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @prettier - */ - -describe("Operation parameters", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/parameter-schema.yaml") - }) - - it("should render example for parameters of type object", () => { - cy.get(".opblock-summary-path span").contains("/object").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for parameters of type object", () => { - cy.get(".opblock-summary-path span").contains("/object").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .model").should("exist") - }) - - it("should render example for parameters of type array of objects", () => { - cy.visit("/?url=/documents/features/parameter-schema.yaml") - - cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for parameters of type array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .model").should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/parameters-one-of-any-of.cy.js b/test/e2e-cypress/e2e/features/parameters-one-of-any-of.cy.js deleted file mode 100644 index df6dc92a7f9..00000000000 --- a/test/e2e-cypress/e2e/features/parameters-one-of-any-of.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @prettier - */ - -describe("Parameter with oneOf and anyOf keywords in OpenAPI 3.0.x", () => { - it("should render correct form fields", () => { - cy.visit("/?url=/documents/features/parameters-one-of-any-of-oas3.yaml") - .get("#operations-default-get_") - .click() - cy.get(".parameters-col_description") - .eq(1) - .find("select") - .should("exist") - .and("have.value", "ascending") - cy.get(".parameters-col_description") - .eq(2) - .find("input") - .should("exist") - .and("have.value", "test") - cy.get(".parameters-col_description") - .eq(3) - .find("textarea") - .should("exist") - .and("contain", '"eq": "active"') - }) -}) - -describe("Parameter with oneOf and anyOf keywords in OpenAPI 3.1.0.", () => { - it("should render correct form fields", () => { - cy.visit("/?url=/documents/features/parameters-one-of-any-of-oas31.yaml") - .get("#operations-default-get_") - .click() - cy.get(".parameters-col_description") - .eq(1) - .find("select") - .should("exist") - .and("have.value", "ascending") - cy.get(".parameters-col_description") - .eq(2) - .find("input") - .should("exist") - .and("have.value", "test") - cy.get(".parameters-col_description") - .eq(3) - .find("textarea") - .should("exist") - .and("contain", '"eq": "active"') - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/empty-schema.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/empty-schema.cy.js deleted file mode 100644 index 5628774086c..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/empty-schema.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @prettier - */ - -describe("Empty JSON Schema 2020-12", () => { - it("should render as schema of type `any`", () => { - cy.visit("/?url=/documents/features/json-schema-2020-12-empty-schema.yaml") - - cy.get(".json-schema-2020-12__title").should("contain", "Test") - cy.get(".json-schema-2020-12__attribute").should("contain", "any") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/examples.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/examples.cy.js deleted file mode 100644 index 72ed2d1a821..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/examples.cy.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @prettier - */ -describe("JSON Schema 2020-12 examples keyword", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/json-schema-2020-12-examples.yaml") - }) - - it("should render `Examples` section", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.get(".json-schema-2020-12-keyword--examples").should("exist") - }) - - it("should render primitive examples value", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Examples").click() - - cy.get(".json-schema-2020-12-keyword--examples") - .contains("#0") - .as("primitiveExample") - .should("exist") - - cy.get("@primitiveExample") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("1") - .should("exist") - }) - - it("should render array examples value", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Examples").click() - - cy.get(".json-schema-2020-12-keyword--examples") - .contains("#1") - .as("arrayExample") - .should("exist") - - cy.get("@arrayExample").click() - - cy.get("@arrayExample") - .parent() - .contains("#0") - .as("arrayExampleItem") - .should("exist") - - cy.get("@arrayExampleItem") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("2") - .should("exist") - }) - - it("should render object examples values", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Examples").click() - - cy.get(".json-schema-2020-12-keyword--examples") - .contains("#2") - .as("objectExample") - .should("exist") - - cy.get("@objectExample").click() - - cy.get("@objectExample") - .parent() - .contains("prop") - .as("objectExampleProperty") - .should("exist") - - cy.get("@objectExampleProperty") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("3") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/expansion.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/expansion.cy.js deleted file mode 100644 index 0e98cd1a99b..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/expansion.cy.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @prettier - */ - -describe("JSON Schema 2020-12 complex keywords expansion", () => { - it("should deeply expand all Schemas and complex keywords", () => { - cy.visit("/pages/json-schema-2020-12-expansion/").then(() => { - cy.get(".json-schema-2020-12-accordion") - .find(".json-schema-2020-12-accordion__icon--collapsed") - .should("not.exist") - cy.contains("anyOf1-p1-p2-p1").should("exist") - cy.contains("oneOf1-p1-p2-p1").should("exist") - cy.contains("Prefix items").should("exist") - cy.contains("exampleDef").should("exist") - cy.contains("https://json-schema.org/draft/2020-12/vocab/core").should( - "exist" - ) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/extension-keywords.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/extension-keywords.cy.js deleted file mode 100644 index ba3ff11600d..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/extension-keywords.cy.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @prettier - */ - -describe("JSON Schema 2020-12 extension keywords", () => { - describe("display extension keywords", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/json-schema-2020-12-extension-keywords.yaml&showExtensions=true" - ) - }) - - it("should render `Extension Keywords` section", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.get(".json-schema-2020-12-keyword--extension-keywords").should("exist") - }) - - it("should render extension keywords with primitive values", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Extension Keywords").click() - - cy.get(".json-schema-2020-12-json-viewer-extension-keyword") - .contains("primitiveExtension") - .as("primitiveExtension") - .should("exist") - - cy.get("@primitiveExtension") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("1") - .should("exist") - }) - - it("should render extension keywords with array values", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Extension Keywords").click() - - cy.get(".json-schema-2020-12-json-viewer-extension-keyword") - .contains("arrayExtension") - .should("exist") - - cy.contains("arrayExtension").click() - - cy.get(".json-schema-2020-12-json-viewer__children") - .contains("#0") - .as("arrayExtensionItem") - .should("exist") - - cy.get("@arrayExtensionItem") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("2") - .should("exist") - }) - - it("should render extension keywords with object values", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Extension Keywords").click() - - cy.get(".json-schema-2020-12-json-viewer-extension-keyword") - .contains("objectExtension") - .should("exist") - - cy.contains("objectExtension").click() - - cy.get(".json-schema-2020-12-json-viewer__children") - .contains("prop") - .as("objectExtensionProperty") - .should("exist") - - cy.get("@objectExtensionProperty") - .siblings(".json-schema-2020-12-json-viewer__value") - .contains("3") - .should("exist") - }) - - it("should not render OpenAPI 3.1.0 keywords as extension keywords", () => { - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Extension Keywords").click() - - cy.get(".json-schema-2020-12-keyword--extension-keywords") - .children() - .contains("Default") - .should("not.exist") - }) - }) - - it("shouldn't display extensions when showExtensions option is set to false", () => { - cy.visit( - "/?url=/documents/features/json-schema-2020-12-extension-keywords.yaml" - ) - - cy.get(".json-schema-2020-12-accordion").click() - cy.contains("Extension Keywords").should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/schema-title.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/schema-title.cy.js deleted file mode 100644 index 867178ce61b..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/schema-title.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("JSON Schema 2020-12 title keyword", () => { - it("should render a correct title for schemas", () => { - cy.visit("/?url=/documents/features/json-schema-2020-12-title.yaml") - .get(".json-schema-2020-12__title") - .eq(0) - .contains("My Pet") - .should("exist") - .get(".json-schema-2020-12__title") - .eq(1) - .contains("My Pets") - .should("exist") - .get(".json-schema-2020-12__title") - .eq(2) - .contains("Error") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/unique-items.cy.js b/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/unique-items.cy.js deleted file mode 100644 index b673be4af0d..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/json-schema-2020-12/unique-items.cy.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @prettier - */ - -describe("JSON Schema 2020-12 uniqueItems keyword", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/json-schema-2020-12-unique-items.yaml") - }) - - it("should render `unique` label", () => { - cy.contains("UniqueItems") - .siblings("span") - .contains("unique") - .should("exist") - }) - - it("should render `unique items` label with range constraints", () => { - cy.contains("UniqueItemsAndRangeConstraint") - .siblings("span") - .contains("[1, 5] unique items") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas3/all-of-circular-ref.cy.js b/test/e2e-cypress/e2e/features/plugins/oas3/all-of-circular-ref.cy.js deleted file mode 100644 index d3c3cfabffb..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas3/all-of-circular-ref.cy.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 spec with allOf containing a circular reference", () => { - it("should render correct title and properties", () => { - cy.visit("/?url=/documents/features/oas3-all-of-circular-ref.yaml").then( - () => { - cy.get("[id='model-OneOfParent']").find("button").click() - cy.get(".property-row") - .contains("additionalData") - .siblings() - .as("additionalData") - cy.get("@additionalData").find("button").click() - cy.get("@additionalData") - .find("span") - .contains("FirstOneOf") - .should("exist") - .click() - cy.get("@additionalData") - .find("span") - .contains("numberProp") - .should("exist") - cy.get("@additionalData") - .find("span") - .contains("additionalData") - .should("exist") - } - ) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas3/complex-spec.cy.js b/test/e2e-cypress/e2e/features/plugins/oas3/complex-spec.cy.js deleted file mode 100644 index faa0b3da92c..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas3/complex-spec.cy.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @prettier - */ -import { VIRTUALIZE_MODELS_ESTIMATE_SIZE } from "src/core/utils/virtualization" - -describe("OpenAPI 3.0 complex spec with allOf and nested references", () => { - it("should render nested references", () => { - cy.visit("/?url=/documents/features/oas3-complex-spec.json").then(() => { - // Virtualized path - scroll the list to bring the target model into view. - cy.get(".models-scroll").scrollTo( - 0, - 196 * VIRTUALIZE_MODELS_ESTIMATE_SIZE - ) - cy.get( - "[id='model-com.sap.ctsm.backend.core.api.study.v1.StudyAPIv1.StudyTreatments-create']" - ) - .find("button") - .click() - cy.get(".property-row") - .contains("scenario") - .siblings() - .as("scenarioSiblings") - cy.get("@scenarioSiblings").find("button").click() - cy.get("@scenarioSiblings") - .find("span") - .contains("scenarioID") - .should("exist") - cy.get("@scenarioSiblings") - .find("span") - .contains("Studies (for create)") - .should("exist") - .click() - cy.get("@scenarioSiblings") - .find("span") - .contains("studyPhase") - .should("exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas3/one-of-any-of-example.cy.js b/test/e2e-cypress/e2e/features/plugins/oas3/one-of-any-of-example.cy.js deleted file mode 100644 index ccd02cdb2b8..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas3/one-of-any-of-example.cy.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 oneOf and anyOf example", () => { - it("should show example values for multipart/form-data and application/x-www-form-urlencoded content types", () => { - cy.visit("/?url=/documents/features/oas3-one-of-any-of-example.yaml").then( - () => { - cy.contains("/documentsWithCombineOneOf") - .click() - .get(".try-out__btn") - .click() - .get("textarea") - .contains("NestedSchemaExample.pdf") - .should("exist") - cy.contains("/documentsWithCombineOneOf").click() - cy.contains("/documentsWithCombineAnyOf") - .click() - .get(".try-out__btn") - .contains("Try it out") - .click() - .get("textarea") - .contains("ParentSchemaExample.pdf") - .should("exist") - } - ) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas3/request-body-complex-schema-properties.cy.js b/test/e2e-cypress/e2e/features/plugins/oas3/request-body-complex-schema-properties.cy.js deleted file mode 100644 index eaef1c7c999..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas3/request-body-complex-schema-properties.cy.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @prettier - */ - -describe("Request body with complex schema properties", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas3-request-body-complex-schema-properties.yaml" - ) - }) - - it("should render example for properties of type object", () => { - cy.get(".opblock-summary-path span").contains("/object").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties of type object", () => { - cy.get(".opblock-summary-path span").contains("/object").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .model").should("exist") - }) - - it("should render example for properties of type array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties of type array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayOfObjects").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .model").should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas3/request-body-upload-file.cy.js b/test/e2e-cypress/e2e/features/plugins/oas3/request-body-upload-file.cy.js deleted file mode 100644 index c5827b59432..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas3/request-body-upload-file.cy.js +++ /dev/null @@ -1,189 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 Request Body upload file button", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/oas3-request-body-upload-file.yaml") - }) - - describe("application/octet-stream", () => { - beforeEach(() => { - cy.get("#operations-default-uploadApplicationOctetStream").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/octet-stream media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("image/png", () => { - beforeEach(() => { - cy.get("#operations-default-uploadImagePng").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for image/png media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("audio/wav", () => { - beforeEach(() => { - cy.get("#operations-default-uploadAudioWav").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for audio/wav media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("video/mpeg", () => { - beforeEach(() => { - cy.get("#operations-default-uploadVideoMpeg").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for video/mpeg media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("application/octet-stream with empty Media Type Object", () => { - beforeEach(() => { - cy.get("#operations-default-uploadApplicationOctetStreamEmpty").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/octet-stream media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema type string and format binary", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaFormatBinary").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema type string and format byte", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaFormatByte").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema type string and format binary", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaFormatBinary").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema type string and format byte", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaFormatByte").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-parameter-schema.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-parameter-schema.cy.js deleted file mode 100644 index 9a3d2eb3058..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-parameter-schema.cy.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @prettier - */ - -describe("Operation parameters with schema and union type", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/oas31-parameter-schema.yaml") - }) - - it("should render example for parameters with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for parameters with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for parameters with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render schema for parameters with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for parameters of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for parameters of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for parameters with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render example for parameters with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-complex-schema-properties.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-complex-schema-properties.cy.js deleted file mode 100644 index 806e767f472..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-complex-schema-properties.cy.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @prettier - */ - -describe("Request body properties with schema and union type", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas31-request-body-complex-schema-properties.yaml" - ) - }) - - it("should render example for properties with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render schema for properties with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render example for properties with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-upload-file.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-upload-file.cy.js deleted file mode 100644 index 56541204969..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-request-body-upload-file.cy.js +++ /dev/null @@ -1,327 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1 Request Body upload file button", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/oas31-request-body-upload-file.yaml") - }) - - describe("application/octet-stream", () => { - beforeEach(() => { - cy.get("#operations-default-uploadApplicationOctetStream").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/octet-stream media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("image/png", () => { - beforeEach(() => { - cy.get("#operations-default-uploadImagePng").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for image/png media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("audio/wav", () => { - beforeEach(() => { - cy.get("#operations-default-uploadAudioWav").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for audio/wav media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("video/mpeg", () => { - beforeEach(() => { - cy.get("#operations-default-uploadVideoMpeg").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for video/mpeg media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("application/octet-stream with empty Media Type Object", () => { - beforeEach(() => { - cy.get("#operations-default-uploadApplicationOctetStreamEmpty").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/octet-stream media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema type string and format binary", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaTypeFormatBinary").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema type string and format byte", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaTypeFormatByte").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema union type includes string and format binary", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaUnionTypeFormatBinary").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema union type includes string and format byte", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaUnionTypeFormatByte").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema contentMediaType is a non-empty string", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaContentMediaType").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("schema contentEncoding is a non-empty string", () => { - beforeEach(() => { - cy.get("#operations-default-uploadSchemaContentEncoding").click() - }) - - it("should display description with the correct content type", () => { - cy.get( - ".opblock-section-request-body .opblock-description-wrapper i" - ).should( - "have.text", - "Example values are not available for application/x-custom media types." - ) - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema type string and format binary", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaFormatBinary").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema type string and format byte", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaFormatByte").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema union type including string and format binary", () => { - beforeEach(() => { - cy.get( - "#operations-default-uploadPropertySchemaUnionTypeFormatBinary" - ).click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property with schema union type including string and format byte", () => { - beforeEach(() => { - cy.get( - "#operations-default-uploadPropertySchemaUnionTypeFormatByte" - ).click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property schema has contentMediaType with non-empty string", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaContentMediaType").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) - - describe("multipart/form-data object property schema has contentEncoding with non-empty string", () => { - beforeEach(() => { - cy.get("#operations-default-uploadPropertySchemaContentEncoding").click() - }) - - it("should display a file upload button", () => { - cy.get(".try-out__btn").click() - cy.get( - ".opblock-section-request-body .opblock-description-wrapper input" - ).should("have.prop", "type", "file") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-content.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-content.cy.js deleted file mode 100644 index 449f37ed9f2..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-content.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1.0 response with empty content", () => { - it("should render a response", () => { - cy.visit( - "/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-empty-content.yaml" - ) - .get("#operations-Enterprise-get_enterprise_detail") - .click() - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner" - ) - .contains("No enterprise matching the requested ID could be found.") - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example" - ) - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-media-type.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-media-type.cy.js deleted file mode 100644 index 7539b9e2478..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-empty-media-type.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1.0 response with empty Media Type Object", () => { - it("should render a response", () => { - cy.visit( - "/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-empty-media-type.yaml" - ) - .get("#operations-Enterprise-get_enterprise_detail") - .click() - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner" - ) - .contains("No enterprise matching the requested ID could be found.") - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example" - ) - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-no-content.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-no-content.cy.js deleted file mode 100644 index 35aaa328b56..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-response-no-content.cy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1.0 response without content", () => { - it("should render a response", () => { - cy.visit( - "/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-no-content.yaml" - ) - .get("#operations-Enterprise-get_enterprise_detail") - .click() - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner" - ) - .contains("No enterprise matching the requested ID could be found.") - .get( - "#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example" - ) - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-schema-expansion.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-schema-expansion.cy.js deleted file mode 100644 index 7c367d63932..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-schema-expansion.cy.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1.0 schema expansion", () => { - it("should expand to the default expansion level", () => { - cy.visit( - "/?url=/documents/features/oas31-schema-expansion.yaml&defaultModelsExpandDepth=3&showExtensions=true" - ) - - cy.get(".json-schema-2020-12-property").contains("prop2").should("exist") - cy.get(".json-schema-2020-12-property") - .contains("prop3") - .should("not.exist") - - cy.get(".json-schema-2020-12-keyword--xml") - .contains("x-extension") - .should("exist") - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop1") - .should("not.exist") - }) - - it("should deeply expand nested collapsed keywords", () => { - cy.visit( - "/?url=/documents/features/oas31-schema-expansion.yaml&showExtensions=true" - ) - - cy.get(".json-schema-2020-12-expand-deep-button").click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("exist") - - cy.get(".json-schema-2020-12-keyword--xml").contains("prop1").click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("not.exist") - - cy.get(".json-schema-2020-12-keyword--xml").contains("XML").click() - cy.get( - ".json-schema-2020-12-keyword--xml .json-schema-2020-12-expand-deep-button" - ) - .first() - .click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("exist") - }) - - it("should re-expand a collapsed nested property after the parent schema is collapsed and deeply expanded again", () => { - cy.visit( - "/?url=/documents/features/oas31-schema-expansion.yaml&showExtensions=true" - ) - - cy.get(".json-schema-2020-12-expand-deep-button").click() - cy.get(".json-schema-2020-12-keyword--properties") - .contains("prop4") - .should("exist") - - cy.get(".json-schema-2020-12-keyword--properties").contains("prop2").click() - cy.get(".json-schema-2020-12-keyword--properties") - .contains("prop4") - .should("not.exist") - - cy.get(".json-schema-2020-12-accordion").contains("Expansion").click() - cy.get(".json-schema-2020-12-expand-deep-button").click() - - cy.get(".json-schema-2020-12-keyword--properties") - .contains("prop4") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-webhook-examples.cy.js b/test/e2e-cypress/e2e/features/plugins/oas31/oas31-webhook-examples.cy.js deleted file mode 100644 index 0f4b036718f..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas31/oas31-webhook-examples.cy.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.1.0 webhook", () => { - it("should render the correct example for the request body", () => { - cy.visit("/?url=/documents/features/oas31-webhook-examples.yaml") - .get("#operations-webhooks-test-webhook") - .click() - .get(".body-param__example") - .should("contain", '"userId": "userId example from examples"') - .and("contain", '"orderId": "orderId example from examples"') - .get(".examples-select-element") - .eq(0) - .select("TestExample2") - .get(".body-param__example") - .should("contain", '"userId": "second userId example from examples"') - .and("contain", '"orderId": "second orderId example from examples"') - }) - - it("should render the correct example for the response", () => { - cy.visit("/?url=/documents/features/oas31-webhook-examples.yaml") - .get("#operations-webhooks-test-webhook") - .click() - .get(".example.microlight") - .should("contain", '"userId": "userId example from examples"') - .and("contain", '"orderId": "orderId example from examples"') - .get(".examples-select-element") - .eq(1) - .select("TestExample2") - .get(".example.microlight") - .should("contain", '"userId": "second userId example from examples"') - .and("contain", '"orderId": "second orderId example from examples"') - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-json-schema-rendering.cy.js b/test/e2e-cypress/e2e/features/plugins/oas32/oas32-json-schema-rendering.cy.js deleted file mode 100644 index 015a9732bf3..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-json-schema-rendering.cy.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2 JSON Schema 2020-12 rendering", () => { - const baseUrl = "/?url=/documents/features/oas32-json-schema-rendering.yaml" - - describe("Schemas section", () => { - beforeEach(() => { - cy.visit(baseUrl) - }) - - it("should render the schemas section using JSON Schema 2020-12", () => { - cy.get(".json-schema-2020-12").should("exist") - }) - - it("should render schema properties with JSON Schema 2020-12 property classes", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-property").contains("id").should("exist") - cy.get(".json-schema-2020-12-property").contains("name").should("exist") - }) - - it("should render the schema description keyword", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-keyword--description") - .should("exist") - .and("contain.text", "A pet in the system") - }) - - it("should render the Discriminator keyword", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-keyword__name") - .contains("Discriminator") - .should("exist") - }) - - it("should render the External documentation keyword", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-keyword__name") - .contains("External documentation") - .should("exist") - }) - - it("should render the XML keyword", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-keyword--xml").should("exist") - }) - - it("should render the Examples keyword", () => { - cy.get(".json-schema-2020-12").contains("My Pet").click() - cy.get(".json-schema-2020-12-keyword--examples").should("exist") - }) - }) - - describe("Request body schema", () => { - beforeEach(() => { - cy.visit(baseUrl) - cy.get(".opblock-summary-path span").contains("/pets").click() - cy.get("button").contains("Try it out").click() - }) - - it("should render request body schema using JSON Schema 2020-12", () => { - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties with union type including object", () => { - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '{\n "objectTypeUnion": {\n "id": "string",\n "name": "string"\n }\n}' - ) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-request-body-complex-schema-properties.cy.js b/test/e2e-cypress/e2e/features/plugins/oas32/oas32-request-body-complex-schema-properties.cy.js deleted file mode 100644 index 7e15904ae4c..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-request-body-complex-schema-properties.cy.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2 request body properties with schema and union type", () => { - beforeEach(() => { - cy.visit( - "/?url=/documents/features/oas32-request-body-complex-schema-properties.yaml" - ) - }) - - it("should render example for properties with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties with union type including object", () => { - cy.get(".opblock-summary-path span").contains("/objectTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render schema for properties with union type including array of objects", () => { - cy.get(".opblock-summary-path span").contains("/arrayTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and("have.value", '{\n "id": "string",\n "name": "string"\n}') - }) - - it("should render schema for properties of type array with union type of items including object", () => { - cy.get(".opblock-summary-path span").contains("/arrayItemTypeUnion").click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) - - it("should render example for properties with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example textarea") - .should("exist") - .and( - "have.value", - '[\n {\n "id": "string",\n "name": "string"\n }\n]' - ) - }) - - it("should render schema for properties with union type including array and union type of items including object", () => { - cy.get(".opblock-summary-path span") - .contains("/arrayTypeAndItemTypeUnion") - .click() - cy.get("button").contains("Try it out").click() - - cy.get(".model-example button").contains("Schema").click() - cy.get(".model-example .json-schema-2020-12").should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-schema-expansion.cy.js b/test/e2e-cypress/e2e/features/plugins/oas32/oas32-schema-expansion.cy.js deleted file mode 100644 index 06f9845b307..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/oas32/oas32-schema-expansion.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.2.0 schema expansion", () => { - it("should expand to the default expansion level", () => { - cy.visit( - "/?url=/documents/features/oas32-schema-expansion.yaml&defaultModelsExpandDepth=3&showExtensions=true" - ) - - cy.get(".json-schema-2020-12-property").contains("prop2").should("exist") - cy.get(".json-schema-2020-12-property") - .contains("prop3") - .should("not.exist") - - cy.get(".json-schema-2020-12-keyword--xml") - .contains("x-extension") - .should("exist") - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop1") - .should("not.exist") - }) - - it("should deeply expand nested collapsed keywords", () => { - cy.visit( - "/?url=/documents/features/oas32-schema-expansion.yaml&showExtensions=true" - ) - - cy.get(".json-schema-2020-12-expand-deep-button").click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("exist") - - cy.get(".json-schema-2020-12-keyword--xml").contains("prop1").click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("not.exist") - - cy.get(".json-schema-2020-12-keyword--xml").contains("XML").click() - cy.get( - ".json-schema-2020-12-keyword--xml .json-schema-2020-12-expand-deep-button" - ) - .first() - .click() - cy.get(".json-schema-2020-12-keyword--xml") - .contains("prop4") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/plugins/topbar/linking-to-configured-urls.cy.js b/test/e2e-cypress/e2e/features/plugins/topbar/linking-to-configured-urls.cy.js deleted file mode 100644 index fc24aac044f..00000000000 --- a/test/e2e-cypress/e2e/features/plugins/topbar/linking-to-configured-urls.cy.js +++ /dev/null @@ -1,23 +0,0 @@ -describe("Loading specs by url.primaryName param", () => { - describe("with no param", () => { - it("should load the default spec", () => { - cy.visit("/pages/multiple-urls/index.html") - .get("span.url") - .contains("/documents/petstore-expanded.openapi.yaml") - }) - }) - describe("with an invalid param", () => { - it("should fall back to the default spec", () => { - cy.visit("/pages/multiple-urls/index.html?urls.primaryName=undefinedUrlName") - .get("span.url") - .contains("/documents/petstore-expanded.openapi.yaml") - }) - }) - describe("with a valid url.primaryName param", () => { - it("should render the requested spec", () => { - cy.visit("/pages/multiple-urls/index.html?urls.primaryName=Petstore Swagger") - .get("span.url") - .contains("/documents/petstore.swagger.yaml") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/response-empty-examples-object.cy.js b/test/e2e-cypress/e2e/features/response-empty-examples-object.cy.js deleted file mode 100644 index 7c000a6e7a1..00000000000 --- a/test/e2e-cypress/e2e/features/response-empty-examples-object.cy.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * @prettier - */ - -describe("Response examples", () => { - it("should render a generated example when an empty examples object is provided", () => { - cy.visit("/?url=/documents/features/response-empty-examples-object.yaml") - .get("#operations-TEST-test") - .click() - .get(".example.microlight") - .should("exist") - .contains("{}") - .get(".examples-select-element") - .should("not.exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/response-extension.cy.js b/test/e2e-cypress/e2e/features/response-extension.cy.js deleted file mode 100644 index c1b8553949b..00000000000 --- a/test/e2e-cypress/e2e/features/response-extension.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -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\" ]") - }) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/schema-form-enum-boolean.cy.js b/test/e2e-cypress/e2e/features/schema-form-enum-boolean.cy.js deleted file mode 100644 index 1b252139400..00000000000 --- a/test/e2e-cypress/e2e/features/schema-form-enum-boolean.cy.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @prettier - */ - -describe("JSON Schema Form: Enum & Boolean in a Parameter", () => { - beforeEach(() => { - cy.visit("/?url=/documents/features/schema-form-enum-boolean.yaml") - .get("#operations-pet-findPetsByStatus") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // @alias Execute Button - cy.get(".execute.opblock-control__btn").as("executeBtn") - // @alias Parameters - cy.get(".opblock-section tbody > tr > .parameters-col_description > select") - .eq(0) - .as("enumIsRequired") - cy.get(".opblock-section tbody > tr > .parameters-col_description > select") - .eq(1) - .as("booleanIsOptional") - cy.get(".opblock-section tbody > tr > .parameters-col_description > select") - .eq(2) - .as("booleanIsRequired") - }) - - it("should render @enumIsRequired with list of three options", () => { - cy.get("@enumIsRequired") - .should("contains.text", "available") - .should("contains.text", "pending") - .should("contains.text", "sold") - .should("not.contains.text", "--") - .find("option") - .should("have.length", 3) - }) - it("should render @booleanIsOptional with default empty string value (display '--')", () => { - cy.get("@booleanIsOptional") - .should("have.value", "") - .should("contains.text", "--") - }) - it("should render @booleanIsRequired with default empty string value (display '--')", () => { - cy.get("@booleanIsRequired") - .should("have.value", "") - .should("contains.text", "--") - }) - it("should NOT be able to execute with empty @enumIsRequired and @booleanIsRequired values", () => { - // Execute - cy.get("@executeBtn").click() - cy.get("@enumIsRequired").should("have.class", "invalid") - cy.get("@booleanIsRequired").should("have.class", "invalid") - // cURL component - cy.get(".responses-wrapper .curl-command").should("not.exist") - }) - it("should NOT be able to execute with empty @booleanIsRequired value, but valid @enumIsRequired", () => { - cy.get("@enumIsRequired").select("pending") - // Execute - cy.get("@executeBtn").click() - cy.get("@enumIsRequired").should("not.have.class", "invalid") - cy.get("@booleanIsRequired").should("have.class", "invalid") - // cURL component - cy.get(".responses-wrapper .curl-command").should("not.exist") - }) - it("should NOT be able to execute with empty @enumIsRequired value, but valid @booleanIsRequired", () => { - cy.get("@booleanIsRequired").select("false") - // Execute - cy.get("@executeBtn").click() - cy.get("@enumIsRequired").should("have.class", "invalid") - cy.get("@booleanIsRequired").should("not.have.class", "invalid") - // cURL component - cy.get(".responses-wrapper .curl-command").should("not.exist") - }) - it("should execute, if @booleanIsOptional value is 'false'", () => { - cy.get("@enumIsRequired").select("pending") - cy.get("@booleanIsRequired").select("false") - cy.get("@booleanIsOptional").select("false") - // Execute - cy.get("@executeBtn").click() - cy.get("@enumIsRequired").should("not.have.class", "invalid") - cy.get("@booleanIsRequired") - .should("not.have.class", "invalid") - .should("not.contains.text", "expectIsOptional") - // cURL component - cy.get(".responses-wrapper .curl-command") // hangs browser here - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("contains.text", "expectIsOptional=false") - }) - it("should execute, but NOT send @booleanIsOptional value if not provided", () => { - cy.get("@enumIsRequired").select("pending") - cy.get("@booleanIsRequired").select("false") - // Execute - cy.get("@executeBtn").click() - cy.get("@enumIsRequired").should("not.have.class", "invalid") - cy.get("@booleanIsRequired") - .should("not.have.class", "invalid") - .should("not.contains.text", "expectIsOptional") - // cURL component - cy.get(".responses-wrapper .curl-command") // hangs browser here - .should("exist") - .get(".responses-wrapper .curl-command span") - .should("not.contains.text", "expectIsOptional") - }) -}) diff --git a/test/e2e-cypress/e2e/features/schema-form.cy.js b/test/e2e-cypress/e2e/features/schema-form.cy.js deleted file mode 100644 index 0b8ff348c54..00000000000 --- a/test/e2e-cypress/e2e/features/schema-form.cy.js +++ /dev/null @@ -1,835 +0,0 @@ -/** - * @prettier - */ - -describe("OpenAPI 3.0 Additional JsonSchemaForm in a Parameter", () => { - describe("incomplete API definition with missing schema key or schema value(s)", () => { - describe("parameter exists as global", () => { - it("should render when parameter exists as global, but missing schema key", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_no_schema") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists as global, but missing all schema values", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_no_type_or_format") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists as global, schema key exists, but missing schema values: format", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_format_only_no_type") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists as global, schema key exists, but missing schema value: type", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_type_only_no_format") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - }) - describe("parameter exists in method", () => { - it("should render when parameter exists in method, but missing schema key", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_two_no_schema") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists in method, schema key exists, but missing all schema values", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_two_no_type_or_format") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists in method, schema key exists, but missing schema value: format", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_type_only_no_format") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - it("should render when parameter exists in method, schema key exists, but missing schema value: type", () => { - cy.visit("/?url=/documents/features/schema-form-missing-values.yaml") - .get("#operations-default-get_case_one_format_only_no_type") - .click() - .get(".opblock-description .renderedMarkdown p") - .should("have.text", "sf") - }) - }) - }) - describe("/Array", () => { - describe("in a Parameter", () => { - it("should allow modification of values in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}5") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - "5", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - }) - it("should allow removal of added value in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}5") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - "5", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - // Remove the last item that was just added - .get( - ".json-schema-form-item:last-of-type > .json-schema-form-item-remove" - ) - .click() - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - ]) - }) - }) - it("should allow removal of nth of values in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}5") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "2", - "3", - "4", - "5", - ]) - }) - .get(".parameters-col_description .examples-select > select") - .find(":selected") - .should("have.text", "[Modified value]") - // Remove the second item in list - .get( - ".json-schema-form-item:nth-child(2) > .json-schema-form-item-remove" - ) - .click() - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "1", - "3", - "4", - "5", - ]) - }) - }) - it("should allow execution of operation in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - }) - it("should add empty item and allow execution of operation in Try-It-Out", () => { - cy.visit( - "/?url=/documents/features/multiple-examples-core.openapi.yaml" - ) - .get("#operations-default-post_Array") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description .examples-select > select") - .select("ArrayExampleB") - // Add a new item - .get(".json-schema-form-item-add") - .click() - // Execute without prior typing a value - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - }) - }) - }) - describe("Petstore", () => { - describe("/pet/findByStatus", () => { - it("should render the operation, execute with default value", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-default-findPetsByStatus") - .click() - // Expand operation - .get(".opblock-title span") - .should("have.text", "Parameters") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "available") - }) - it("should render the operation, modify value, and execute with modified value", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-default-findPetsByStatus") - .click() - // Expand operation - .get(".opblock-title span") - .should("have.text", "Parameters") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Select - .get(".parameters-col_description > select") - .select("pending") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "pending") - }) - }) - describe("/pet/findByTags", () => { - it("should allow modification of values in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > input") - .type("{selectall}spotted") - .blur() - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - ]) - }) - }) - it("should allow removal of added value in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .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) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - ]) - }) - // Remove the last item that was just added - .get( - ".json-schema-form-item:last-of-type > .json-schema-form-item-remove" - ) - .click() - .get(".json-schema-form-item > input") - .should("not.exist") - }) - it("should allow removal of nth of values in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .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) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - ]) - }) - // Add a 2nd new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}large") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "large", - ]) - }) - // Add a 3rd new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}puppy") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "large", - "puppy", - ]) - }) - // Remove the second item in list - .get( - ".json-schema-form-item:nth-child(2) > .json-schema-form-item-remove" - ) - .click() - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "puppy", - ]) - }) - }) - it("should allow execution of operation without modifications in Try-It-Out (debounce)", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "findByTags") - }) - it("should add empty item and allow execution of operation in Try-It-Out (debounce)", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .click() - // Execute without prior typing a value - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "findByTags") - }) - it("should add modified item and allow execution of operation in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > input") - .type("{selectall}spotted") - .blur() - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - ]) - }) - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "spotted") - }) - it("should add 3 modified items, remove the middle child, and allow execution of operation Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-pet-findPetsByTags") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Add a new item - .get(".json-schema-form-item-add") - .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) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - ]) - }) - // Add a 2nd new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}large") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "large", - ]) - }) - // Add a 3rd new item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > input") - .type("{selectall}puppy") - // Assert against the input fields - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "large", - "puppy", - ]) - }) - // Remove the second item in list - .get( - ".json-schema-form-item:nth-child(2) > .json-schema-form-item-remove" - ) - .click() - .get(".json-schema-form-item > input") - .then((inputs) => { - expect(inputs.map((i, el) => el.value).toArray()).to.deep.equal([ - "spotted", - "puppy", - ]) - }) - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "tags=spotted&tags=puppy") - .should("not.have.text", "large") - }) - }) - describe("/petOwner/{petOwnerId}", () => { - // This is a (GET) debounce test for schema type: string - it("should render the operation, and allow execute of operation with empty value (debounce)", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-getPetOwnerById") - .click() - // Expand operation - .get(".opblock-title span") - .should("have.text", "Parameters") - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "petOwner") - }) - it("should render the operation, and input field, and allow execute of operation", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-getPetOwnerById") - .click() - // Expand operation - .get(".opblock-title span") - .should("have.text", "Parameters") - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".parameters-col_description > input") - .type("123") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "petOwner") - .should("contain.text", "123") - }) - }) - describe("/petOwner/listOfServiceTrainer", () => { - it("should allow execution of operation with value=true in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-listOfServiceTrainer") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // add 1st item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > select") - .select("true") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "tags=true") - }) - it("should allow execution of operation with value=false in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-listOfServiceTrainer") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // add 1st item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > select") - .select("false") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "tags=false") - }) - it("should allow execution of operation with value=true&value=false in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-listOfServiceTrainer") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // add 1st item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > select") - .select("true") - // add 2nd item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > select") - .select("false") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "tags=true&tags=false") - }) - it("should allow execution of operation with value=false after removing value=true in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-listOfServiceTrainer") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // add 1st item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item > select") - .select("true") - // add 2nd item - .get(".json-schema-form-item-add") - .click() - .get(".json-schema-form-item:last-of-type > select") - .select("false") - // remove 1st item - .get( - ".json-schema-form-item:nth-child(1) > .json-schema-form-item-remove" - ) - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "tags=false") - }) - it("should allow execution of operation with value=(empty) in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-listOfServiceTrainer") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "listOfServiceTrainer") - }) - }) - describe("/petOwner/findByPreference", () => { - it("should allow execution of operation with value=(empty) in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-findByPreference") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "findByPreference") - }) - it("should allow execution of operation with selected value in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-findByPreference") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Select - .get(".parameters-col_description > select") - .select("dog") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "findByPreference") - .should("contain.text", "dog") - }) - it("should allow execution of operation with multiple selected values in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-findByPreference") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Select - .get(".parameters-col_description > select") - .select(["dog", "cat"]) - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "findByPreference") - .should("contain.text", "dog") - .should("contain.text", "cat") - }) - }) - describe("/petOwner/createWithList", () => { - it("should allow execution of operation with default text in textArea in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-petOwnerCreateWithList") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "createWithList") - }) - it("should allow execution of operation with cleared textArea in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-petOwnerCreateWithList") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".body-param__text") - .clear() - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "createWithList") - }) - it("should allow execution of operation with modified textArea in Try-It-Out", () => { - cy.visit("/?url=/documents/features/schema-form-core.yaml") - .get("#operations-petOwner-petOwnerCreateWithList") - .click() - // Expand Try It Out - .get(".try-out__btn") - .click() - .get(".body-param__text") - .clear() - // note: adding this much type adds 6+ seconds to test - .type( - `[ - { - "id": 10, - "petId": 201, - "petOwnerFirstName": "John", - }, - { - "id": 11, - "petId": 201, - "petOwnerFirstName": "Jane", - } - ]` - ) - .should("contain.text", "Jane") - .should("contain.text", "201") - // Execute - .get(".execute.opblock-control__btn") - .click() - // Expect new element to be visible after Execute - .get(".btn-clear.opblock-control__btn") - .should("have.text", "Clear") - // Compare Request URL - .get(".request-url pre.microlight") - .should("contain.text", "createWithList") - // Compare Curl - .get(".curl") - .should("contain.text", "Jane") - .should("contain.text", "201") - }) - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/schema-rendering.cy.js b/test/e2e-cypress/e2e/features/schema-rendering.cy.js deleted file mode 100644 index e8f71c9ed52..00000000000 --- a/test/e2e-cypress/e2e/features/schema-rendering.cy.js +++ /dev/null @@ -1,25 +0,0 @@ -describe("OpenAPI 3.0 Schema rendering", () => { - it("should render the Schema tab in Try it out mode for request body", () => { - cy - .visit("?url=/documents/features/oas3-xml.json") - .get("#operations-default-post_foo") - .click() - .get(".btn.try-out__btn") - .click() - .get(".opblock-section-request-body") - .within(() => { - cy.contains("button", "Schema") - .should("exist") - .and("be.visible") - .click() - - cy - .get('[data-name="modelPanel"]') - .should("be.visible") - - cy - .get('[data-name="examplePanel"]') - .should("not.exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/spec-parse-to-json.cy.js b/test/e2e-cypress/e2e/features/spec-parse-to-json.cy.js deleted file mode 100644 index 1847075b386..00000000000 --- a/test/e2e-cypress/e2e/features/spec-parse-to-json.cy.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @prettier - */ - -describe("Parse YAML as YAML@1.2 with json_schema for all JSON-supported types", () => { - it("should have date string even without quotes", () => { - cy.visit("/?url=/documents/features/spec-parse-to-json.yaml") - .get("#operations-default-get_foo") - .click() - // Responses -> example value tab - .get(".language-json > :nth-child(3)") - .should("have.text", '"without-quotes"') - .get(".language-json > :nth-child(5)") - .should("have.text", '"1999-11-31"') - // Responses -> schema tab - .get(".model-example > .tab > :nth-child(2)") - .click() - .get(":nth-child(1) > :nth-child(2) > .model > :nth-child(1)") - .click() - .get( - ":nth-child(1) > :nth-child(2) > .model > :nth-child(1) > .prop > .property" - ) // first element, without-quotes - .should("have.text", "example: 1999-11-31") - .get(":nth-child(2) > :nth-child(2) > .model > :nth-child(1)") - .click() - .get( - ":nth-child(2) > :nth-child(2) > .model > :nth-child(1) > .prop > .property" - ) // second element, with quotes - .should("have.text", "example: 1999-12-31") - }) -}) diff --git a/test/e2e-cypress/e2e/features/syntax-highlighting-json.cy.js b/test/e2e-cypress/e2e/features/syntax-highlighting-json.cy.js deleted file mode 100644 index 5e34e119dc7..00000000000 --- a/test/e2e-cypress/e2e/features/syntax-highlighting-json.cy.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @prettier - */ -describe("Syntax Highlighting for JSON value cases", () => { - // expect span contains entire string sample - // fail case is if the string sample gets broken up into segments - // due react-syntax-highlighter attempting to escape characters into multiple segments - describe("OAS 2", () => { - it("should render full syntax highlighted string in Request (param body) example", () => { - cy.visit("/?url=/documents/features/syntax-highlighting-json-oas2.yaml") - .get("#operations-default-post_setServices") - .click() - .get(".body-param__example > .language-json > :nth-child(10)") - .should("have.text", '"79daf5b4-aa4b-1452-eae5-42c231477ba7"') - }) - it("should render full syntax highlighted string in Response example", () => { - cy.visit("/?url=/documents/features/syntax-highlighting-json-oas2.yaml") - .get("#operations-default-post_setServices") - .click() - .get(".example > .language-json > :nth-child(28)") - .should("have.text", '"5ff06f632bb165394501b05d3a833355"') - }) - }) - describe("OAS 3", () => { - it("should render full syntax highlighted string in Request example", () => { - cy.visit("/?url=/documents/features/syntax-highlighting-json-oas3.yaml") - .get("#operations-default-post_setServices") - .click() - .get(".body-param__example > .language-json > :nth-child(15)") - .should("have.text", '"22a124b4-594b-4452-bdf5-fc3ef1477ba7"') - }) - it("should render full syntax highlighted string in Response example", () => { - cy.visit("/?url=/documents/features/syntax-highlighting-json-oas3.yaml") - .get("#operations-default-post_setServices") - .click() - .get(".example > .language-json > :nth-child(33)") - .should("have.text", '"f0009babde9dbe204540d79cf754408e"') - }) - }) -}) diff --git a/test/e2e-cypress/e2e/features/try-it-out-enabled.cy.js b/test/e2e-cypress/e2e/features/try-it-out-enabled.cy.js deleted file mode 100644 index bf49e65c91f..00000000000 --- a/test/e2e-cypress/e2e/features/try-it-out-enabled.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -describe("Try it out enabled configuration", () => { - it("should enable the try it out section when true", () => { - - cy - .visit("?tryItOutEnabled=true&url=/documents/features/try-it-out-enabled.yaml") - .get("#operations-default-get_") - .click() - .get(".try-out__btn") - .should("have.text","Cancel") - }) - - it("should disable the try it out section when false", () => { - - cy - .visit("?tryItOutEnabled=false&url=/documents/features/try-it-out-enabled.yaml") - .get("#operations-default-get_") - .click() - .get(".try-out__btn") - .should("have.text","Try it out ") - }) - }) - \ No newline at end of file diff --git a/test/e2e-cypress/e2e/features/try-it-out-non-200-response-body.cy.js b/test/e2e-cypress/e2e/features/try-it-out-non-200-response-body.cy.js deleted file mode 100644 index 4fbbd52eb05..00000000000 --- a/test/e2e-cypress/e2e/features/try-it-out-non-200-response-body.cy.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @prettier - */ -describe("#9556: SwaggerUI doesn't render response bodies for non-200 responses", () => { - beforeEach(() => { - const staticResponse = { - statusCode: 400, - headers: { "content-type": "plain/text" }, - body: "This should render", - } - cy.intercept("GET", "/400-any", staticResponse).as("request") - }) - - it("should render response body for a response with 400 status code", () => { - cy.visit("?url=/documents/features/try-it-out-non-200-response-body.yaml") - .get("#operations-default-get_400_any") - .click() - .get(".try-out__btn") - .click() - .get(".execute") - .click() - .wait("@request") - .get(".response-col_description .highlight-code .microlight") - .should("have.text", "This should render") - }) -}) diff --git a/test/e2e-cypress/e2e/features/try-it-out-reset.cy.js b/test/e2e-cypress/e2e/features/try-it-out-reset.cy.js deleted file mode 100644 index a6f707aada7..00000000000 --- a/test/e2e-cypress/e2e/features/try-it-out-reset.cy.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @prettier - */ - -describe("Reset button in try it out", () => { - it("should reset the edited request body value and execute try it out with the default value", () => { - cy.visit("?url=/documents/features/try-it-out-reset.yaml") - .get("#operations-default-post_users") - .click() - .get(".try-out__btn") - .click() - .get(`.parameters[data-property-name="name"] input[type=text]`) - .type("{selectall}not the default name value") - .get(`.parameters[data-property-name="badgeid"] input[type=text]`) - .type("{selectall}not the default badge value") - .get(`.parameters[data-property-name="email"] input[type=text]`) - .type("{selectall}not the default email value") - .get(".btn.execute") - .click() - .get(".curl-command") - .contains( - "name=not%20the%20default%20name%20value&badgeid=not%20the%20default%20badge%20value&email=not%20the%20default%20email%20value" - ) - .should("exist") - .get(".try-out__btn.reset") - .click() - .get(".btn.execute") - .click() - .get(".curl-command") - .contains("name=default%20name&badgeid=12345&email=jsmith%40business.com") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/try-it-out-schema-required-override-allowed.cy.js b/test/e2e-cypress/e2e/features/try-it-out-schema-required-override-allowed.cy.js deleted file mode 100644 index 624e6eded16..00000000000 --- a/test/e2e-cypress/e2e/features/try-it-out-schema-required-override-allowed.cy.js +++ /dev/null @@ -1,15 +0,0 @@ -describe("Try It Out: schema required properties can be overridden", () => { - it("should execute", () => { - cy - .visit("?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-required-override-allowed.yaml") - .get("#operations-default-setDeliveryLocation") - .click() - .get(".body-param__text") - .should("include.value", "testProperty") - .clear() // swagger-ui will auto insert "{}" into textarea - .get(".execute-wrapper > .btn") - .click() - .get(".curl-command") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-with-example.cy.js b/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-with-example.cy.js deleted file mode 100644 index 236445796f6..00000000000 --- a/test/e2e-cypress/e2e/features/try-it-out-schema-type-array-with-example.cy.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @prettier - */ - -describe("Try it out: schema type array with example or parameter examples", () => { - it("shows a validation error message when field is required and example is a string", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_requiredStringExample") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("exist") - }) - - it("executes with the initial value when field is not required and example is an array", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_arrayExample") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should( - "contain", - "'http://localhost:3230/arrayExample?test=test1&test=test2'" - ) - }) - - it("executes with the initial value when field is not required and example is a stringified array", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_stringifiedArrayExample") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should( - "contain", - "'http://localhost:3230/stringifiedArrayExample?test=test1&test=test2'" - ) - }) - - it("executes without the initial value when field is not required and example is a string", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_stringExample") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should("contain", "'http://localhost:3230/stringExample'") - }) - - it("executes with the initial value when field is not required and parameter examples are arrays", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_parameterArrayExamples") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should( - "contain", - "'http://localhost:3230/parameterArrayExamples?test=test1&test=test2'" - ) - }) - - it("executes with the initial value when field is not required and parameter examples are stringified arrays", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_parameterStringifiedArrayExamples") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should( - "contain", - "'http://localhost:3230/parameterStringifiedArrayExamples?test=test1&test=test2'" - ) - }) - - it("executes without the initial value when field is not required and parameter examples are strings", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_parameterStringExamples") - .click() - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should("contain", "'http://localhost:3230/parameterStringExamples'") - }) - - it("executes without the chosen examples value when field is not required and parameter examples are strings", () => { - cy.visit( - "?tryItOutEnabled=true&url=/documents/features/try-it-out-schema-type-array-with-example.yaml" - ) - .get("#operations-default-get_parameterStringExamples") - .click() - .get(".examples-select-element") - .select("example2") - .get(".btn.execute") - .click() - .get(".validation-errors") - .should("not.exist") - .get(".curl.microlight") - .should("contain", "'http://localhost:3230/parameterStringExamples'") - }) -}) diff --git a/test/e2e-cypress/e2e/features/urls.cy.js b/test/e2e-cypress/e2e/features/urls.cy.js deleted file mode 100644 index b1e37f53995..00000000000 --- a/test/e2e-cypress/e2e/features/urls.cy.js +++ /dev/null @@ -1,114 +0,0 @@ -describe("configuration options: `urls` and `urls.primaryName`", () => { - describe("`urls` only", () => { - it("should render a list of URLs correctly", () => { - cy.visit("/?configUrl=/configs/urls.yaml") - .get("select") - .children() - .should("have.length", 2) - .get("select > option") - .eq(0) - .should("have.text", "One") - .should("have.attr", "value", ) - .and("match", /\/documents\/features\/urls\/1\.yaml$/) - .get("select > option") - .eq(1) - .should("have.text", "Two") - .should("have.attr", "value") - .and("match", /\/documents\/features\/urls\/2\.yaml$/) - }) - - it("should render the first URL in the list", () => { - cy.visit("/?configUrl=/configs/urls.yaml") - .get("h1.title") - .should("have.text", "OneOAS 2.0") - .window() - .then(win => win.ui.specSelectors.url()) - .should("match", /\/documents\/features\/urls\/1\.yaml$/) - }) - }) - - it("should respect a `urls.primaryName`", () => { - cy.visit("/?configUrl=/configs/urls-primary-name.yaml") - .get("select") - .should("contain.value", "/documents/features/urls/2.yaml") - .get("h1.title") - .should("have.text", "TwoOAS 3.0") - .window() - .then(win => win.ui.specSelectors.url()) - .get("select") - .should("contain.value", "/documents/features/urls/2.yaml") - }) -}) - -describe("urls with server variables", () => { - it("should compute a url and default server variables", () => { - cy.visit("/?configUrl=/configs/urls-server-variables.yaml") - .get("code") - .should("have.text", "https://localhost:3200/oneFirstUrl") - .get("tr > :nth-child(1)") - .should("have.text", "basePath") - .get("input") - .should("have.value", "/oneFirstUrl") - }) - it("should change server variables", () => { - cy.visit("/?configUrl=/configs/urls-server-variables.yaml") - .get("code") - .should("have.text", "https://localhost:3200/oneFirstUrl") - .get("tr > :nth-child(1)") - .should("have.text", "basePath") - .get("input") - .should("have.value", "/oneFirstUrl") - .get(".servers > label > select") - .eq(0) - .select(1) - .get("input") - .should("have.value", "/oneSecondUrl") - }) - it("should select and compute second url", () => { - cy.visit("/?configUrl=/configs/urls-server-variables.yaml") - .get("select > option") - .eq(1) - .should("have.text", "Two") - .get("select") - .eq(0) - .select(1) - .get("code") - .should("have.text", "https://localhost:3200/twoFirstUrl") - .get("input") - .should("have.value", "/twoFirstUrl") - }) - it("should select second url, then toggle back to first url", () => { - cy.visit("/?configUrl=/configs/urls-server-variables.yaml") - .get("select > option") - .get("select") - .eq(0) - .select(1) - .get("input") - .should("have.value", "/twoFirstUrl") - // toggle url back - .get("select") - .eq(0) - .select(0) - .get("code") - .should("have.text", "https://localhost:3200/oneFirstUrl") - .get("input") - .should("have.value", "/oneFirstUrl") - }) - it("should change server variables, then select second url, and maintain server variables index", () => { - cy.visit("/?configUrl=/configs/urls-server-variables.yaml") - .get(".servers > label >select") - .eq(0) - .select(1) - .get("input") - .should("have.value", "/oneSecondUrl") - // change url - .get("select > option") - .get("select") - .eq(0) - .select(1) - .get("input") - .should("have.value", "/twoSecondUrl") - .get("input") - .should("have.value", "/twoSecondUrl") - }) -}) diff --git a/test/e2e-cypress/e2e/features/webhooks.cy.js b/test/e2e-cypress/e2e/features/webhooks.cy.js deleted file mode 100644 index e82d1017a77..00000000000 --- a/test/e2e-cypress/e2e/features/webhooks.cy.js +++ /dev/null @@ -1,28 +0,0 @@ -describe("Render Webhooks Component", () => { - describe("OpenAPI 3.1.x", () => { - const baseUrl = "/?url=/documents/features/webhooks-openAPI31.yaml" - it("should render a heading", () => { - cy.visit(baseUrl) - .get(".webhooks") - .should("exist") - .should("contains.text", "Webhooks") - }) - it("should render an operation component", () => { - cy.visit(baseUrl) - .get(".webhooks #operations-webhooks-postnewPet > .opblock-summary") - .should("exist") - .should("contains.text", "POST") - .should("contains.text", "newPet") - }) - }) - describe("OpenAPI 3.0.x", () => { - const baseUrl = "/?url=/documents/features/webhooks-openAPI30.yaml" - it("should render nothing", () => { - cy.visit(baseUrl) - cy.get("#swagger-ui .information-container") - .should("exist") - cy.get(".webhooks", {timeout: 0}) - .should("not.exist") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/security/anonymous.cy.js b/test/e2e-cypress/e2e/security/anonymous.cy.js deleted file mode 100644 index 312e38a18fa..00000000000 --- a/test/e2e-cypress/e2e/security/anonymous.cy.js +++ /dev/null @@ -1,22 +0,0 @@ -describe("#6767: Operation should be considered anonymous if its security only includes empty object (this was decided by implementation choice and may change or be extended in the future)", () => { - it("Should consider method anonymous if security contains only empty object", () => { - cy - .visit("/?url=/documents/security/anonymous.yaml") - .get("#operations-default-get_onlyEmpty .authorization__btn") - .should("not.exist") - }) - - it("Should consider method as secured if security contains no empty object", () => { - cy - .visit("/?url=/documents/security/anonymous.yaml") - .get("#operations-default-get_required .authorization__btn") - .should("exist") - }) - - it("Should consider method as secured if security contains empty object but has at least one more security defined", () => { - cy - .visit("/?url=/documents/security/anonymous.yaml") - .get("#operations-default-get_withBoth .authorization__btn") - .should("exist") - }) -}) diff --git a/test/e2e-cypress/e2e/security/apikey.cy.js b/test/e2e-cypress/e2e/security/apikey.cy.js deleted file mode 100644 index 1e66ed0590e..00000000000 --- a/test/e2e-cypress/e2e/security/apikey.cy.js +++ /dev/null @@ -1,13 +0,0 @@ -describe("ApiKey Authorization", function() { - it("should have generic description for authorization button", () => { - cy - .visit("/?url=/documents/petstore.swagger.yaml") - .get(".btn.authorize") // open authorization dialog - .click() - .get(".modal-ux-content > :nth-child(2)") // only deal with api_key for this test - .within(() => { - cy.get(".auth-btn-wrapper .authorize") - .should("have.attr", "aria-label", "Apply credentials") - }) - }) -}) diff --git a/test/e2e-cypress/e2e/security/oauth2.cy.js b/test/e2e-cypress/e2e/security/oauth2.cy.js deleted file mode 100644 index adb9f816618..00000000000 --- a/test/e2e-cypress/e2e/security/oauth2.cy.js +++ /dev/null @@ -1,23 +0,0 @@ -describe("XSS: OAuth2 authorizationUrl sanitization", () => { - it("should filter out a javascript URL", () => { - cy.visit("/?url=/documents/security/xss-oauth2.yaml") - .window() - .then(win => { - let args = null - cy.stub(win, "open").callsFake((...callArgs) => { - args = callArgs - }).as("windowOpen") - - cy.get(".authorize") - .click() - .get(".modal-btn.authorize") - .click() - .wait(100) - .then(() => { - console.log(args) - expect(args[0]).to.match(/^about:blank/) - }) - - }) - }) -}) diff --git a/test/e2e-cypress/e2e/security/sequential-import-chaining.cy.js b/test/e2e-cypress/e2e/security/sequential-import-chaining.cy.js deleted file mode 100644 index 0e8234a9bc4..00000000000 --- a/test/e2e-cypress/e2e/security/sequential-import-chaining.cy.js +++ /dev/null @@ -1,58 +0,0 @@ -describe("Security: CSS Sequential Import Chaining", () => { - describe("in OpenAPI 3.0", () => { - describe("CSS Injection via Markdown", () => { - it("should filter