Add after all scenario

This commit is contained in:
Veljko 2021-03-19 11:58:20 +01:00
parent cc5b57da94
commit fe51a15dcb
2 changed files with 14 additions and 2 deletions

View File

@ -64,6 +64,7 @@ const runShopperTests = () => {
};
const runMerchantTests = () => {
runImportProductsTest();
runOrderSearchingTest();
runAddNewShippingZoneTest();
runCreateCouponTest();
@ -80,7 +81,6 @@ const runMerchantTests = () => {
runProductEditDetailsTest();
runProductSearchTest();
runMerchantOrdersCustomerPaymentPage();
runImportProductsTest();
}
const runApiTests = () => {

View File

@ -4,7 +4,8 @@
*/
const {
merchant,
setCheckbox
setCheckbox,
moveAllItemsToTrash
} = require( '@woocommerce/e2e-utils' );
/**
@ -108,6 +109,17 @@ const runImportProductsTest = () => {
// Compare overriden product prices
expect(productPrices.sort()).toEqual(productPricesOverride.sort());
});
afterAll(async () => {
// Remove all the imported products
await page.waitForSelector('#cb-select-all-1', {visible:true});
await moveAllItemsToTrash();
await page.waitForSelector('ul.subsubsub li.trash a', {visible:true});
await page.click('ul.subsubsub li.trash a');
await page.waitForSelector('#delete_all', {visible:true});
await page.click('#delete_all');
await page.waitForSelector('a.woocommerce-BlankState-cta.button-primary.button ~ a', {visible:true});
});
});
};