Convert the Cypress tests back to PHPUnit

Created on 18 August 2025, about 2 months ago

Problem/Motivation

Drupal CMS originally added end-to-end testing with Cypress during the 1.x development cycle. Adding Cypress involved a large number of internal infrastructure changes (to repo layout, DDEV config, CI, and so forth).

Since then, the circumstances have changed and I think we should walk the decision back:

Cypress slows our CI process down, because getting it bootstrapped means installing a large number of dependencies. At the time we added it, we had no PHPUnit functional JavaScript testing. That changed with the addition of the performance test, which requires WebDriver; we can now do PHPUnit functional JS tests just like regular non-JS PHPUnit tests.
We chose Cypress largely because Experience Builder did. XB has since switched to Playwright, and they have much greater need for end-to-end testing in a Playwright or Cypress-like environment than we do, given the nature of XB's UI. Core has also settled on migrating to Playwright, which means we are the odd one out by continuing to use Cypress.
We thought the use of Cypress would encourage more quality contribution, since writing tests could be done in a framework more familiar to many developers. That was before our direction changed to be more focused on site templates; now, having Cypress tests for our individual recipes is very clearly overkill.

There is still a place for end-to-end testing with a JavaScript-based framework, but I think it will need to center around site templates (including visual regression testing, which PHPUnit cannot do) and use Playwright, since we can borrow the underlying work XB already did for that. Our Cypress tests should be converted to PHPUnit functional JavaScript tests, and Playwright should be how we test our site templates in various ways, since those are more "complete sites" and therefore would benefit more from full-fledged end-to-end testing.

πŸ“Œ Task
Status

Active

Component

General

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024