2019-08-29 16:09:42 +00:00
|
|
|
/**
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2020-04-20 11:33:17 +00:00
|
|
|
import {
|
|
|
|
StoreOwnerFlow,
|
|
|
|
verifyPublishAndTrash
|
|
|
|
} from '@woocommerce/e2e-utils';
|
2019-08-29 16:09:42 +00:00
|
|
|
|
|
|
|
describe( 'Add New Order Page', () => {
|
|
|
|
beforeAll( async () => {
|
2019-11-24 13:08:48 +00:00
|
|
|
await StoreOwnerFlow.login();
|
2019-08-29 16:09:42 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
it( 'can create new order', async () => {
|
|
|
|
// Go to "add order" page
|
|
|
|
await StoreOwnerFlow.openNewOrder();
|
|
|
|
|
|
|
|
// Make sure we're on the add order page
|
|
|
|
await expect( page.title() ).resolves.toMatch( 'Add new order' );
|
|
|
|
|
|
|
|
// Set order data
|
|
|
|
await expect( page ).toSelect( '#order_status', 'Processing' );
|
|
|
|
await expect( page ).toFill( 'input[name=order_date]', '2018-12-13' );
|
|
|
|
await expect( page ).toFill( 'input[name=order_date_hour]', '18' );
|
|
|
|
await expect( page ).toFill( 'input[name=order_date_minute]', '55' );
|
|
|
|
|
|
|
|
// Create order, verify that it was created. Trash order, verify that it was trashed.
|
|
|
|
await verifyPublishAndTrash(
|
|
|
|
'.order_actions li .save_order',
|
|
|
|
'#message',
|
|
|
|
'Order updated.',
|
|
|
|
'1 order moved to the Trash.'
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
} );
|