woocommerce/tests/e2e/utils
Christopher Allford fba5a46243 Integrated the API package into the utils package again to generate simple products 2020-09-21 11:22:43 -07:00
..
src Integrated the API package into the utils package again to generate simple products 2020-09-21 11:22:43 -07:00
README.md Addressing comments. 2020-08-10 21:27:20 +01:00
package-lock.json Updated all of the package-lock files using Node v10 2020-09-09 14:47:35 -07:00
package.json Revised the base tsconfig to match Gutenberg more closely 2020-09-16 15:14:53 -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.' } );
	} );
} );