Add express block playwright test

This commit is contained in:
Alex P 2023-03-23 09:03:17 +02:00
parent 02bec2b611
commit 10cf1b9408
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 20 additions and 0 deletions

View file

@ -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"

View file

@ -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');
});