woocommerce/tests/e2e/utils
Ron Rennick c17b6b5ad0 Update expected industry count 2020-10-01 14:46:04 -03:00
..
src Update expected industry count 2020-10-01 14:46:04 -03:00
README.md Addressing comments. 2020-08-10 21:27:20 +01:00
package-lock.json Updated the JSDoc and type-safety of repositories to better document the implemented operations 2020-09-24 14:22:38 -07:00
package.json Moved the factories from the @woocommerce/api package into the @woocommerce/e2e-utils package 2020-09-21 13:14:26 -07: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.' } );
	} );
} );