2022-03-07 15:23:31 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { shopper } from '../../../utils';
|
|
|
|
import { SIMPLE_PRODUCT_NAME } from '../../../utils/constants';
|
|
|
|
|
|
|
|
const block = {
|
|
|
|
name: 'Cart',
|
|
|
|
};
|
|
|
|
|
|
|
|
if ( process.env.WOOCOMMERCE_BLOCKS_PHASE < 2 )
|
|
|
|
// eslint-disable-next-line jest/no-focused-tests
|
|
|
|
test.only( `skipping ${ block.name } tests`, () => {} );
|
|
|
|
|
|
|
|
describe( 'Shopper → Cart → Can proceed to checkout', () => {
|
2022-03-09 10:16:24 +00:00
|
|
|
beforeEach( async () => {
|
2022-03-07 15:23:31 +00:00
|
|
|
await shopper.block.emptyCart();
|
|
|
|
} );
|
|
|
|
|
|
|
|
afterAll( async () => {
|
|
|
|
await shopper.block.emptyCart();
|
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'allows customer to proceed to checkout', async () => {
|
|
|
|
await shopper.goToShop();
|
|
|
|
await shopper.addToCartFromShopPage( SIMPLE_PRODUCT_NAME );
|
|
|
|
await shopper.block.goToCart();
|
|
|
|
|
|
|
|
// Click on "Proceed to Checkout" button
|
2022-03-09 10:16:24 +00:00
|
|
|
await shopper.block.proceedToCheckout();
|
2022-03-07 15:23:31 +00:00
|
|
|
|
|
|
|
// Verify that you see the Checkout Block page
|
|
|
|
await expect( page ).toMatchElement( 'h1', { text: 'Checkout' } );
|
|
|
|
} );
|
|
|
|
} );
|