From fd85f8239bb166a793d8d953b5e4d7dc86b54502 Mon Sep 17 00:00:00 2001 From: Veljko Date: Thu, 22 Apr 2021 10:21:36 +0200 Subject: [PATCH] Update test scenarios to cover both flows --- .../specs/merchant/wp-admin-product-new.test.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js index f944d99d82d..5ef7630151e 100644 --- a/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js +++ b/tests/e2e/core-tests/specs/merchant/wp-admin-product-new.test.js @@ -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); });