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] Check email for cancelled order #43985

Merged
merged 6 commits into from Jan 26, 2024
Merged

Conversation

Stojdza
Copy link
Contributor

@Stojdza Stojdza commented Jan 22, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes https://github.com/woocommerce/woocommerce-quality/issues/655

Using the similar approach as in checking new order emails, I added a test which cancels the order and checks if the email is received.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Run pnpm test:e2e-pw ./tests/e2e-pw/tests/merchant/order-emails.spec.js -g "can receive cancelled order email" --headed and verify is passed.
  2. Code review and verify approach.
  3. Make sure that CI jobs are ✅

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Add new "can receive cancelled order email" test

Comment

@Stojdza Stojdza requested review from a team January 22, 2024 23:20
@Stojdza Stojdza self-assigned this Jan 22, 2024
@github-actions github-actions bot added focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jan 22, 2024
Copy link
Contributor

Hi , @woocommerce/solaris, @woocommerce/vortex

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@Stojdza Stojdza added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 22, 2024
Comment on lines +124 to +128
await expect(
page.getByText(
`[${ storeName }]: Order #${ cancelledOrderId } has been cancelled`
)
).toBeVisible();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @lanej0 👋 This same approach can be used in the test above, can receive new order email. If this looks good to you and the team, I can also update other tests.

Copy link
Contributor

github-actions bot commented Jan 22, 2024

Test Results Summary

Commit SHA: e28b9d1

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests271001802895m 22s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@Stojdza Stojdza marked this pull request as draft January 23, 2024 10:23
@Stojdza Stojdza added the status: in progress This is being worked on. label Jan 23, 2024
@alopezari alopezari removed the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 23, 2024
@Stojdza Stojdza marked this pull request as ready for review January 23, 2024 12:22
@Stojdza Stojdza removed the status: in progress This is being worked on. label Jan 23, 2024
@Stojdza
Copy link
Contributor Author

Stojdza commented Jan 26, 2024

@woocommerce/solaris @woocommerce/vortex 👋 I would appreciate some 👀 on this one so it doesn't get stale. Thanks!

Copy link
Contributor

@veljkho veljkho left a comment

Choose a reason for hiding this comment

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

Looks good to me. However, I am not a fan of using API to trigger something like this; I would rather go to the existing order and edit it to change its status to from processing to canceled and then wait for the email.

At this stage, this seems enough, as other tests are also created the same way. 👍

Copy link
Contributor

@rrennick rrennick left a comment

Choose a reason for hiding this comment

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

LGTM

@Stojdza
Copy link
Contributor Author

Stojdza commented Jan 26, 2024

Looks good to me. However, I am not a fan of using API to trigger something like this; I would rather go to the existing order and edit it to change its status to from processing to canceled and then wait for the email.

Thank you @veljkho for bringing this up. This is a broader topic that we can discuss on a p2 with the team and we can make some decisions on how to approach this in the future

@Stojdza Stojdza merged commit 324b816 into trunk Jan 26, 2024
31 checks passed
@Stojdza Stojdza deleted the e2e/email-cancelled-order branch January 26, 2024 16:09
@github-actions github-actions bot added this to the 8.7.0 milestone Jan 26, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 26, 2024
@veljkho veljkho added status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: e2e tests Issues related to e2e tests plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants