From 4480e110f43b858ee90a9cb68623291c8632f80a Mon Sep 17 00:00:00 2001 From: Ron Rennick Date: Mon, 12 Apr 2021 14:33:00 -0300 Subject: [PATCH] update core tests & utils readmes --- tests/e2e/core-tests/README.md | 5 ++++ tests/e2e/utils/README.md | 55 ++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/tests/e2e/core-tests/README.md b/tests/e2e/core-tests/README.md index d6c4d04c005..335229f363a 100644 --- a/tests/e2e/core-tests/README.md +++ b/tests/e2e/core-tests/README.md @@ -30,6 +30,11 @@ runShopperTests(); ``` +## Retrying/Re-running tests + +On a new site, the setup and activation tests prepare the site for the remainder of the tests. To retry/rerun the test suite on a site where setup/onboarding test have already run use the environment variable `E2E_RETEST=1`. + + ## Test functions The functions to access the core tests are: diff --git a/tests/e2e/utils/README.md b/tests/e2e/utils/README.md index 2c366aabaf8..8119b274fdf 100644 --- a/tests/e2e/utils/README.md +++ b/tests/e2e/utils/README.md @@ -31,6 +31,50 @@ describe( 'Cart page', () => { } ); ~~~ +### Retries + +This package provides support for enabling retries in tests: + +- In the test environment set `E2E_RETEST=1`. +- To add conditional logic to your tests use the boolean constant `IS_RETEST_MODE`. + +### Available constants + +#### Dashboard + +- `WP_ADMIN_LOGIN` - WordPress login +- `WP_ADMIN_DASHBOARD` - WordPress dashboard +- `WP_ADMIN_PLUGINS` - Plugin list +- `WP_ADMIN_PERMALINK_SETTINGS` - Permalink settings +- `WP_ADMIN_ALL_USERS_VIEW` - WordPress user list +- `WP_ADMIN_POST_TYPE` - Post listing +- `WP_ADMIN_NEW_POST_TYPE` - New post +- `WP_ADMIN_ALL_COUPONS_VIEW` - Coupons list +- `WP_ADMIN_NEW_COUPON` - New coupon +- `WP_ADMIN_ALL_ORDERS_VIEW` - Orders list +- `WP_ADMIN_NEW_ORDER` - New Order +- `WP_ADMIN_ALL_PRODUCTS_VIEW` - Products list +- `WP_ADMIN_NEW_PRODUCT` - New product +- `WP_ADMIN_IMPORT_PRODUCTS` - Import products +- `WP_ADMIN_PLUGIN_PAGE` - Plugin settings page root +- `WP_ADMIN_WC_HOME` - WooCommerce home screen +- `WP_ADMIN_SETUP_WIZARD` - WooCommerce setup/onboarding wizard +- `WP_ADMIN_ANALYTICS_PAGES` - WooCommerce analytics page root +- `WP_ADMIN_WC_SETTINGS` - WooCommerce settings page root +- `WP_ADMIN_NEW_SHIPPING_ZONE` - WooCommerce new shipping zone + +#### Front end + +- `SHOP_PAGE` - Shop page +- `SHOP_PRODUCT_PAGE` - Single product page +- `SHOP_CART_PAGE` - Cart page +- `SHOP_CHECKOUT_PAGE` - Checkout page +- `SHOP_MY_ACCOUNT_PAGE` - Customer account page +- `MY_ACCOUNT_ORDERS` - Customer orders +- `MY_ACCOUNT_DOWNLOADS` - Customer downloads +- `MY_ACCOUNT_ADDRESSES` - Customer addresses +- `MY_ACCOUNT_ACCOUNT_DETAILS` - Customer account details + ## Test Function ### Merchant `merchant` @@ -82,6 +126,17 @@ describe( 'Cart page', () => { | `searchForProduct` | | Searching for a product name and landing on its detail page | | `emptyCart` | | Removes any products and coupons that are in the cart | +### REST API `withRestApi` + +| Function | Parameters | Description | +|----------|------------|-------------| +| `resetOnboarding` | | Reset onboarding settings | +| `deleteAllCoupons` | | Permanently delete all coupons | +| `deleteAllProducts` | | Permanently delete all products | +| `deleteAllShippingZones` | | Permanently delete all shipping zones except the default | +| `deleteCustomerByEmail` | `emailAddress` | Delete customer user account. Posts are reassigned to user ID 1 | +| `resetSettingsGroupToDefault` | `settingsGroup` | Reset settings in settings group to default except `select` fields | + ### Page Utilities | Function | Parameters | Description |