mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Refactor/fix continuation handling in pw
This commit is contained in:
parent
39b5673435
commit
e0a39b1c4e
1 changed files with 22 additions and 7 deletions
|
@ -21,11 +21,25 @@ async function completeBlockContinuation(page) {
|
||||||
|
|
||||||
await expect(page.locator('.component-frame')).toHaveCount(0);
|
await expect(page.locator('.component-frame')).toHaveCount(0);
|
||||||
|
|
||||||
await page.locator('.wc-block-components-checkout-place-order-button').click();
|
await Promise.all(
|
||||||
|
page.waitForNavigation(),
|
||||||
|
page.locator('.wc-block-components-checkout-place-order-button').click(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
await page.waitForNavigation();
|
async function expectContinuation(page) {
|
||||||
|
await expect(page.locator('#payment_method_ppcp-gateway')).toBeChecked();
|
||||||
|
|
||||||
await expectOrderReceivedPage(page);
|
await expect(page.locator('.component-frame')).toHaveCount(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function completeContinuation(page) {
|
||||||
|
await expectContinuation(page);
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
page.waitForNavigation(),
|
||||||
|
page.locator('#place_order').click(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
test.describe('Classic checkout', () => {
|
test.describe('Classic checkout', () => {
|
||||||
|
@ -44,10 +58,7 @@ test.describe('Classic checkout', () => {
|
||||||
|
|
||||||
await fillCheckoutForm(page);
|
await fillCheckoutForm(page);
|
||||||
|
|
||||||
await Promise.all([
|
await completeContinuation(page);
|
||||||
page.waitForNavigation(),
|
|
||||||
page.locator('#place_order').click(),
|
|
||||||
]);
|
|
||||||
|
|
||||||
await expectOrderReceivedPage(page);
|
await expectOrderReceivedPage(page);
|
||||||
});
|
});
|
||||||
|
@ -97,6 +108,8 @@ test.describe('Block checkout', () => {
|
||||||
await completePaypalPayment(popup);
|
await completePaypalPayment(popup);
|
||||||
|
|
||||||
await completeBlockContinuation(page);
|
await completeBlockContinuation(page);
|
||||||
|
|
||||||
|
await expectOrderReceivedPage(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('PayPal express block cart', async ({page}) => {
|
test('PayPal express block cart', async ({page}) => {
|
||||||
|
@ -109,6 +122,8 @@ test.describe('Block checkout', () => {
|
||||||
await completePaypalPayment(popup);
|
await completePaypalPayment(popup);
|
||||||
|
|
||||||
await completeBlockContinuation(page);
|
await completeBlockContinuation(page);
|
||||||
|
|
||||||
|
await expectOrderReceivedPage(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
test.describe('Without review', () => {
|
test.describe('Without review', () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue