Update test scenarios to cover both flows

This commit is contained in:
Veljko 2021-04-22 10:21:36 +02:00
parent ce2f04feeb
commit fd85f8239b
1 changed files with 11 additions and 3 deletions

View File

@ -69,19 +69,21 @@ const runAddSimpleProductTest = () => {
// Set product data and publish the product
await expect(page).toFill('#title', VirtualProductName);
await expect(page).toClick('#_virtual');
await clickTab('General');
await expect(page).toFill('#_regular_price', simpleProductPrice);
await verifyAndPublish();
await merchant.logout();
// See product in the shop end and add to the cart
// See product in the shop and add it to the cart
await shopper.goToShop();
await shopper.addToCartFromShopPage(VirtualProductName);
await shopper.goToCart();
await shopper.productIsInCart(VirtualProductName);
// Assert that the page does not contain shipping calculation button
await expect(page).not.toMatchElement('a.shipping-calculator-button');
// Remove product from cart
await shopper.removeFromCart(VirtualProductName);
});
@ -96,12 +98,18 @@ const runAddSimpleProductTest = () => {
await expect(page).toFill('#_regular_price', simpleProductPrice);
await verifyAndPublish();
// See product in the shop end and add to the cart
await merchant.logout();
// See product in the shop and add it to the cart
await shopper.goToShop();
await shopper.addToCartFromShopPage(NonVirtualProductName);
await shopper.goToCart();
await shopper.productIsInCart(NonVirtualProductName);
// Assert that the page does contain shipping calculation button
await page.waitForSelector('a.shipping-calculator-button');
await expect(page).toMatchElement('a.shipping-calculator-button');
// Remove product from cart
await shopper.removeFromCart(NonVirtualProductName);
});