Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e testing is now scaffolded (via Cypress and wp-env) #5533

Merged
merged 8 commits into from
Jan 4, 2021

Conversation

lindseymacmillan
Copy link
Contributor

@lindseymacmillan lindseymacmillan commented Dec 28, 2020

Resolves #5511

Description

This PR scaffolds new e2e tests powered by Cypress and wp-env, and removes deprecated e2e tests (which were run with Jest and Puppeteer). After running npm install and ensuring they have Docker Desktop (or equivalent Docker dependencies) installed, developers can now run the test:e2e command to begin local e2e testing with Cypress.

Affects

This PR affects existing e2e testing, and introduces the npm run test:e2e command to run new tests with Cypress.

Visuals

https://www.loom.com/share/182a0f6fe44245e7b436697fdd9fe032

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @since tags included in DocBlocks
  • Changes logged to the Unreleased section of CHANGELOG.md
  • Self Review of code and UX completed

Testing Instructions

  1. Install Docker Desktop (or equivalent dependencies)
  2. Run npm install to ensure Cypress is installed
  3. Run npm run test:e2e to open Cypress
  4. Select the sample_spec.js test, check that it loads the Reports dashboard as expected

Copy link
Member

@DevinWalker DevinWalker left a comment

Choose a reason for hiding this comment

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

A few questions


### Automation testing
Copy link
Member

Choose a reason for hiding this comment

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

All this content is pretty informative for our old tests. @henryholtgeerts are we planning on writing similar content in our Gitbook?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! A version of this information, made more specifically relevant to our new e2e testing methodology, will be included in the GitBook. I opted to add a link to the GitBook, rather than expand on the info too much in this README, since the GitBook will be more up to date and comprehensive.

@@ -1,294 +0,0 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

@henryholtgeerts can we easily repurpose these tests rather than deleting them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just wrapped up an audit of the old tests this morning -- some of the specs are no longer relevant but what is still testing non-deprecated functionality I'll be using to inform new e2e tests (what to test, and how to test it). Because the old tests are not using the Cypress framework, the tests will need to be rewritten, but they do serve as useful guides/checklists for writing new tests. 👍

@kjohnson
Copy link
Member

kjohnson commented Jan 4, 2021

I ran into some install issues, unrelated to the PR, and tracked down an answer in the gutenberg repository, as the issue seems related to dependencies of wp-env, see WordPress/gutenberg#22398 (comment)

Additionally, I found that I needed to run cypress install (which didn't work), instead running ./node_modules/.bin/cypress install, see cypress-io/cypress#2610 (comment)

@kjohnson kjohnson merged commit 1b44c93 into develop Jan 4, 2021
@kjohnson kjohnson deleted the feature/scaffold-e2e-testing branch January 4, 2021 19:08
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.

e2e testing should be scaffolded in core with Cypress and wp-env
3 participants