woocommerce/plugins/woocommerce-admin/packages/admin-e2e-tests
Moon 718bac6981 Prompt a modal to save any unsaved changes in OBW (https://github.com/woocommerce/woocommerce-admin/pull/8278)
* Add a modal to show when unsaved changes are detected

* Add functions to track value changes from the steps

* Warn unsaved changes for the store details

* Add styles for the unsaved modal

* Warn unsaved changes for the Industry

* Warn unsaved changes for the Product Types

* Warn unsaved changes for the Business Details

* Add changelog

* Add testing instructions.

* Sort array values before comparison

* Use only the array values to compare the diff

* Catch rejected promise on continue

* Set initial value to an empty object

* Fix failing tests
2022-02-17 11:15:11 -08:00
..
src Prompt a modal to save any unsaved changes in OBW (https://github.com/woocommerce/woocommerce-admin/pull/8278) 2022-02-17 11:15:11 -08:00
typings Add task list and activity panel E2E tests (https://github.com/woocommerce/woocommerce-admin/pull/7509) 2021-09-03 08:21:43 -03:00
.npmrc Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00
CHANGELOG.md Add tests to Subscriptions inclusion (https://github.com/woocommerce/woocommerce-admin/pull/7804) 2021-11-04 10:15:42 -03:00
README.md Create E2E package (https://github.com/woocommerce/woocommerce-admin/pull/7084) 2021-07-13 16:38:05 -03:00
package.json Dev/e2e reset (https://github.com/woocommerce/woocommerce-admin/pull/8219) 2022-02-02 08:55:10 -04:00
tsconfig.json Allow packages to be built in isolation. (https://github.com/woocommerce/woocommerce-admin/pull/7286) 2021-07-14 16:38:57 -04:00

README.md

Admin E2E Tests

An end-to-end test suite for WooCommerce setup, onboarding, home screen/task list, and analytics.

Installation

Install the module

npm install @woocommerce/admin-e2e-tests --save

Usage

Create a E2E test specification file under /tests/e2e/specs/example.test.js:

const { testAdminBasicSetup } = require( '@woocommerce/admin-e2e-tests' );

testAdminBasicSetup();

See the wooCommerce E2E Boilerplate for instructions on setting up an E2E test environment.

Configuration

Add the following entries to tests/e2e/config/default.json

  "onboardingwizard": {
    "industry": "Test industry",
    "numberofproducts": "1 - 10",
    "sellingelsewhere": "No"
  },
  "settings": {
    "shipping": {
      "zonename": "United States",
      "zoneregions": "United States (US)",
      "shippingmethod": "Free shipping"
    }
  }

Available tests

The following test functions are included in the package:

Function Description
testAdminBasicSetup Test that WooCommerce can be activated with pretty permalinks
testAdminOnboardingWizard Complete the onboarding wizard with US merchant
testAdminNonUSRecommendedFeatures Complete the onboarding wizard with non-US merchant
testSelectiveBundleWCPay Ensure onboarding wizard offers WC Payments in appropriate contexts
testAdminAnalyticsPages Test that the React App is functional on Analytics pages
testAdminCouponsPage Test that the Coupons is functional
testAdminPaymentSetupTask Test that payment methods can be configured