mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Refactor test
This commit is contained in:
parent
493933a1c1
commit
26e0e9b828
1 changed files with 7 additions and 4 deletions
|
@ -52,6 +52,11 @@ async function loginIntoPaypal(popup) {
|
||||||
await popup.locator('#btnLogin').click();
|
await popup.locator('#btnLogin').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function expectOrderReceivedPage(page) {
|
||||||
|
const title = await page.locator('.entry-title');
|
||||||
|
await expect(title).toHaveText('Order received');
|
||||||
|
}
|
||||||
|
|
||||||
test('PayPal button place order from Product page', async ({page}) => {
|
test('PayPal button place order from Product page', async ({page}) => {
|
||||||
|
|
||||||
await page.goto(PRODUCT_URL);
|
await page.goto(PRODUCT_URL);
|
||||||
|
@ -69,8 +74,7 @@ test('PayPal button place order from Product page', async ({page}) => {
|
||||||
page.locator('#place_order').click(),
|
page.locator('#place_order').click(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const title = await page.locator('.entry-title');
|
await expectOrderReceivedPage(page);
|
||||||
await expect(title).toHaveText('Order received');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Advanced Credit and Debit Card (ACDC) place order from Checkout page', async ({page}) => {
|
test('Advanced Credit and Debit Card (ACDC) place order from Checkout page', async ({page}) => {
|
||||||
|
@ -97,8 +101,7 @@ test('Advanced Credit and Debit Card (ACDC) place order from Checkout page', asy
|
||||||
page.locator('.ppcp-dcc-order-button').click(),
|
page.locator('.ppcp-dcc-order-button').click(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const title = await page.locator('.entry-title');
|
await expectOrderReceivedPage(page);
|
||||||
await expect(title).toHaveText('Order received');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('PayPal express block', async ({page}) => {
|
test('PayPal express block', async ({page}) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue