mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add express block playwright test
This commit is contained in:
parent
02bec2b611
commit
10cf1b9408
2 changed files with 20 additions and 0 deletions
|
@ -3,6 +3,7 @@ PPCP_E2E_WP_DIR=${ROOT_DIR}/.ddev/wordpress
|
|||
BASEURL="https://woocommerce-paypal-payments.ddev.site"
|
||||
|
||||
PRODUCT_URL="/product/prod"
|
||||
PRODUCT_ID=123
|
||||
|
||||
CUSTOMER_EMAIL="customer@example.com"
|
||||
CUSTOMER_PASSWORD="password"
|
||||
|
|
|
@ -7,6 +7,7 @@ const {
|
|||
CREDIT_CARD_EXPIRATION,
|
||||
CREDIT_CARD_CVV,
|
||||
PRODUCT_URL,
|
||||
PRODUCT_ID,
|
||||
} = process.env;
|
||||
|
||||
async function fillCheckoutForm(page) {
|
||||
|
@ -99,3 +100,21 @@ test('Advanced Credit and Debit Card (ACDC) place order from Checkout page', asy
|
|||
const title = await page.locator('.entry-title');
|
||||
await expect(title).toHaveText('Order received');
|
||||
});
|
||||
|
||||
test('PayPal express block', async ({page}) => {
|
||||
|
||||
await page.goto('/cart?add-to-cart=' + PRODUCT_ID);
|
||||
|
||||
await page.goto('/blocks-checkout')
|
||||
|
||||
const popup = await openPaypalPopup(page);
|
||||
|
||||
await loginIntoPaypal(popup);
|
||||
|
||||
await popup.locator('#payment-submit-btn').click();
|
||||
|
||||
await page.waitForNavigation();
|
||||
|
||||
const title = await page.locator('.entry-title');
|
||||
await expect(title).toHaveText('Order received');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue