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

Allow E2E testing with Release Candidates #2043

Merged
merged 14 commits into from
Aug 9, 2023
Merged

Conversation

mikkamp
Copy link
Contributor

@mikkamp mikkamp commented Aug 4, 2023

Changes proposed in this Pull Request:

As a followup to PR #2041 this PR makes it easier to install Release Candidate versions of both WordPress and WooCommerce. The documentation has been updated to describe how the tests can be run with different versions of WordPress and WooCommerce.

Additionally several selectors in the test were updated as WooCommerce 8.0 introduces blocks for the standard checkout.

I also added workflow inputs to allow the E2E workflow to be run with release candidate versions of WP and/or WC. I ran the test successfully here with WP 6.3-RC3 and WC 8.0.0-rc.1.

Detailed test instructions:

  1. Checkout this PR and install packages: nvm use && npm ci
  2. Start the wp-env environment: npm run wp-env:up (if you previously had this running you might need to run npm run wp-env destroy)
  3. Install the Chromium browser for Playwright: npx playwright install chromium
  4. Update to WP RC:
npm run -- wp-env run tests-cli -- wp core update --version=6.3-RC3
npm run -- wp-env run tests-cli -- wp core update-db
  1. Update to WC RC:
npm run -- wp-env run tests-cli -- wp plugin update woocommerce --version=8.0.0-rc.1
npm run -- wp-env run tests-cli -- wp wc update
  1. Start the E2E tests: npm run test:e2e
  2. Confirm that all the tests pass

Changelog entry

  • Dev - Allow E2E testing with Release Candidates.

@mikkamp mikkamp self-assigned this Aug 4, 2023
@mikkamp mikkamp marked this pull request as ready for review August 4, 2023 15:22
@mikkamp mikkamp requested a review from a team August 4, 2023 15:22
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, thanks for adding an easy way to test with RCs.

Tested the branch locally and getting environments with specific versions set up and running tests against them is easy and works well.

Although not related directly to the changes here (I think) I am getting a test failure.

Screenshot 2023-08-09 at 09 17 08

It looks like the endpoint being called isn't available as the test-data.php plugin gets deactivated due to an invalid header.

Screenshot 2023-08-09 at 09 15 42

All others tests are passing though and no issues settings release candidates so LGTM ✅

@mikkamp
Copy link
Contributor Author

mikkamp commented Aug 9, 2023

It looks like the endpoint being called isn't available as the test-data.php plugin gets deactivated due to an invalid header.

Interesting error, I'm not able to replicate that and it's the first time I come across it. From a quick search on Google I see mentions of this happening when the plugin is activated too quick after installing, activating it a second time usually works. Do you still get that error after trying again?

One thing we could try is add a mapping in wp-env and then activate it in the install script (which is what WC does with a custom plugin). Should I add a commit for that change, or is that something you can test locally (since I'm not getting the same error here)?
I'd also recommend to run npm run wp:env destroy to start with a completely clean wp-env site.

Base automatically changed from e2e/playwright-tests to develop August 9, 2023 15:51
@mikkamp mikkamp merged commit 59ae6eb into develop Aug 9, 2023
5 checks passed
@mikkamp mikkamp deleted the e2e/wp-env-versions branch August 9, 2023 15:53
@eason9487 eason9487 added the changelog: dev Developer-facing only change. label Aug 15, 2023
@eason9487 eason9487 mentioned this pull request Aug 22, 2023
17 tasks
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.

3 participants