mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add e2e test for adding subscription from single product page
This commit is contained in:
parent
e0228dbad3
commit
50dd59ec77
1 changed files with 26 additions and 1 deletions
|
@ -108,7 +108,7 @@ test.describe.serial('Subscriptions Merchant', () => {
|
|||
});
|
||||
|
||||
test.describe('Subscriptions Customer', () => {
|
||||
test('Purchase subscription', async ({page}) => {
|
||||
test('Purchase Subscription from Checkout Page', async ({page}) => {
|
||||
await loginAsCustomer(page);
|
||||
|
||||
await page.goto('/product/another-sub');
|
||||
|
@ -134,4 +134,29 @@ test.describe('Subscriptions Customer', () => {
|
|||
const title = page.locator('.entry-title');
|
||||
await expect(title).toHaveText('Order received');
|
||||
});
|
||||
|
||||
test('Purchase Subscription from Single Product Page', async ({page}) => {
|
||||
await loginAsCustomer(page);
|
||||
await page.goto('/product/subscription');
|
||||
|
||||
const [popup] = await Promise.all([
|
||||
page.waitForEvent('popup'),
|
||||
page.frameLocator('.component-frame').locator('[data-funding-source="paypal"]').click(),
|
||||
]);
|
||||
await popup.waitForLoadState();
|
||||
|
||||
await popup.fill('#email', CUSTOMER_EMAIL);
|
||||
await popup.locator('#btnNext').click();
|
||||
await popup.fill('#password', CUSTOMER_PASSWORD);
|
||||
await popup.locator('#btnLogin').click();
|
||||
await popup.locator('text=Continue').click();
|
||||
await popup.locator('#confirmButtonTop').click();
|
||||
|
||||
await fillCheckoutForm(page);
|
||||
|
||||
await page.locator('text=Sign up now').click();
|
||||
|
||||
const title = page.locator('.entry-title');
|
||||
await expect(title).toHaveText('Order received');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue