Inherit the Cypress 15 / TypeScript 7 toolchain from readonlyrest_kbn - #123
Merged
Conversation
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>
This comment was marked as outdated.
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
approved these changes
Sep 10, 2026
Dzuming
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, I left one small comment
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>
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This suite moves to the toolchain its copy in
readonlyrest_kbnalready uses: Cypress 15.20.1, TypeScript 7.0.2, esbuild for spec bundling. yarn 1 stays, sorun-tests.shand the CI install path are unchanged.Why
readonlyrest_kbn/automatic-testsand this suite are the same 26 spec files. I compared them file by file before this PR:allowed_api_pathsassertions, the 9.5user_storageignore, theUser-settings8.x rejection handling,Loader.settled, theRorMenuopen retry, thecypress-recursepolls. Nothing in the kbn copy needs porting back.Ported
esbuild-registerpackage.json,tsconfig.json,cypress.config.tsclipboardCapture.ts— Chromium 138 needs a user gesture for the clipboard, so the suite records what the app copiessupport/, wired ine2e.ts,cy.getValueFromClipboardreads itcy.waitForResponse—cy.wait'sresponseis optional under Cypress 15 typesChainable<undefined>on the recursive health pollsKbnApiAdvancedClient.tsregister-typescript-eslint-compat.cjs— typescript-eslint has no TS 7 API yetscripts/, required from.eslintrc.jsThe four rules
@typescript-eslint8 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
The matrix on this PR is the real test.
🤖 Generated with Claude Code