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

Delete coupons instead of trashing them #30696

Merged
merged 7 commits into from
Sep 24, 2021
Merged

Delete coupons instead of trashing them #30696

merged 7 commits into from
Sep 24, 2021

Conversation

rrennick
Copy link
Contributor

Changes proposed in this Pull Request:

This PR updates the new coupon test to delete the created coupon instead of trashing it. It adds a waitForTimeout utility function and AdminEdit, OrderEdit utility classes.

Closes #30371 .

How to test the changes in this Pull Request:

  1. Verify CI
  2. Run E2E tests locally

@rrennick rrennick added category: E2E package: @woocommerce/e2e-core-tests Issues related to @woocommerce/e2e-core-tests package. package: @woocommerce/e2e-utils Issues related to @woocommerce/e2e-utils package. labels Sep 10, 2021
@rrennick rrennick self-assigned this Sep 10, 2021
@rrennick rrennick force-pushed the fix/30371 branch 2 times, most recently from 369b935 to ce1b1a6 Compare September 13, 2021 17:59
Copy link
Contributor

@zhongruige zhongruige left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @rrennick! These ran great for me locally.

Only a few minor comments on text changes and a question. Otherwise this looks good to merge once those are addressed.

## Added

- `utils.waitForTimeout( delay )` pause processing for `delay` milliseconds
- `AdminEdit`, `OrderEdit` classes with utility functions for the respctive edit screens
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor typo:

Suggested change
- `AdminEdit`, `OrderEdit` classes with utility functions for the respctive edit screens
- `AdminEdit`, `OrderEdit` classes with utility functions for the respective edit screens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, fixed in 5ccf3a5

@@ -153,6 +153,34 @@ This package provides support for enabling retries in tests:
| `updatePaymentGateway`| `paymentGatewayId`, `payload` | Update a payment gateway |
| `getSystemEnvironment` | | Get the current environment from the WooCommerce system status API.

### Classes

The package includes the following page specific utility classes
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a minor suggestion to add a colon at the end:

Suggested change
The package includes the following page specific utility classes
The package includes the following page specific utility classes:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 5ccf3a5

await expect( page ).toMatchElement(
'#woocommerce-order-notes .note_content',
{
text: 'Order status changed from Pending payment to Processing.',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we always expect the Processing status and note status text to be present (e.g., Order status changed from Pending payment to Processing. ) when using verifyPublish() here, or do we need to make them more dynamic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zhongruige Thanks for pointing this out. That test is specific to our test flow so I moved that test to there. That eliminated the need for the OrderEdit class so I removed it.

This is ready for another review.

Copy link
Contributor

@zhongruige zhongruige left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @rrennick!

The changes look good and the tests ran great for me locally.

:shipit:

@zhongruige zhongruige merged commit 982fec1 into trunk Sep 24, 2021
@zhongruige zhongruige deleted the fix/30371 branch September 24, 2021 20:09
@github-actions github-actions bot added this to the 5.9.0 milestone Sep 24, 2021
@github-actions
Copy link
Contributor

Hi @zhongruige, thanks for merging this pull request. Please take a look at these follow-up tasks you may need to perform:

  • Add the status: needs changelog label
  • Add the status: needs testing instructions label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: @woocommerce/e2e-core-tests Issues related to @woocommerce/e2e-core-tests package. package: @woocommerce/e2e-utils Issues related to @woocommerce/e2e-utils package.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup orders and coupons left in the trash after the tests run
2 participants