woocommerce/tests/e2e-utils
Tam Mullen 4544190462 Updating e2e-utils dependencies. 2020-08-10 21:26:10 +01:00
..
README.md Adding e2e-utils README 2020-08-10 21:26:10 +01:00
components.js Converting e2e-utils to package. 2020-08-10 21:26:10 +01:00
flows.js Converting e2e-utils to package. 2020-08-10 21:26:10 +01:00
index.js Adding e2e-utils README 2020-08-10 21:26:10 +01:00
package.json Updating e2e-utils dependencies. 2020-08-10 21:26:10 +01:00
page-utils.js Converting e2e-utils to package. 2020-08-10 21:26:10 +01:00

README.md

WooCommerce End to End Test Utilities

This package contains utilities needed to write e2e tests (specific to WooCommerce).

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.' } );
	} );
} );