Skip to content

Upgrade Cypress to 15.21.2 to fix e2e tests on Chrome 158 - #6550

Merged
bram-atmire merged 1 commit into
DSpace:mainfrom
bram-atmire:cypress-15.21.2-chrome-158
Nov 22, 2026
Merged

bram-atmire merged 1 commit into
DSpace:mainfrom
bram-atmire:cypress-15.21.2-chrome-158

Conversation

@bram-atmire

Copy link
Copy Markdown
Member

References

Description

Since 2026-11-19 the e2e tests fail in every PR, because Cypress aborts at the start of the second spec with Error: * is not a valid URL. This PR upgrades Cypress from 15.21.1 to 15.21.2, which contains the upstream fix for Chrome 158.

Instructions for Reviewers

What changed in CI

The e2e job runs with browser: chrome-for-testing, which uses the Chrome that comes with the GitHub runner image. Around 2026-11-18, GitHub moved ubuntu-latest from ubuntu-24.04 to ubuntu-26.04, which upgraded Chrome for Testing from 157 to 158. Cypress, the Cypress GitHub action and our code did not change.

Root cause

Between specs, Cypress 15.21.1 resets the browser state with the Chrome DevTools command Storage.clearDataForOrigin and origin: '*'. Chrome 158 no longer accepts * as an origin and returns * is not a valid URL, and Cypress then aborts the whole run. That is why the first spec passes and the run stops at the start of the second one (admin-curation-tasks.cy.ts). Other Chrome-based test tools hit the same Chrome change (for example teamcapybara/capybara#2865).

Cypress fixed this in 15.21.2 by clearing storage per origin instead of using * (cypress-io/cypress#35198, "support Chrome 158 (per-origin browser reset, keep unload events)").

This is a real fix, not a workaround: we keep testing against the current Chrome and runner image instead of pinning an older Chrome or ubuntu-24.04.

List of changes in this PR:

  • package.json and package-lock.json: cypress from ^15.21.1 to ^15.21.2. No other packages change in the lockfile.

How to test

  • The e2e jobs (tests (20.x) and tests (22.x)) of this PR should run all 60 specs again instead of stopping at the second one.
  • Locally: npm ci and npx cypress verify, then npm run e2e against a backend with the e2e test data.

AI Disclosure (REQUIRED)

Were AI tools used in the creation of this PR?

  • No (This PR does NOT include AI-generated or AI-assisted content that requires disclosure.)
  • Yes (This PR includes AI-generated or AI-assisted content that requires disclosure.)

Claude Code (claude-opus-5-5) compared the green and failing CI runs, traced the error to the Storage.clearDataForOrigin call in the Cypress source of 15.21.1 and to the upstream Cypress issue and fix, and made the version change. It ran npm ci and npx cypress verify locally. It did not run the e2e tests locally (they need the CI backend with test data and Chrome 158); this PR's CI run is the verification. Cypress 15.21.2 was published on 2026-11-13. Its install script is unchanged from 15.21.1, and neither version has npm provenance.

My human verification didn't find any issues.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR follows all coding best practices based on the Code Conventions Guide
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

GitHub's ubuntu-latest runner now provides Chrome for Testing 158.
Cypress 15.21.1 resets the browser between specs with
Storage.clearDataForOrigin using origin "*", which Chrome 158 rejects
("* is not a valid URL"), so "cypress run" aborts at the second spec.
Cypress 15.21.2 clears storage per origin instead
(cypress-io/cypress#35195, fixed by cypress-io/cypress#35198).

Assisted-by: Claude Code [claude-opus-5-5]
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.

1 participant