Improve test
This commit is contained in:
parent
21307e6603
commit
dfc38562ce
|
@ -36,10 +36,12 @@ const runAddNewShippingZoneTest = () => {
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
document.querySelector('.wc-shipping-zone-delete').click();
|
document.querySelector('.wc-shipping-zone-delete').click();
|
||||||
});
|
});
|
||||||
|
await page.waitFor(1000);
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
document.querySelector('.wc-shipping-zone-delete').click();
|
document.querySelector('.wc-shipping-zone-delete').click();
|
||||||
});
|
});
|
||||||
|
await page.waitFor(1000);
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -91,15 +93,10 @@ const runAddNewShippingZoneTest = () => {
|
||||||
await page.waitForSelector('.order-total');
|
await page.waitForSelector('.order-total');
|
||||||
await expect(page).toMatchElement('.shipping .amount', {text: '$10.00'});
|
await expect(page).toMatchElement('.shipping .amount', {text: '$10.00'});
|
||||||
await expect(page).toMatchElement('.order-total .amount', {text: '$19.99'});
|
await expect(page).toMatchElement('.order-total .amount', {text: '$19.99'});
|
||||||
|
});
|
||||||
await shopper.removeFromCart(simpleProductName);
|
|
||||||
})
|
|
||||||
|
|
||||||
it('allows customer to benefit from a Free shipping if in CA', async () => {
|
it('allows customer to benefit from a Free shipping if in CA', async () => {
|
||||||
await shopper.goToShop();
|
await page.reload();
|
||||||
await shopper.addToCartFromShopPage(simpleProductName);
|
|
||||||
await shopper.goToCart();
|
|
||||||
|
|
||||||
// Set shipping state to California
|
// Set shipping state to California
|
||||||
await expect(page).toClick('a.shipping-calculator-button');
|
await expect(page).toClick('a.shipping-calculator-button');
|
||||||
await expect(page).toClick('#select2-calc_shipping_state-container');
|
await expect(page).toClick('#select2-calc_shipping_state-container');
|
||||||
|
@ -113,14 +110,10 @@ const runAddNewShippingZoneTest = () => {
|
||||||
await page.waitForSelector('.order-total');
|
await page.waitForSelector('.order-total');
|
||||||
await expect(page).toMatchElement('.shipping ul#shipping_method > li', {text: 'Free shipping'});
|
await expect(page).toMatchElement('.shipping ul#shipping_method > li', {text: 'Free shipping'});
|
||||||
await expect(page).toMatchElement('.order-total .amount', {text: '$9.99'});
|
await expect(page).toMatchElement('.order-total .amount', {text: '$9.99'});
|
||||||
await shopper.removeFromCart(simpleProductName);
|
});
|
||||||
})
|
|
||||||
|
|
||||||
it('allows customer to benefit from a free Local pickup if in SF', async () => {
|
it('allows customer to benefit from a free Local pickup if in SF', async () => {
|
||||||
await shopper.goToShop();
|
await page.reload();
|
||||||
await shopper.addToCartFromShopPage(simpleProductName);
|
|
||||||
await shopper.goToCart();
|
|
||||||
|
|
||||||
// Set shipping postcode to 94107
|
// Set shipping postcode to 94107
|
||||||
await expect(page).toClick('a.shipping-calculator-button');
|
await expect(page).toClick('a.shipping-calculator-button');
|
||||||
await clearAndFillInput('#calc_shipping_postcode', '94107');
|
await clearAndFillInput('#calc_shipping_postcode', '94107');
|
||||||
|
@ -132,7 +125,7 @@ const runAddNewShippingZoneTest = () => {
|
||||||
await expect(page).toMatchElement('.order-total .amount', {text: '$9.99'});
|
await expect(page).toMatchElement('.order-total .amount', {text: '$9.99'});
|
||||||
|
|
||||||
await shopper.removeFromCart(simpleProductName);
|
await shopper.removeFromCart(simpleProductName);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue