woocommerce/tests/e2e/utils
Christopher Allford c75f0f8886 Renamed the `@woocommerce/factories` package to `@woocommerce/api`
With the plan now to add more CRUD actions the scope of the package has transformed into a more general API package than one just for factories.
2020-09-03 12:28:17 -07:00
..
src Renamed the `@woocommerce/factories` package to `@woocommerce/api` 2020-09-03 12:28:17 -07:00
README.md Addressing comments. 2020-08-10 21:27:20 +01:00
factories.js Renamed the `@woocommerce/factories` package to `@woocommerce/api` 2020-09-03 12:28:17 -07:00
index.js Addressing comments. 2020-08-10 21:27:20 +01:00
package.json Addressing comments. 2020-08-10 21:27:20 +01:00
webpack-alias.js Addressing comments. 2020-08-10 21:27:20 +01:00

README.md

WooCommerce End to End Test Utilities

This package contains utilities to simplify writing e2e tests specific to WooCommmerce.

Installation

npm install @woocommerce/e2e-utils --save

Usage

Example:

import {
	CustomerFlow,
	StoreOwnerFlow,
	createSimpleProduct,
	uiUnblocked
} from '@woocommerce/e2e-utils';

describe( 'Cart page', () => {
	beforeAll( async () => {
		await StoreOwnerFlow.login();
		await createSimpleProduct();
		await StoreOwnerFlow.logout();
	} );

	it( 'should display no item in the cart', async () => {
		await CustomerFlow.goToCart();
		await expect( page ).toMatchElement( '.cart-empty', { text: 'Your cart is currently empty.' } );
	} );
} );