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

Setup wp-env for E2E tests #2030

Merged
merged 4 commits into from
Aug 1, 2023
Merged

Setup wp-env for E2E tests #2030

merged 4 commits into from
Aug 1, 2023

Conversation

mikkamp
Copy link
Contributor

@mikkamp mikkamp commented Jul 31, 2023

Changes proposed in this Pull Request:

Our main goal is to convert E2E tests from Puppeteer to PlayWright, as well as remove any dependencies for the WooCommerce E2E packages (as they will be deprecated).

This PR is intended to setup a wp-env site for running the E2E tests against, which previously was done using a docker image as part of @woocommerce/e2e-environment package. A followup PR will address converting tests to PlayWright.

Resolves part of #1599

Detailed test instructions:

  1. Checkout this PR and run nvm use && npm ci
  2. Start the wp-env site npm run wp-env start
  3. Once completed confirm the site is running at http://localhost:8889
  4. Run the E2E tests npm run test:e2e and confirm it uses the site http://localhost:8889
  5. Expect only some of the tests to pass (some will still fail but that will be fixed when converting to PlayWright)

Additional details:

Some of the tests still fail, because the related products section has switched to blocks and also because some of the tests have been flaking. Since this is the reason we are switching to PlayWright, the failing tests will be addressed there.

It's still possible to get the previous test site up and running with npm run docker:up, all that will be removed once the full dependency on the WooCommerce packages is no longer needed. This is still being used by GitHub actions on release branches.

The command to add a ready page was added because the wc-e2e script waits explicitly till this page is available. Once we convert to PlayWright it should be possible to remove this.

Changelog entry

  • Dev - Setup wp-env for E2E tests.

@mikkamp mikkamp self-assigned this Jul 31, 2023
@mikkamp mikkamp marked this pull request as ready for review July 31, 2023 08:38
@mikkamp mikkamp requested a review from a team July 31, 2023 08:38
Copy link
Contributor

@martynmjones martynmjones left a comment

Choose a reason for hiding this comment

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

Hey @mikkamp,

The environment was properly set up when testing locally and the test:e2e script is using the correct URL so LGTM ✅

@mikkamp mikkamp merged commit d3b4e39 into develop Aug 1, 2023
7 checks passed
@mikkamp mikkamp deleted the e2e/setup-wp-env branch August 1, 2023 07:59
@eason9487 eason9487 added the changelog: dev Developer-facing only change. label Aug 1, 2023
@martynmjones martynmjones mentioned this pull request Aug 1, 2023
17 tasks
@puntope puntope mentioned this pull request Aug 29, 2023
Closed
@mikkamp mikkamp mentioned this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: dev Developer-facing only change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants