Page MenuHomePhabricator

Implement Cypress Test Runner
Open, LowPublic

Description

We are embarking on the migration journey to Codex for our FileImporter Extension and want to enhance our testing infrastructure by incorporating the Cypress test runner. Cypress is known for its robust end-to-end and component testing capabilities, therefore this is a great opportunity to explore the capabilities of Cypress for Vue tests.

Tasks

  • Set up Cypress to work seamlessly with the FileImporter Extension within the Codex environment.
  • Investigate Cypress's features for e2e & component testing and identify areas where it can enhance our testing suite.
  • Document the setup process and any insights gained during the exploration and integration phases for future reference.

Notes:

  • use node version 18 (nvm use v18.0.0)
  • run npm install (not npm install cypress)
  • chromium worked for all of us (others got redirect loop)
  • run headless tests: docker run -it --add-host dev.wiki.local.wmftest.net:host-gateway -v $PWD:/e2e -w /e2e cypress/included:latest

https://gerrit.wikimedia.org/r/c/mediawiki/extensions/FileImporter/+/976231

Event Timeline

I found a bit of prior work:

It looks like our CI images are already equipped with all the libraries Cypress might need, so the remaining work is to set up a patch to validate this possibility.

Change 976231 had a related patch set uploaded (by Mareike Heuer; author: Awight):

[mediawiki/extensions/FileImporter@master] Experimental cypress test

https://gerrit.wikimedia.org/r/976231

Some small work we can do to finish this up:

  • Write documentation and share team knowledge so that all devs can run cypress locally.
  • Implement one useful test case. Overhead of cypress is very low (currently 1 second of execution time) so it's not a problem to leave in place if we have even a small excuse.

Change 976231 abandoned by Awight:

[mediawiki/extensions/FileImporter@master] Experimental cypress test

Reason:

We've decided not to merge to this repo until there's a better use case for writing new web tests, but the Cypress glue will be copied over to Cite where we're more actively working, in task T353436.

https://gerrit.wikimedia.org/r/976231

awight moved this task from Tech Review to Done on the WMDE-TechWish-Sprint-2023-11-22 board.
awight updated Other Assignee, removed: awight.

Investigation was successful, although we won't merge the proof-of-concept code here for now. Setting up Cypress locally gave us a bit of trouble, but we were able to run on bare metal, in docker-dev, and most importantly in CI.