Introduce store owner logout flow
This commit is contained in:
parent
504de0012c
commit
f970111721
|
@ -5,13 +5,13 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { activatePlugin, switchUserToTest } from '@wordpress/e2e-test-utils';
|
||||
import { activatePlugin } from '@wordpress/e2e-test-utils';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { createSimpleProduct, createVariableProduct } from "../../utils/components";
|
||||
import { CustomerFlow } from "../../utils/flows";
|
||||
import { CustomerFlow, StoreOwnerFlow } from "../../utils/flows";
|
||||
import { uiUnblocked } from '../../utils';
|
||||
|
||||
describe( 'Single Product Page', () => {
|
||||
|
@ -19,7 +19,7 @@ describe( 'Single Product Page', () => {
|
|||
await activatePlugin( 'woocommerce' );
|
||||
await createSimpleProduct();
|
||||
await createVariableProduct();
|
||||
await switchUserToTest();
|
||||
await StoreOwnerFlow.logout();
|
||||
} );
|
||||
|
||||
it( 'should be able to add simple products to the cart', async () => {
|
||||
|
|
|
@ -82,6 +82,19 @@ const CustomerFlow = {
|
|||
};
|
||||
|
||||
const StoreOwnerFlow = {
|
||||
logout: async () => {
|
||||
await page.goto( baseUrl + '/wp-login.php?action=logout', {
|
||||
waitUntil: 'networkidle0',
|
||||
} );
|
||||
|
||||
await expect( page ).toMatch( 'You are attempting to log out' );
|
||||
|
||||
await Promise.all( [
|
||||
page.waitForNavigation( { waitUntil: 'networkidle0' } ),
|
||||
page.click( 'a' ),
|
||||
] );
|
||||
},
|
||||
|
||||
openNewProduct: async () => {
|
||||
await page.goto( WP_ADMIN_NEW_PRODUCT, {
|
||||
waitUntil: 'networkidle0',
|
||||
|
|
Loading…
Reference in New Issue