woocommerce/packages/js/admin-e2e-tests
Christopher Allford 4c4e89bc98
Enhance Build Watching (#42712)
Similarly to `build:project`, a new `watch:build:project`
script will watch individual projects for changes. The
`watch:build` script has been updated so that it does
a deep watch in the same vein as `build`. We have also
hooked up tool-level watching for faster performance.
2023-12-12 12:43:48 -08:00
..
changelog dev: edited package.json lint scripts to output to console (#41498) 2023-11-21 11:16:08 +08:00
src Change WooCommerce Payments to WooPayments across the WC Core (#39188) 2023-07-13 12:58:17 +03:00
typings Moved WCA Packages 2022-03-18 14:25:26 -07:00
.eslintrc.js reference local eslint plugin package 2022-04-28 10:00:29 +12:00
.npmrc Moved WCA Packages 2022-03-18 14:25:26 -07:00
CHANGELOG.md Revert "Changed e2e payment settings page detection" 2022-04-21 14:08:32 +08:00
README.md chore: Unify imports syntax in admin-e2e, add missing dependencies (#33901) 2022-08-29 10:36:36 +08:00
composer.json Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
composer.lock Update changelogger to 3.3.0 to support PR number capturing with merge (#36266) 2023-01-05 14:42:51 +05:30
package.json Enhance Build Watching (#42712) 2023-12-12 12:43:48 -08:00
tsconfig.json Enforce Strict `@types` Dependencies (#37351) 2023-03-23 18:02:20 -07: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

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

Usage

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

import { testAdminBasicSetup } from '@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