2020-04-21 11:44:55 +00:00
|
|
|
# WooCommerce End to End Test Utilities
|
|
|
|
|
2020-07-10 22:12:21 +00:00
|
|
|
This package contains utilities to simplify writing e2e tests specific to WooCommmerce.
|
2020-04-21 11:44:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm install @woocommerce/e2e-utils --save
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Example:
|
|
|
|
~~~js
|
|
|
|
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.' } );
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
~~~
|