Skip to content

Inherit the Cypress 15 / TypeScript 7 toolchain from readonlyrest_kbn - #123

Merged
sscarduzio merged 3 commits into
developfrom
chore/inherit-kbn-cypress15-ts7
Sep 10, 2026
Merged

Inherit the Cypress 15 / TypeScript 7 toolchain from readonlyrest_kbn#123
sscarduzio merged 3 commits into
developfrom
chore/inherit-kbn-cypress15-ts7

Conversation

@sscarduzio

Copy link
Copy Markdown
Contributor

What

This suite moves to the toolchain its copy in readonlyrest_kbn already uses: Cypress 15.20.1, TypeScript 7.0.2, esbuild for spec bundling. yarn 1 stays, so run-tests.sh and the CI install path are unchanged.

Why

readonlyrest_kbn/automatic-tests and this suite are the same 26 spec files. I compared them file by file before this PR:

  • Every behavioural difference is on this side: the multi-node skips, the allowed_api_paths assertions, the 9.5 user_storage ignore, the User-settings 8.x rejection handling, Loader.settled, the RorMenu open retry, the cypress-recurse polls. Nothing in the kbn copy needs porting back.
  • The one thing the kbn copy has and this one lacks is the toolchain from kbn #952 and #990, and the code those bumps required. That is this PR.

Ported

From kbn Here
Cypress 15.20.1, TypeScript 7.0.2, esbuild preprocessor, esbuild-register package.json, tsconfig.json, cypress.config.ts
clipboardCapture.ts — Chromium 138 needs a user gesture for the clipboard, so the suite records what the app copies support/, wired in e2e.ts, cy.getValueFromClipboard reads it
cy.waitForResponsecy.wait's response is optional under Cypress 15 types 21 call sites in the page objects
explicit Chainable<undefined> on the recursive health polls KbnApiAdvancedClient.ts
register-typescript-eslint-compat.cjs — typescript-eslint has no TS 7 API yet scripts/, required from .eslintrc.js

The four rules @typescript-eslint 8 promotes to errors (no-explicit-any, no-unused-vars, no-unused-expressions, no-require-imports) are warnings here. Lint is not a CI gate in this repo, and a toolchain bump should not rewrite tests. 18 warnings remain for a later cleanup.

Verified

tsc --noEmit                      0 errors
yarn lint                         0 errors, 18 warnings
yarn --frozen-lockfile install    ok  (the run-tests.sh path)
cypress run Sanity-check.cy.ts    bundles and executes on Cypress 15; fails only at the network, with no stack

The matrix on this PR is the real test.

🤖 Generated with Claude Code

The kbn repo moved its copy of this suite to Cypress 15.20.1, TypeScript
7.0.2 and an esbuild spec preprocessor in #952 and #990. This repo
stayed on Cypress 14.5.4 and TypeScript 4.8.4. Everything else in the
suite is already equal to or ahead of the kbn copy.

Ported, as in kbn:
- package.json, tsconfig.json, cypress.config.ts: the toolchain, with
  esbuild for spec bundling and esbuild-register for the config. yarn 1
  stays, so run-tests.sh is unchanged.
- clipboardCapture.ts and cy.getValueFromClipboard: Chromium 138 needs
  a user gesture for the clipboard, so the suite records what the app
  copies instead of reading the OS clipboard.
- cy.waitForResponse: cy.wait's response is optional under Cypress 15's
  types; page objects use the typed helper.
- Explicit Chainable<undefined> types on the recursive Kibana health
  polls; a local handle for the embedded JWT server.
- register-typescript-eslint-compat.cjs: typescript-eslint has no TS 7
  support, so it resolves `typescript` to the TS 6 API for lint only.

The four rules that @typescript-eslint 8 promotes to errors are warnings
here, so the bump does not rewrite tests.

Verified: tsc --noEmit clean; yarn lint 0 errors; yarn --frozen-lockfile
install succeeds; cypress run bundles and executes Sanity-check.cy.ts on
Cypress 15 (failing only at the network, with no stack).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

This comment was marked as outdated.

Chromium 138 (Cypress 15) does not always judge the header svg with
data-test-subj=globalLoadingIndicator-hidden visible after a page reload.
On Kibana 9.5.3 this failed Impersonate.cy.ts in Loader.finish() after
"Finish impersonation", on every docker and eck leg, 80 s per attempt.

Kibana swaps globalLoadingIndicator for its -hidden variant when loading
completes, so the presence of that element is the loading-finished
marker. Loader.finish() and Loader.settled() assert `exist`.
readonlyrest_kbn/automatic-tests made the same change in b0cbfd1e and
passes this spec against 9.5.3.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@Dzuming Dzuming left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left one small comment

Comment thread e2e-tests/cypress/plugins/index.ts Outdated
The local const is there because TS 7 reports "possibly null" on the
module-level variable inside the callbacks. The assignment does not have
to happen at creation time: if listen() fails with anything but
EADDRINUSE, the old order left embeddedServer pointing at a dead server,
and the next startEmbeddedServer() call returned success without one.
Assign inside the listen callback instead. The EADDRINUSE branch no
longer needs to clear the variable.

Also make tsCheck call the TypeScript 7 compiler by path. The
typescript-legacy-api alias (typescript@6.0.3) also ships a tsc bin, and
it won the node_modules/.bin/tsc link, so yarn tsCheck type-checked with
6.0.3 instead of 7.0.2.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sscarduzio
sscarduzio merged commit 5bf28eb into develop Sep 10, 2026
17 checks passed
@sscarduzio
sscarduzio deleted the chore/inherit-kbn-cypress15-ts7 branch September 10, 2026 07:22
@coutoPL

This comment was marked as outdated.

@sscarduzio

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants