From 6f99121db177342b8df4a65e4121b84739aa840d Mon Sep 17 00:00:00 2001 From: Eduardo Umpierre Date: Tue, 11 Feb 2025 12:19:45 -0300 Subject: [PATCH] Add the critical tag to E2E tests that are part of critical flows (#10338) --- changelog/dev-10237-e2e-critical-flow-tag | 4 + ...bscriptions-renew-action-scheduler.spec.ts | 1 + .../merchant-subscriptions-renew.spec.ts | 1 + ...pper-subscriptions-manage-payments.spec.ts | 1 + ...-subscriptions-purchase-free-trial.spec.ts | 166 ++++++------ ...ns-purchase-multiple-subscriptions.spec.ts | 124 +++++---- ...bscriptions-purchase-no-signup-fee.spec.ts | 62 +++-- ...subscriptions-purchase-sign-up-fee.spec.ts | 16 +- .../merchant-multi-currency-widget.spec.ts | 184 +++++++------ .../merchant-orders-full-refund.spec.ts | 127 +++++---- .../merchant-orders-manual-capture.spec.ts | 64 +++-- .../merchant-orders-partial-refund.spec.ts | 2 +- .../merchant-orders-refund-failures.spec.ts | 77 +++--- .../merchant-orders-status-change.spec.ts | 2 +- ...nt-payment-settings-manual-capture.spec.ts | 1 + .../merchant-progressive-onboarding.spec.ts | 114 ++++---- .../multi-currency-on-boarding.spec.ts | 2 +- .../merchant/multi-currency-setup.spec.ts | 2 +- .../wcpay/merchant/multi-currency.spec.ts | 2 +- .../shopper/klarna-checkout-purchase.spec.ts | 52 ++-- .../shopper/shopper-bnpls-checkout.spec.ts | 2 +- .../shopper/shopper-checkout-failures.spec.ts | 256 ++++++++++-------- ...checkout-purchase-with-upe-methods.spec.ts | 143 +++++----- .../shopper/shopper-checkout-purchase.spec.ts | 4 +- ...er-checkout-save-card-and-purchase.spec.ts | 2 +- .../shopper-multi-currency-widget.spec.ts | 2 +- ...myaccount-payment-methods-add-fail.spec.ts | 46 ++-- ...opper-myaccount-renew-subscription.spec.ts | 1 + .../shopper-myaccount-saved-cards.spec.ts | 200 ++++++++------ .../shopper/shopper-pay-for-order.spec.ts | 2 +- ...hopper-wc-blocks-checkout-failures.spec.ts | 1 + ...hopper-wc-blocks-checkout-purchase.spec.ts | 1 + ...ocks-saved-card-checkout-and-usage.spec.ts | 1 + 33 files changed, 902 insertions(+), 763 deletions(-) create mode 100644 changelog/dev-10237-e2e-critical-flow-tag diff --git a/changelog/dev-10237-e2e-critical-flow-tag b/changelog/dev-10237-e2e-critical-flow-tag new file mode 100644 index 00000000000..e54400df56f --- /dev/null +++ b/changelog/dev-10237-e2e-critical-flow-tag @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Add critical tag to tests that are part of the critical flows. diff --git a/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew-action-scheduler.spec.ts b/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew-action-scheduler.spec.ts index f263bdfc391..27e8072b43f 100644 --- a/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew-action-scheduler.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew-action-scheduler.spec.ts @@ -21,6 +21,7 @@ import { // Run the tests if the two 'skip' environment variables are not set. describeif( shouldRunSubscriptionsTests && shouldRunActionSchedulerTests )( 'Subscriptions > Renew a subscription via Action Scheduler', + { tag: '@critical' }, () => { const actionSchedulerHook = 'woocommerce_scheduled_subscription_payment'; diff --git a/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew.spec.ts b/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew.spec.ts index d7b02b8e4f6..d3ac06bed0d 100644 --- a/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/merchant/merchant-subscriptions-renew.spec.ts @@ -25,6 +25,7 @@ let subscriptionId = null; describeif( shouldRunSubscriptionsTests )( 'Subscriptions > Renew a subscription as a merchant', + { tag: '@critical' }, () => { test.beforeAll( async ( { browser }, { project } ) => { const restApi = new RestAPI( project.use.baseURL ); diff --git a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-manage-payments.spec.ts b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-manage-payments.spec.ts index bcdec4cde7b..00bb92f8f63 100644 --- a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-manage-payments.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-manage-payments.spec.ts @@ -34,6 +34,7 @@ const navigateToSubscriptionDetails = async ( describeif( shouldRunSubscriptionsTests )( 'Shopper > Subscriptions > Manage Payment Methods', + { tag: '@critical' }, () => { let page: Page; let subscriptionId: string; diff --git a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-free-trial.spec.ts b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-free-trial.spec.ts index 83696be93c4..13bbd33d194 100644 --- a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-free-trial.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-free-trial.spec.ts @@ -67,94 +67,98 @@ describeif( shouldRunSubscriptionsTests )( } } ); - test( 'Shopper should be able to purchase a free trial', async ( { - browser, - } ) => { - const { shopperPage } = await getShopper( browser ); - // Just to be sure, empty the cart - await emptyCart( shopperPage ); + test( + 'Shopper should be able to purchase a free trial', + { tag: '@critical' }, + async ( { browser } ) => { + const { shopperPage } = await getShopper( browser ); + // Just to be sure, empty the cart + await emptyCart( shopperPage ); - // Open the subscription product, and verify that the - // 14-day free trial is shown in the product description - await goToProductPageBySlug( shopperPage, productSlug ); - await expect( - shopperPage - .locator( '.product' ) - .getByText( '/ month with a 14-day free trial' ) - ).toBeVisible(); - - // Add it to the cart and verify that the cart page shows the free trial details - await shopperPage - .getByRole( 'button', { name: 'Sign up now' } ) - .click(); - await goToCart( shopperPage ); - await expect( - shopperPage - .getByText( '/ month with a 14-day free trial' ) - .first() - ).toBeVisible(); + // Open the subscription product, and verify that the + // 14-day free trial is shown in the product description + await goToProductPageBySlug( shopperPage, productSlug ); + await expect( + shopperPage + .locator( '.product' ) + .getByText( '/ month with a 14-day free trial' ) + ).toBeVisible(); - // Also verify that the first renewal is 14 days from now - await expect( - shopperPage.getByText( - `First renewal: ${ renewalDateFormatted }` - ) - ).toBeVisible(); + // Add it to the cart and verify that the cart page shows the free trial details + await shopperPage + .getByRole( 'button', { name: 'Sign up now' } ) + .click(); + await goToCart( shopperPage ); + await expect( + shopperPage + .getByText( '/ month with a 14-day free trial' ) + .first() + ).toBeVisible(); - // Verify that the order total is $0.00 - await expect( - shopperPage - .getByRole( 'row', { - name: 'Total $0.00', - exact: true, - } ) - .locator( 'td' ) - ).toBeVisible(); + // Also verify that the first renewal is 14 days from now + await expect( + shopperPage.getByText( + `First renewal: ${ renewalDateFormatted }` + ) + ).toBeVisible(); - // Proceed to the checkout page and verify that the 14-day free trial is shown in the product line item, - // and that the first renewal date is 14 days from now. - await setupCheckout( shopperPage, customerBilling ); - await expect( - shopperPage - .locator( '#order_review' ) - .getByText( '/ month with a 14-day free trial' ) - ).toBeVisible(); - await expect( - shopperPage.getByText( - `First renewal: ${ renewalDateFormatted }` - ) - ).toBeVisible(); + // Verify that the order total is $0.00 + await expect( + shopperPage + .getByRole( 'row', { + name: 'Total $0.00', + exact: true, + } ) + .locator( 'td' ) + ).toBeVisible(); - // Pay using a 3DS card - const card = config.cards[ '3dsOTP' ]; - await fillCardDetails( shopperPage, card ); - await shopperPage - .getByRole( 'button', { name: 'Sign up now' } ) - .click(); - await shopperPage.frames()[ 0 ].waitForLoadState( 'load' ); - await confirmCardAuthentication( shopperPage, true ); - await shopperPage.frames()[ 0 ].waitForLoadState( 'networkidle' ); - await shopperPage.waitForLoadState( 'networkidle' ); - await expect( - shopperPage.getByRole( 'heading', { - name: 'Order received', - } ) - ).toBeVisible(); + // Proceed to the checkout page and verify that the 14-day free trial is shown in the product line item, + // and that the first renewal date is 14 days from now. + await setupCheckout( shopperPage, customerBilling ); + await expect( + shopperPage + .locator( '#order_review' ) + .getByText( '/ month with a 14-day free trial' ) + ).toBeVisible(); + await expect( + shopperPage.getByText( + `First renewal: ${ renewalDateFormatted }` + ) + ).toBeVisible(); - // Get the order ID so we can open it in the merchant view - orderId = ( - await shopperPage.getByText( 'Order number:' ).innerText() - ) - .replace( /[^0-9]/g, '' ) - .trim(); - subscriptionId = ( + // Pay using a 3DS card + const card = config.cards[ '3dsOTP' ]; + await fillCardDetails( shopperPage, card ); await shopperPage - .getByLabel( 'View subscription number' ) - .textContent() - ) - .trim() - .replace( '#', '' ); - } ); + .getByRole( 'button', { name: 'Sign up now' } ) + .click(); + await shopperPage.frames()[ 0 ].waitForLoadState( 'load' ); + await confirmCardAuthentication( shopperPage, true ); + await shopperPage + .frames()[ 0 ] + .waitForLoadState( 'networkidle' ); + await shopperPage.waitForLoadState( 'networkidle' ); + await expect( + shopperPage.getByRole( 'heading', { + name: 'Order received', + } ) + ).toBeVisible(); + + // Get the order ID so we can open it in the merchant view + orderId = ( + await shopperPage.getByText( 'Order number:' ).innerText() + ) + .replace( /[^0-9]/g, '' ) + .trim(); + subscriptionId = ( + await shopperPage + .getByLabel( 'View subscription number' ) + .textContent() + ) + .trim() + .replace( '#', '' ); + } + ); test( 'Merchant should be able to create an order with "Setup Intent"', async () => { await goToOrder( merchantPage, orderId ); diff --git a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-multiple-subscriptions.spec.ts b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-multiple-subscriptions.spec.ts index 3c2337c3c90..734078d6306 100644 --- a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-multiple-subscriptions.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-multiple-subscriptions.spec.ts @@ -50,74 +50,80 @@ describeif( shouldRunSubscriptionsTests )( } } ); - test( ' should be able to purchase multiple subscriptions', async () => { - // As a Shopper, purchase the subscription products. - await emptyCart( shopperPage ); - await setupProductCheckout( - shopperPage, - [ - [ config.products.subscription_no_signup_fee, 1 ], - [ config.products.subscription_signup_fee, 1 ], - ], - configBillingAddress, - 'USD' - ); - await fillCardDetails( shopperPage, config.cards.basic ); - await placeOrder( shopperPage ); - await expect( - shopperPage.getByRole( 'heading', { name: 'Order received' } ) - ).toBeVisible(); + test( + 'should be able to purchase multiple subscriptions', + { tag: '@critical' }, + async () => { + // As a Shopper, purchase the subscription products. + await emptyCart( shopperPage ); + await setupProductCheckout( + shopperPage, + [ + [ config.products.subscription_no_signup_fee, 1 ], + [ config.products.subscription_signup_fee, 1 ], + ], + configBillingAddress, + 'USD' + ); + await fillCardDetails( shopperPage, config.cards.basic ); + await placeOrder( shopperPage ); + await expect( + shopperPage.getByRole( 'heading', { + name: 'Order received', + } ) + ).toBeVisible(); - const subscriptionId = ( - await shopperPage - .getByLabel( 'View subscription number' ) - .innerText() - ) - .trim() - .replace( '#', '' ); + const subscriptionId = ( + await shopperPage + .getByLabel( 'View subscription number' ) + .innerText() + ) + .trim() + .replace( '#', '' ); - await goToSubscriptions( shopperPage ); + await goToSubscriptions( shopperPage ); - const latestSubscriptionRow = shopperPage.getByRole( 'row', { - name: `subscription number ${ subscriptionId }`, - } ); + const latestSubscriptionRow = shopperPage.getByRole( 'row', { + name: `subscription number ${ subscriptionId }`, + } ); - await expect( latestSubscriptionRow ).toBeVisible(); - await latestSubscriptionRow - .getByRole( 'link', { - name: 'View', - } ) - .nth( 0 ) - .click(); + await expect( latestSubscriptionRow ).toBeVisible(); + await latestSubscriptionRow + .getByRole( 'link', { + name: 'View', + } ) + .nth( 0 ) + .click(); - await shopperPage.waitForLoadState( 'networkidle' ); + await shopperPage.waitForLoadState( 'networkidle' ); - // Ensure 'Subscription totals' section lists the subscription products with the correct price. - const subTotalsRows = shopperPage.locator( - '.order_details tr.order_item' - ); - for ( let i = 0; i < ( await subTotalsRows.count() ); i++ ) { - const row = subTotalsRows.nth( i ); - await expect( row.getByRole( 'cell' ).nth( 1 ) ).toContainText( - Object.keys( products )[ i ] + // Ensure 'Subscription totals' section lists the subscription products with the correct price. + const subTotalsRows = shopperPage.locator( + '.order_details tr.order_item' ); + for ( let i = 0; i < ( await subTotalsRows.count() ); i++ ) { + const row = subTotalsRows.nth( i ); + await expect( + row.getByRole( 'cell' ).nth( 1 ) + ).toContainText( Object.keys( products )[ i ] ); - await expect( row.getByRole( 'cell' ).nth( 2 ) ).toContainText( - '$9.99 / month' - ); - } + await expect( + row.getByRole( 'cell' ).nth( 2 ) + ).toContainText( '$9.99 / month' ); + } - await expect( - shopperPage - .getByRole( 'row', { name: 'total:' } ) - .getByRole( 'cell' ) - .nth( 1 ) - ).toContainText( '$19.98 USD / month' ); + await expect( + shopperPage + .getByRole( 'row', { name: 'total:' } ) + .getByRole( 'cell' ) + .nth( 1 ) + ).toContainText( '$19.98 USD / month' ); - // Confirm related order total matches payment - await expect( - shopperPage.getByText( '$21.97 USD for 2 items' ) - ).toBeVisible(); - } ); + // Confirm related order total matches payment + await expect( + shopperPage.getByText( '$21.97 USD for 2 items' ) + ).toBeVisible(); + } + ); } ); diff --git a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-no-signup-fee.spec.ts b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-no-signup-fee.spec.ts index 20c2060acfb..b1bc49fab09 100644 --- a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-no-signup-fee.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-no-signup-fee.spec.ts @@ -34,35 +34,39 @@ let orderId; describeif( shouldRunSubscriptionsTests )( 'Shopper Subscriptions Purchase No Signup Fee', () => { - test( 'It should be able to purchase a subscription without a signup fee', async ( { - browser, - }, { project } ) => { - const { shopperPage } = await getShopper( - browser, - true, - project.use.baseURL - ); - await goToProductPageBySlug( shopperPage, productSlug ); - await shopperPage - .getByRole( 'button', { name: 'Sign up now' } ) - .click(); - await shopperPage.waitForLoadState( 'networkidle' ); - await expect( - shopperPage.getByText( /has been added to your cart\./ ) - ).toBeVisible(); - await setupCheckout( shopperPage, customerBillingConfig ); - const card = config.cards.basic; - await fillCardDetails( shopperPage, card ); - await placeOrder( shopperPage ); - expect( - shopperPage.getByRole( 'heading', { name: 'Order received' } ) - ).toBeVisible(); - - const orderIdField = shopperPage.locator( - '.woocommerce-order-overview__order.order > strong' - ); - orderId = await orderIdField.textContent(); - } ); + test( + 'It should be able to purchase a subscription without a signup fee', + { tag: '@critical' }, + async ( { browser }, { project } ) => { + const { shopperPage } = await getShopper( + browser, + true, + project.use.baseURL + ); + await goToProductPageBySlug( shopperPage, productSlug ); + await shopperPage + .getByRole( 'button', { name: 'Sign up now' } ) + .click(); + await shopperPage.waitForLoadState( 'networkidle' ); + await expect( + shopperPage.getByText( /has been added to your cart\./ ) + ).toBeVisible(); + await setupCheckout( shopperPage, customerBillingConfig ); + const card = config.cards.basic; + await fillCardDetails( shopperPage, card ); + await placeOrder( shopperPage ); + expect( + shopperPage.getByRole( 'heading', { + name: 'Order received', + } ) + ).toBeVisible(); + + const orderIdField = shopperPage.locator( + '.woocommerce-order-overview__order.order > strong' + ); + orderId = await orderIdField.textContent(); + } + ); test( 'It should have a charge for subscription cost without fee & an active subscription', async ( { browser, diff --git a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-sign-up-fee.spec.ts b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-sign-up-fee.spec.ts index 78d37cc2453..13974cf9167 100644 --- a/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-sign-up-fee.spec.ts +++ b/tests/e2e-pw/specs/subscriptions/shopper/shopper-subscriptions-purchase-sign-up-fee.spec.ts @@ -29,12 +29,16 @@ describeif( shouldRunSubscriptionsTests )( ).shopperPage; } ); - test( 'should be able to purchase a subscription with signup fee', async () => { - orderId = await shopper.placeOrderWithOptions( shopperPage, { - product: config.products.subscription_signup_fee, - billingAddress: customerBillingAddress, - } ); - } ); + test( + 'should be able to purchase a subscription with signup fee', + { tag: '@critical' }, + async () => { + orderId = await shopper.placeOrderWithOptions( shopperPage, { + product: config.products.subscription_signup_fee, + billingAddress: customerBillingAddress, + } ); + } + ); test( 'should have a charge for subscription cost with fee & an active subscription', async () => { await navigation.goToOrder( merchantPage, orderId ); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-multi-currency-widget.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-multi-currency-widget.spec.ts index 128e75363f7..eb58cad98a6 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-multi-currency-widget.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-multi-currency-widget.spec.ts @@ -49,30 +49,34 @@ test.describe( 'Multi-currency widget setup', () => { await merchantPage.close(); } ); - test( 'displays enabled currencies correctly in the admin', async () => { - await expect( - merchantPage - .locator( 'select[name="currency"]' ) - .getByRole( 'option' ) - ).toHaveCount( 3 ); - await expect( - merchantPage - .locator( 'select[name="currency"]' ) - .getByRole( 'option', { name: 'USD' } ) - ).toBeAttached(); - await expect( - merchantPage - .locator( 'select[name="currency"]' ) - .getByRole( 'option', { name: 'EUR' } ) - ).toBeAttached(); - await expect( - merchantPage - .locator( 'select[name="currency"]' ) - .getByRole( 'option', { name: 'GBP' } ) - ).toBeAttached(); - } ); + test( + 'displays enabled currencies correctly in the admin', + { tag: '@critical' }, + async () => { + await expect( + merchantPage + .locator( 'select[name="currency"]' ) + .getByRole( 'option' ) + ).toHaveCount( 3 ); + await expect( + merchantPage + .locator( 'select[name="currency"]' ) + .getByRole( 'option', { name: 'USD' } ) + ).toBeAttached(); + await expect( + merchantPage + .locator( 'select[name="currency"]' ) + .getByRole( 'option', { name: 'EUR' } ) + ).toBeAttached(); + await expect( + merchantPage + .locator( 'select[name="currency"]' ) + .getByRole( 'option', { name: 'GBP' } ) + ).toBeAttached(); + } + ); - test( 'can update widget properties', async () => { + test( 'can update widget properties', { tag: '@critical' }, async () => { await test.step( 'opens widget settings', async () => { await ensureBlockSettingsPanelIsOpen( merchantPage ); @@ -165,65 +169,79 @@ test.describe( 'Multi-currency widget setup', () => { } ); } ); - test( 'displays enabled currencies correctly in the frontend', async () => { - await navigation.goToShop( shopperPage ); - - await expect( - shopperPage.locator( '.currency-switcher-holder' ) - ).toBeVisible(); - await expect( - shopperPage - .locator( '.currency-switcher-holder' ) - .getByRole( 'option' ) - ).toHaveCount( 3 ); - await expect( - shopperPage - .locator( '.currency-switcher-holder' ) - .getByRole( 'option', { name: 'USD' } ) - ).toBeAttached(); - await expect( - shopperPage - .locator( '.currency-switcher-holder' ) - .getByRole( 'option', { name: 'EUR' } ) - ).toBeAttached(); - await expect( - shopperPage - .locator( '.currency-switcher-holder' ) - .getByRole( 'option', { name: 'GBP' } ) - ).toBeAttached(); - } ); + test( + 'displays enabled currencies correctly in the frontend', + { tag: '@critical' }, + async () => { + await navigation.goToShop( shopperPage ); - test( 'widget settings are applied in the frontend', async () => { - await navigation.goToShop( shopperPage ); - - // Asserts flags are displayed. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toContainText( '🇺🇸' ); - // Asserts currency symbols are displayed. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toContainText( '$' ); - // Asserts border is set. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toHaveCSS( 'border-top-width', '1px' ); - // Asserts border radius is set. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toHaveCSS( 'border-top-left-radius', `${ settings.borderRadius }px` ); - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toHaveCSS( 'font-size', `${ settings.fontSize }px` ); - await expect( - shopperPage.locator( '.currency-switcher-holder' ) - ).toHaveAttribute( 'style', `line-height: ${ settings.lineHeight }; ` ); // Trailing space is expected. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toHaveCSS( 'color', settings.textColor ); - // Asserts border color is set. - await expect( - shopperPage.locator( '.currency-switcher-holder select' ) - ).toHaveCSS( 'border-top-color', settings.borderColor ); - } ); + await expect( + shopperPage.locator( '.currency-switcher-holder' ) + ).toBeVisible(); + await expect( + shopperPage + .locator( '.currency-switcher-holder' ) + .getByRole( 'option' ) + ).toHaveCount( 3 ); + await expect( + shopperPage + .locator( '.currency-switcher-holder' ) + .getByRole( 'option', { name: 'USD' } ) + ).toBeAttached(); + await expect( + shopperPage + .locator( '.currency-switcher-holder' ) + .getByRole( 'option', { name: 'EUR' } ) + ).toBeAttached(); + await expect( + shopperPage + .locator( '.currency-switcher-holder' ) + .getByRole( 'option', { name: 'GBP' } ) + ).toBeAttached(); + } + ); + + test( + 'widget settings are applied in the frontend', + { tag: '@critical' }, + async () => { + await navigation.goToShop( shopperPage ); + + // Asserts flags are displayed. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toContainText( '🇺🇸' ); + // Asserts currency symbols are displayed. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toContainText( '$' ); + // Asserts border is set. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toHaveCSS( 'border-top-width', '1px' ); + // Asserts border radius is set. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toHaveCSS( + 'border-top-left-radius', + `${ settings.borderRadius }px` + ); + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toHaveCSS( 'font-size', `${ settings.fontSize }px` ); + await expect( + shopperPage.locator( '.currency-switcher-holder' ) + ).toHaveAttribute( + 'style', + `line-height: ${ settings.lineHeight }; ` + ); // Trailing space is expected. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toHaveCSS( 'color', settings.textColor ); + // Asserts border color is set. + await expect( + shopperPage.locator( '.currency-switcher-holder select' ) + ).toHaveCSS( 'border-top-color', settings.borderColor ); + } + ); } ); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-full-refund.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-full-refund.spec.ts index be69815098f..5c39db381c6 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-full-refund.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-full-refund.spec.ts @@ -34,65 +34,74 @@ test.describe( 'WooCommerce Payments - Full Refund', () => { } } ); - test( 'should process a full refund for an order', async () => { - // Place an order to refund later and get the order ID so we can open it in the merchant view - orderId = await shopper.placeOrderWithCurrency( shopperPage, 'USD' ); - - // Get the order total so we can verify the refund amount - orderAmount = await shopperPage - .locator( - '.woocommerce-order-overview__total .woocommerce-Price-amount' - ) - .textContent(); - - // Open the order - await goToOrder( merchantPage, orderId ); - - // Click refund button - await merchantPage - .getByRole( 'button', { - name: 'Refund', - } ) - .click(); - - // Fill refund details - await merchantPage.getByLabel( 'Refund amount' ).fill( orderAmount ); - // await merchantPage.fill( '.refund_line_total', orderAmount ); - await merchantPage - .getByLabel( 'Reason for refund' ) - .fill( 'No longer wanted' ); - - const refundButton = await merchantPage.getByRole( 'button', { - name: `Refund ${ orderAmount } via WooPayments`, - } ); - - await expect( refundButton ).toBeVisible(); - - // TODO: This visual regression test is not flaky, but we should revisit the approach. - // await expect( merchantPage ).toHaveScreenshot(); - - // Click refund and handle confirmation dialog - merchantPage.on( 'dialog', ( dialog ) => dialog.accept() ); - await refundButton.click(); - - // Wait for refund to process - await merchantPage.waitForLoadState( 'networkidle' ); - - // Verify refund details - await expect( - merchantPage.getByRole( 'cell', { - name: `-${ orderAmount }`, - } ) - ).toHaveCount( 2 ); - await expect( - merchantPage.getByText( - `A refund of ${ orderAmount } was successfully processed using WooPayments. Reason: No longer wanted` - ) - ).toBeVisible(); - - // TODO: This visual regression test is not flaky, but we should revisit the approach. - // await expect( merchantPage ).toHaveScreenshot(); - } ); + test( + 'should process a full refund for an order', + { tag: '@critical' }, + async () => { + // Place an order to refund later and get the order ID so we can open it in the merchant view + orderId = await shopper.placeOrderWithCurrency( + shopperPage, + 'USD' + ); + + // Get the order total so we can verify the refund amount + orderAmount = await shopperPage + .locator( + '.woocommerce-order-overview__total .woocommerce-Price-amount' + ) + .textContent(); + + // Open the order + await goToOrder( merchantPage, orderId ); + + // Click refund button + await merchantPage + .getByRole( 'button', { + name: 'Refund', + } ) + .click(); + + // Fill refund details + await merchantPage + .getByLabel( 'Refund amount' ) + .fill( orderAmount ); + // await merchantPage.fill( '.refund_line_total', orderAmount ); + await merchantPage + .getByLabel( 'Reason for refund' ) + .fill( 'No longer wanted' ); + + const refundButton = await merchantPage.getByRole( 'button', { + name: `Refund ${ orderAmount } via WooPayments`, + } ); + + await expect( refundButton ).toBeVisible(); + + // TODO: This visual regression test is not flaky, but we should revisit the approach. + // await expect( merchantPage ).toHaveScreenshot(); + + // Click refund and handle confirmation dialog + merchantPage.on( 'dialog', ( dialog ) => dialog.accept() ); + await refundButton.click(); + + // Wait for refund to process + await merchantPage.waitForLoadState( 'networkidle' ); + + // Verify refund details + await expect( + merchantPage.getByRole( 'cell', { + name: `-${ orderAmount }`, + } ) + ).toHaveCount( 2 ); + await expect( + merchantPage.getByText( + `A refund of ${ orderAmount } was successfully processed using WooPayments. Reason: No longer wanted` + ) + ).toBeVisible(); + + // TODO: This visual regression test is not flaky, but we should revisit the approach. + // await expect( merchantPage ).toHaveScreenshot(); + } + ); test( 'should be able to view a refunded transaction', async () => { // Get and navigate to payment details diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-manual-capture.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-manual-capture.spec.ts index 366b34c5f7e..e519dd4c76d 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-manual-capture.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-manual-capture.spec.ts @@ -36,37 +36,43 @@ test.describe( 'Order > Manual Capture', () => { await deactivateCaptureLater( merchantPage ); } ); - test( 'should create an "On hold" order then capture the charge', async () => { - // Merchant go to the order. - await goToOrder( merchantPage, orderId ); + test( + 'should create an "On hold" order then capture the charge', + { tag: '@critical' }, + async () => { + // Merchant go to the order. + await goToOrder( merchantPage, orderId ); - const orderTotal = await merchantPage - .getByRole( 'row', { name: 'Order Total: $' } ) - .locator( 'bdi' ) - .textContent(); + const orderTotal = await merchantPage + .getByRole( 'row', { name: 'Order Total: $' } ) + .locator( 'bdi' ) + .textContent(); - // Confirm order status is 'On hold', and that there's an 'authorized' note. - await expect( merchantPage.getByTitle( 'On hold' ) ).toBeVisible(); - await expect( - merchantPage.getByText( - `A payment of ${ orderTotal } was authorized using WooPayments` - ) - ).toBeVisible(); + // Confirm order status is 'On hold', and that there's an 'authorized' note. + await expect( merchantPage.getByTitle( 'On hold' ) ).toBeVisible(); + await expect( + merchantPage.getByText( + `A payment of ${ orderTotal } was authorized using WooPayments` + ) + ).toBeVisible(); - // Set select to 'capture_charge' and submit. - await merchantPage - .locator( '#woocommerce-order-actions select' ) - .selectOption( 'capture_charge' ); - await merchantPage - .locator( '#woocommerce-order-actions li#actions button' ) // Using locator due to there are several buttons "named" Update. - .click(); + // Set select to 'capture_charge' and submit. + await merchantPage + .locator( '#woocommerce-order-actions select' ) + .selectOption( 'capture_charge' ); + await merchantPage + .locator( '#woocommerce-order-actions li#actions button' ) // Using locator due to there are several buttons "named" Update. + .click(); - // After the page reloads, confirm the order is processing and we have a 'captured' order note. - await expect( merchantPage.getByTitle( 'Processing' ) ).toBeVisible(); - await expect( - merchantPage.getByText( - `A payment of ${ orderTotal } was successfully captured using WooPayments` - ) - ).toBeVisible(); - } ); + // After the page reloads, confirm the order is processing and we have a 'captured' order note. + await expect( + merchantPage.getByTitle( 'Processing' ) + ).toBeVisible(); + await expect( + merchantPage.getByText( + `A payment of ${ orderTotal } was successfully captured using WooPayments` + ) + ).toBeVisible(); + } + ); } ); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-partial-refund.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-partial-refund.spec.ts index c85a14f7cfa..ba92bc99431 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-partial-refund.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-partial-refund.spec.ts @@ -113,7 +113,7 @@ test.describe( 'Order > Partial refund', () => { } ); dataTable.forEach( ( [ title, { refundInputs } ], i ) => { - test( title, async ( { browser } ) => { + test( title, { tag: '@critical' }, async ( { browser } ) => { merchantPage = ( await getMerchant( browser ) ).merchantPage; await goToOrder( merchantPage, orderIds[ i ] ); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-refund-failures.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-refund-failures.spec.ts index 47e88a7a4c7..4bd0599f05b 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-refund-failures.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-refund-failures.spec.ts @@ -90,43 +90,52 @@ test.describe( 'Order > Refund Failure', () => { await merchantPage.waitForSelector( 'button.do-api-refund' ); } ); - test( `should fail refund attempt when ${ fieldName } is ${ valueDescription }`, async () => { - // Initiate refund attempt - await merchantPage.locator( selector ).first().fill( value ); - - const refundButton = await merchantPage.waitForSelector( - '.do-api-refund', - { - state: 'visible', + test( + `should fail refund attempt when ${ fieldName } is ${ valueDescription }`, + { tag: '@critical' }, + async () => { + // Initiate refund attempt + await merchantPage + .locator( selector ) + .first() + .fill( value ); + + const refundButton = await merchantPage.waitForSelector( + '.do-api-refund', + { + state: 'visible', + } + ); + const refundButtonText: string = await refundButton.textContent(); + expect( refundButtonText ).toMatch( + /Refund .* via WooPayments.+/ + ); + + function* dialogHandler( dialog: Dialog ) { + yield dialog.accept(); + expect( dialog.message() ).toBe( + 'Invalid refund amount' + ); + yield dialog.accept(); } - ); - const refundButtonText: string = await refundButton.textContent(); - expect( refundButtonText ).toMatch( - /Refund .* via WooPayments.+/ - ); - function* dialogHandler( dialog: Dialog ) { - yield dialog.accept(); - expect( dialog.message() ).toBe( 'Invalid refund amount' ); - yield dialog.accept(); + // Confirm the refund. There will be two dialogs shown, one for the refund + // confirmation, one for the error message. Accept the first one, and + // verify the second one. + merchantPage.on( + 'dialog', + ( dialog ) => dialogHandler( dialog ).next().value + ); + + // The above will happen once we click the refund button. + await refundButton.click(); + + // Verify that no entry is listed in the "Order refunds" section underneath the product line items + await expect( + merchantPage.locator( '#order_refunds' ) + ).not.toBeVisible(); } - - // Confirm the refund. There will be two dialogs shown, one for the refund - // confirmation, one for the error message. Accept the first one, and - // verify the second one. - merchantPage.on( - 'dialog', - ( dialog ) => dialogHandler( dialog ).next().value - ); - - // The above will happen once we click the refund button. - await refundButton.click(); - - // Verify that no entry is listed in the "Order refunds" section underneath the product line items - await expect( - merchantPage.locator( '#order_refunds' ) - ).not.toBeVisible(); - } ); + ); } ); } ); } ); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-status-change.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-status-change.spec.ts index b62c72bc1c7..1b01b9c53fe 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-status-change.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-orders-status-change.spec.ts @@ -33,7 +33,7 @@ const verifyOrderStatus = async ( page: Page, status: string ) => { ).resolves.toBe( status ); }; -test.describe( 'Order > Status Change', () => { +test.describe( 'Order > Status Change', { tag: '@critical' }, () => { let merchantPage: Page; let shopperPage: Page; let orderId: string; diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-payment-settings-manual-capture.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-payment-settings-manual-capture.spec.ts index ab6c5c39928..ab68c6e0dad 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-payment-settings-manual-capture.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-payment-settings-manual-capture.spec.ts @@ -10,6 +10,7 @@ import { goToWooPaymentsSettings } from '../../../utils/merchant-navigation'; test.describe( 'As a merchant, I should be prompted a confirmation modal when I try to activate the manual capture', + { tag: '@critical' }, () => { useMerchant(); diff --git a/tests/e2e-pw/specs/wcpay/merchant/merchant-progressive-onboarding.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/merchant-progressive-onboarding.spec.ts index 4b294b2fbd3..84c5f214bb9 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/merchant-progressive-onboarding.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/merchant-progressive-onboarding.spec.ts @@ -10,59 +10,69 @@ import { useMerchant } from '../../../utils/helpers'; import * as devtools from '../../../utils/devtools'; import { goToConnect } from '../../../utils/merchant-navigation'; -test.describe( 'Admin merchant progressive onboarding', () => { - useMerchant(); +test.describe( + 'Admin merchant progressive onboarding', + { tag: '@critical' }, + () => { + useMerchant(); - test.beforeAll( async ( { browser } ) => { - const page = await browser.newPage(); - await devtools.enableActAsDisconnectedFromWCPay( page ); - } ); + test.beforeAll( async ( { browser } ) => { + const page = await browser.newPage(); + await devtools.enableActAsDisconnectedFromWCPay( page ); + } ); - test.afterAll( async ( { browser } ) => { - const page = await browser.newPage(); - await devtools.disableActAsDisconnectedFromWCPay( page ); - } ); + test.afterAll( async ( { browser } ) => { + const page = await browser.newPage(); + await devtools.disableActAsDisconnectedFromWCPay( page ); + } ); - test( 'should pass merchant flow without any errors', async ( { - page, - } ) => { - // Open connect account page and click the primary CTA to start onboarding. - await goToConnect( page ); - // Start onboarding process - await page - .getByRole( 'button', { name: 'Verify business details' } ) - .click(); - // Pick Individual business entity - await page - .getByRole( 'button', { - name: 'What type of legal entity is', - } ) - .click(); - await page.getByRole( 'option', { name: 'Individual' } ).click(); - // Pick Software MCC - await page.getByLabel( 'Select an option' ).click(); - await page.getByText( 'Software' ).click(); - // Accept terms and conditions - await page.getByRole( 'button', { name: 'Continue' } ).click(); - // Pick annual revenue - await page - .getByRole( 'button', { - name: 'What is your estimated annual', - } ) - .click(); - await page.getByRole( 'option', { name: 'Less than $250k' } ).click(); - // Pick estimated time to launch - await page - .getByRole( 'button', { name: 'What is the estimated timeline' } ) - .click(); - await page.getByRole( 'option', { name: 'Within 1 month' } ).click(); - await page.getByRole( 'button', { name: 'Continue' } ).click(); + test( 'should pass merchant flow without any errors', async ( { + page, + } ) => { + // Open connect account page and click the primary CTA to start onboarding. + await goToConnect( page ); + // Start onboarding process + await page + .getByRole( 'button', { name: 'Verify business details' } ) + .click(); + // Pick Individual business entity + await page + .getByRole( 'button', { + name: 'What type of legal entity is', + } ) + .click(); + await page.getByRole( 'option', { name: 'Individual' } ).click(); + // Pick Software MCC + await page.getByLabel( 'Select an option' ).click(); + await page.getByText( 'Software' ).click(); + // Accept terms and conditions + await page.getByRole( 'button', { name: 'Continue' } ).click(); + // Pick annual revenue + await page + .getByRole( 'button', { + name: 'What is your estimated annual', + } ) + .click(); + await page + .getByRole( 'option', { name: 'Less than $250k' } ) + .click(); + // Pick estimated time to launch + await page + .getByRole( 'button', { + name: 'What is the estimated timeline', + } ) + .click(); + await page + .getByRole( 'option', { name: 'Within 1 month' } ) + .click(); + await page.getByRole( 'button', { name: 'Continue' } ).click(); - // Check that Stripe Embedded KYC iframe is loaded. - await expect( - page.locator( - 'iframe[data-testid="stripe-connect-ui-layer-stripe-connect-account-onboarding"]' - ) - ).toBeAttached(); - } ); -} ); + // Check that Stripe Embedded KYC iframe is loaded. + await expect( + page.locator( + 'iframe[data-testid="stripe-connect-ui-layer-stripe-connect-account-onboarding"]' + ) + ).toBeAttached(); + } ); + } +); diff --git a/tests/e2e-pw/specs/wcpay/merchant/multi-currency-on-boarding.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/multi-currency-on-boarding.spec.ts index ec8d6e3cfd7..c87e67d323b 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/multi-currency-on-boarding.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/multi-currency-on-boarding.spec.ts @@ -18,7 +18,7 @@ import { } from '../../../utils/merchant'; import * as navigation from '../../../utils/merchant-navigation'; -test.describe( 'Multi-currency on-boarding', () => { +test.describe( 'Multi-currency on-boarding', { tag: '@critical' }, () => { let page: Page; let wasMulticurrencyEnabled: boolean; let activeThemeSlug: string; diff --git a/tests/e2e-pw/specs/wcpay/merchant/multi-currency-setup.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/multi-currency-setup.spec.ts index 6ec40b74182..cb098014238 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/multi-currency-setup.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/multi-currency-setup.spec.ts @@ -20,7 +20,7 @@ import { import * as navigation from '../../../utils/shopper-navigation'; import { getPriceFromProduct } from '../../../utils/shopper'; -test.describe( 'Multi-currency setup', () => { +test.describe( 'Multi-currency setup', { tag: '@critical' }, () => { let merchantPage: Page; let shopperPage: Page; let wasMulticurrencyEnabled: boolean; diff --git a/tests/e2e-pw/specs/wcpay/merchant/multi-currency.spec.ts b/tests/e2e-pw/specs/wcpay/merchant/multi-currency.spec.ts index 885410df350..1dc3ee62d33 100644 --- a/tests/e2e-pw/specs/wcpay/merchant/multi-currency.spec.ts +++ b/tests/e2e-pw/specs/wcpay/merchant/multi-currency.spec.ts @@ -16,7 +16,7 @@ import { } from '../../../utils/merchant'; import * as navigation from '../../../utils/merchant-navigation'; -test.describe( 'Multi-currency', () => { +test.describe( 'Multi-currency', { tag: '@critical' }, () => { let wasMulticurrencyEnabled: boolean; let page: Page; diff --git a/tests/e2e-pw/specs/wcpay/shopper/klarna-checkout-purchase.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/klarna-checkout-purchase.spec.ts index 05f6881dcf0..f518568de01 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/klarna-checkout-purchase.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/klarna-checkout-purchase.spec.ts @@ -50,31 +50,35 @@ test.describe( 'Klarna Checkout', () => { ).not.toBeEmpty(); } ); - test( 'allows to use Klarna as a payment method', async () => { - await shopper.setupProductCheckout( - shopperPage, - [ [ config.products.belt, 1 ] ], - { - ...config.addresses.customer.billing, - // these are Klarna-specific values: - // https://docs.klarna.com/resources/test-environment/sample-customer-data/#united-states-of-america - email: 'customer@email.us', - phone: '+13106683312', - firstname: 'Test', - lastname: 'Person-us', - } - ); + test( + 'allows to use Klarna as a payment method', + { tag: '@critical' }, + async () => { + await shopper.setupProductCheckout( + shopperPage, + [ [ config.products.belt, 1 ] ], + { + ...config.addresses.customer.billing, + // these are Klarna-specific values: + // https://docs.klarna.com/resources/test-environment/sample-customer-data/#united-states-of-america + email: 'customer@email.us', + phone: '+13106683312', + firstname: 'Test', + lastname: 'Person-us', + } + ); - await shopperPage - .locator( '.wc_payment_methods' ) - .getByText( 'Klarna' ) - .click(); + await shopperPage + .locator( '.wc_payment_methods' ) + .getByText( 'Klarna' ) + .click(); - await shopper.placeOrder( shopperPage ); + await shopper.placeOrder( shopperPage ); - // Since we don't have control over the html in the Klarna playground page, - // verifying the redirect is all we can do consistently without introducing a - // flaky test. - await expect( shopperPage ).toHaveURL( /.*klarna\.com/ ); - } ); + // Since we don't have control over the html in the Klarna playground page, + // verifying the redirect is all we can do consistently without introducing a + // flaky test. + await expect( shopperPage ).toHaveURL( /.*klarna\.com/ ); + } + ); } ); diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-bnpls-checkout.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-bnpls-checkout.spec.ts index 24f0a34bf64..c0ae025f0ed 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-bnpls-checkout.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-bnpls-checkout.spec.ts @@ -17,7 +17,7 @@ const cardTestingProtectionStates = [ false, true ]; const bnplProviders = [ 'Affirm', 'Afterpay' ]; const products = [ config.products.belt, config.products.sunglasses ]; -test.describe( 'BNPL checkout', () => { +test.describe( 'BNPL checkout', { tag: '@critical' }, () => { let merchantPage: Page; let shopperPage: Page; let wasMulticurrencyEnabled: boolean; diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-failures.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-failures.spec.ts index d9c1c09389a..c309ab71722 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-failures.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-failures.spec.ts @@ -10,139 +10,159 @@ import { test, expect, Page } from '@playwright/test'; import { config } from '../../../config/default'; import * as shopper from '../../../utils/shopper'; -test.describe( 'Shopper > Checkout > Failures with various cards', () => { - const waitForBanner = async ( page: Page, errorText: string ) => { - await expect( page.getByText( errorText ) ).toBeVisible(); - }; - - test.beforeEach( async ( { page } ) => { - await shopper.addToCartFromShopPage( page ); - await shopper.setupCheckout( page ); - await shopper.selectPaymentMethod( page ); - } ); - - test( 'should throw an error that the card was simply declined', async ( { - page, - } ) => { - await shopper.fillCardDetails( page, config.cards.declined ); - await shopper.placeOrder( page ); - - await waitForBanner( page, 'Error: Your card was declined.' ); - } ); - - test( 'should throw an error that the card expiration date is in the past', async ( { - page, - } ) => { - await shopper.fillCardDetails( +test.describe( + 'Shopper > Checkout > Failures with various cards', + { tag: '@critical' }, + () => { + const waitForBanner = async ( page: Page, errorText: string ) => { + await expect( page.getByText( errorText ) ).toBeVisible(); + }; + + test.beforeEach( async ( { page } ) => { + await shopper.addToCartFromShopPage( page ); + await shopper.setupCheckout( page ); + await shopper.selectPaymentMethod( page ); + } ); + + test( 'should throw an error that the card was simply declined', async ( { page, - config.cards[ 'declined-expired' ] - ); - await shopper.placeOrder( page ); + } ) => { + await shopper.fillCardDetails( page, config.cards.declined ); + await shopper.placeOrder( page ); - await waitForBanner( page, 'Error: Your card has expired.' ); - } ); + await waitForBanner( page, 'Error: Your card was declined.' ); + } ); - test( 'should throw an error that the card CVV number is invalid', async ( { - page, - } ) => { - await shopper.fillCardDetails( + test( 'should throw an error that the card expiration date is in the past', async ( { page, - config.cards[ 'invalid-cvv-number' ] - ); + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-expired' ] + ); + await shopper.placeOrder( page ); - await page.keyboard.press( 'Tab' ); + await waitForBanner( page, 'Error: Your card has expired.' ); + } ); - const frameHandle = await page.waitForSelector( - '#payment .payment_method_woocommerce_payments .wcpay-upe-element iframe' - ); + test( 'should throw an error that the card CVV number is invalid', async ( { + page, + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'invalid-cvv-number' ] + ); - const stripeFrame = await frameHandle.contentFrame(); - const cvcErrorText = await stripeFrame.locator( 'p#Field-cvcError' ); + await page.keyboard.press( 'Tab' ); - await expect( cvcErrorText ).toHaveText( - 'Your card’s security code is incomplete.' - ); - } ); + const frameHandle = await page.waitForSelector( + '#payment .payment_method_woocommerce_payments .wcpay-upe-element iframe' + ); - test( 'should throw an error that the card was declined due to insufficient funds', async ( { - page, - } ) => { - await shopper.fillCardDetails( page, config.cards[ 'declined-funds' ] ); - await shopper.placeOrder( page ); + const stripeFrame = await frameHandle.contentFrame(); + const cvcErrorText = await stripeFrame.locator( + 'p#Field-cvcError' + ); - await waitForBanner( page, 'Error: Your card has insufficient funds.' ); - } ); + await expect( cvcErrorText ).toHaveText( + 'Your card’s security code is incomplete.' + ); + } ); - test( 'should throw an error that the card was declined due to expired card', async ( { - page, - } ) => { - await shopper.fillCardDetails( + test( 'should throw an error that the card was declined due to insufficient funds', async ( { page, - config.cards[ 'declined-expired' ] - ); - await shopper.placeOrder( page ); - - await waitForBanner( page, 'Error: Your card has expired.' ); - } ); + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-funds' ] + ); + await shopper.placeOrder( page ); + + await waitForBanner( + page, + 'Error: Your card has insufficient funds.' + ); + } ); + + test( 'should throw an error that the card was declined due to expired card', async ( { + page, + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-expired' ] + ); + await shopper.placeOrder( page ); - test( 'should throw an error that the card was declined due to incorrect CVC number', async ( { - page, - } ) => { - await shopper.fillCardDetails( page, config.cards[ 'declined-cvc' ] ); - await shopper.placeOrder( page ); + await waitForBanner( page, 'Error: Your card has expired.' ); + } ); - await waitForBanner( + test( 'should throw an error that the card was declined due to incorrect CVC number', async ( { page, - "Error: Your card's security code is incorrect." - ); - } ); - - test( 'should throw an error that the card was declined due to processing error', async ( { - page, - } ) => { - await shopper.fillCardDetails( + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-cvc' ] + ); + await shopper.placeOrder( page ); + + await waitForBanner( + page, + "Error: Your card's security code is incorrect." + ); + } ); + + test( 'should throw an error that the card was declined due to processing error', async ( { page, - config.cards[ 'declined-processing' ] - ); - await shopper.placeOrder( page ); - - await waitForBanner( - page, - 'Error: An error occurred while processing your card. Try again in a little bit.' - ); - } ); - - test( 'should throw an error that the card was declined due to incorrect card number', async ( { - page, - } ) => { - await shopper.fillCardDetails( + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-processing' ] + ); + await shopper.placeOrder( page ); + + await waitForBanner( + page, + 'Error: An error occurred while processing your card. Try again in a little bit.' + ); + } ); + + test( 'should throw an error that the card was declined due to incorrect card number', async ( { page, - config.cards[ 'declined-incorrect' ] - ); - - const frameHandle = await page.waitForSelector( - '#payment .payment_method_woocommerce_payments .wcpay-upe-element iframe' - ); - - const stripeFrame = await frameHandle.contentFrame(); - const numberErrorText = await stripeFrame.locator( - 'p#Field-numberError' - ); - - expect( numberErrorText ).toHaveText( 'Your card number is invalid.' ); - } ); - - test( 'should throw an error that the card was declined due to invalid 3DS card', async ( { - page, - } ) => { - await shopper.fillCardDetails( page, config.cards[ 'declined-3ds' ] ); - await shopper.placeOrder( page ); - - await shopper.confirmCardAuthentication( page, false ); - - await waitForBanner( + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-incorrect' ] + ); + + const frameHandle = await page.waitForSelector( + '#payment .payment_method_woocommerce_payments .wcpay-upe-element iframe' + ); + + const stripeFrame = await frameHandle.contentFrame(); + const numberErrorText = await stripeFrame.locator( + 'p#Field-numberError' + ); + + expect( numberErrorText ).toHaveText( + 'Your card number is invalid.' + ); + } ); + + test( 'should throw an error that the card was declined due to invalid 3DS card', async ( { page, - 'We are unable to authenticate your payment method. Please choose a different payment method and try again.' - ); - } ); -} ); + } ) => { + await shopper.fillCardDetails( + page, + config.cards[ 'declined-3ds' ] + ); + await shopper.placeOrder( page ); + + await shopper.confirmCardAuthentication( page, false ); + + await waitForBanner( + page, + 'We are unable to authenticate your payment method. Please choose a different payment method and try again.' + ); + } ); + } +); diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase-with-upe-methods.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase-with-upe-methods.spec.ts index e9bdd561b6b..563fc396a17 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase-with-upe-methods.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase-with-upe-methods.spec.ts @@ -31,74 +31,83 @@ import { import { config } from '../../../config/default'; import { goToCheckout } from '../../../utils/shopper-navigation'; -test.describe( 'Enable UPE with deferred intent creation', () => { - let wasMultiCurrencyEnabled = false; - let merchantPage: Page, shopperPage: Page; - test.beforeAll( async ( { browser } ) => { - // Open browsers. - merchantPage = ( await getMerchant( browser ) ).merchantPage; - shopperPage = ( await getShopper( browser ) ).shopperPage; +test.describe( + 'Enable UPE with deferred intent creation', + { tag: '@critical' }, + () => { + let wasMultiCurrencyEnabled = false; + let merchantPage: Page, shopperPage: Page; + test.beforeAll( async ( { browser } ) => { + // Open browsers. + merchantPage = ( await getMerchant( browser ) ).merchantPage; + shopperPage = ( await getShopper( browser ) ).shopperPage; - // Prepare merchant side of tests. - wasMultiCurrencyEnabled = await activateMulticurrency( merchantPage ); - await addCurrency( merchantPage, 'EUR' ); - await enablePaymentMethods( merchantPage, [ 'bancontact' ] ); - // Prepare shopper side of tests. - await changeAccountCurrency( - shopperPage, - config.addresses.customer.billing, - 'EUR' - ); - await emptyCart( shopperPage ); - } ); + // Prepare merchant side of tests. + wasMultiCurrencyEnabled = await activateMulticurrency( + merchantPage + ); + await addCurrency( merchantPage, 'EUR' ); + await enablePaymentMethods( merchantPage, [ 'bancontact' ] ); + // Prepare shopper side of tests. + await changeAccountCurrency( + shopperPage, + config.addresses.customer.billing, + 'EUR' + ); + await emptyCart( shopperPage ); + } ); - test.afterAll( async () => { - // Restore shopper side of tests. - await emptyCart( shopperPage ); + test.afterAll( async () => { + // Restore shopper side of tests. + await emptyCart( shopperPage ); - // Restore merchant side of tests - await disablePaymentMethods( merchantPage, [ 'bancontact' ] ); - await restoreCurrencies( merchantPage ); - if ( ! wasMultiCurrencyEnabled ) { - await deactivateMulticurrency( merchantPage ); - } - } ); - - [ false, true ].forEach( ( ctpEnabled ) => { - test.describe( - `Card testing protection enabled: ${ ctpEnabled }`, - () => { - test.beforeAll( async () => { - if ( ctpEnabled ) { - await enableCardTestingProtection( merchantPage ); - } - } ); - test.afterAll( async () => { - if ( ctpEnabled ) { - await disableCardTestingProtection( merchantPage ); - } - } ); - test( 'should successfully place order with Bancontact', async () => { - await addToCartFromShopPage( shopperPage ); - await goToCheckout( shopperPage ); - await fillBillingAddress( - shopperPage, - config.addresses[ 'upe-customer' ].billing.be - ); - await expectFraudPreventionToken( shopperPage, ctpEnabled ); - await shopperPage.getByText( 'Bancontact' ).click(); - await focusPlaceOrderButton( shopperPage ); - await placeOrder( shopperPage ); - await shopperPage - .getByRole( 'link', { - name: 'Authorize Test Payment', - } ) - .click(); - await expect( - shopperPage.getByText( 'Order received' ).first() - ).toBeVisible(); - } ); + // Restore merchant side of tests + await disablePaymentMethods( merchantPage, [ 'bancontact' ] ); + await restoreCurrencies( merchantPage ); + if ( ! wasMultiCurrencyEnabled ) { + await deactivateMulticurrency( merchantPage ); } - ); - } ); -} ); + } ); + + [ false, true ].forEach( ( ctpEnabled ) => { + test.describe( + `Card testing protection enabled: ${ ctpEnabled }`, + () => { + test.beforeAll( async () => { + if ( ctpEnabled ) { + await enableCardTestingProtection( merchantPage ); + } + } ); + test.afterAll( async () => { + if ( ctpEnabled ) { + await disableCardTestingProtection( merchantPage ); + } + } ); + test( 'should successfully place order with Bancontact', async () => { + await addToCartFromShopPage( shopperPage ); + await goToCheckout( shopperPage ); + await fillBillingAddress( + shopperPage, + config.addresses[ 'upe-customer' ].billing.be + ); + await expectFraudPreventionToken( + shopperPage, + ctpEnabled + ); + await shopperPage.getByText( 'Bancontact' ).click(); + await focusPlaceOrderButton( shopperPage ); + await placeOrder( shopperPage ); + await shopperPage + .getByRole( 'link', { + name: 'Authorize Test Payment', + } ) + .click(); + await expect( + shopperPage.getByText( 'Order received' ).first() + ).toBeVisible(); + } ); + } + ); + } ); + } +); diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase.spec.ts index ddee5cb60ef..dd91a6e980e 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-purchase.spec.ts @@ -44,7 +44,7 @@ test.describe( 'Successful purchase', () => { ); } ); - test( 'using a basic card', async () => { + test( 'using a basic card', { tag: '@critical' }, async () => { await shopper.fillCardDetails( shopperPage ); await shopper.placeOrder( shopperPage ); @@ -55,7 +55,7 @@ test.describe( 'Successful purchase', () => { ).toBeVisible(); } ); - test( 'using a 3DS card', async () => { + test( 'using a 3DS card', { tag: '@critical' }, async () => { await shopper.fillCardDetails( shopperPage, config.cards[ '3ds' ] diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-save-card-and-purchase.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-save-card-and-purchase.spec.ts index 6e19e85c0b4..290129ebab5 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-save-card-and-purchase.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-checkout-save-card-and-purchase.spec.ts @@ -43,7 +43,7 @@ const cards: Array< CardType > = [ ], ]; -test.describe( 'Saved cards', () => { +test.describe( 'Saved cards', { tag: '@critical' }, () => { cards.forEach( ( [ cardType, card, products ] ) => { test.describe( `When using a ${ cardType } card added on checkout`, diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-multi-currency-widget.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-multi-currency-widget.spec.ts index 63bb95e9e73..c44a3e76a54 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-multi-currency-widget.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-multi-currency-widget.spec.ts @@ -78,7 +78,7 @@ test.describe( 'Shopper Multi-Currency widget', () => { await navigation.goToShop( shopperPage, { currency: 'USD' } ); } ); - test( 'at the order received page', async () => { + test( 'at the order received page', { tag: '@critical' }, async () => { orderId = await shopper.placeOrderWithCurrency( shopperPage, 'USD' diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts index ee48d7bef94..83337c5195c 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-payment-methods-add-fail.spec.ts @@ -103,25 +103,29 @@ test.describe( 'Payment Methods', () => { } ); } ); - test( 'it should not show error when adding payment method on another gateway', async () => { - await shopperPage - .getByRole( 'link', { name: 'Add payment method' } ) - .click(); - - await shopperPage.waitForLoadState( 'networkidle' ); - - //This will simulate selecting another payment gateway - await shopperPage.$eval( - 'input[name="payment_method"]:checked', - ( input ) => { - ( input as HTMLInputElement ).checked = false; - } - ); - - await shopperPage - .getByRole( 'button', { name: 'Add payment method' } ) - .click(); - - await expect( shopperPage.getByRole( 'alert' ) ).not.toBeVisible(); - } ); + test( + 'it should not show error when adding payment method on another gateway', + { tag: '@critical' }, + async () => { + await shopperPage + .getByRole( 'link', { name: 'Add payment method' } ) + .click(); + + await shopperPage.waitForLoadState( 'networkidle' ); + + //This will simulate selecting another payment gateway + await shopperPage.$eval( + 'input[name="payment_method"]:checked', + ( input ) => { + ( input as HTMLInputElement ).checked = false; + } + ); + + await shopperPage + .getByRole( 'button', { name: 'Add payment method' } ) + .click(); + + await expect( shopperPage.getByRole( 'alert' ) ).not.toBeVisible(); + } + ); } ); diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-renew-subscription.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-renew-subscription.spec.ts index 1dc13c65291..08e5cdeeec2 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-renew-subscription.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-renew-subscription.spec.ts @@ -14,6 +14,7 @@ import { shouldRunSubscriptionsTests } from '../../../utils/constants'; describeif( shouldRunSubscriptionsTests )( 'Subscriptions > Renew a subscription in my account', + { tag: '@critical' }, () => { const customerBillingConfig = config.addresses[ 'subscriptions-customer' ].billing; diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-saved-cards.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-saved-cards.spec.ts index 249d2130c6a..b399cfaf453 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-saved-cards.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-myaccount-saved-cards.spec.ts @@ -136,102 +136,122 @@ test.describe( 'Shopper can save and delete cards', () => { await ensureCustomerIsLoggedIn( shopperPage, project ); } ); - test( `should add the ${ cardName } card as a new payment method`, async () => { - await goToMyAccount( shopperPage, 'payment-methods' ); - // Make sure that at least 20s had already elapsed since the last card was added. - await waitTwentySecondsSinceLastCardAdded( shopperPage ); - - await addSavedCard( - shopperPage, - card, - address.country, - address.postalCode - ); - // Take note of the time when we added this card - timeAdded = +Date.now(); - - if ( cardName === '3ds' || cardName === '3ds2' ) { - await confirmCardAuthentication( shopperPage ); + test( + `should add the ${ cardName } card as a new payment method`, + { tag: '@critical' }, + async () => { + await goToMyAccount( shopperPage, 'payment-methods' ); + // Make sure that at least 20s had already elapsed since the last card was added. + await waitTwentySecondsSinceLastCardAdded( + shopperPage + ); + + await addSavedCard( + shopperPage, + card, + address.country, + address.postalCode + ); + // Take note of the time when we added this card + timeAdded = +Date.now(); + + if ( cardName === '3ds' || cardName === '3ds2' ) { + await confirmCardAuthentication( shopperPage ); + } + + await expect( + shopperPage.getByText( + 'Payment method successfully added.' + ) + ).toBeVisible(); + + // Verify that the card was added + await expect( + shopperPage.getByText( + 'You cannot add a new payment method so soon after the previous one. Please wait for 20 seconds.' + ) + ).not.toBeVisible(); + await expect( + shopperPage.getByText( + "We're not able to add this payment method. Please refresh the page and try again." + ) + ).not.toBeVisible(); + + await expect( + shopperPage.getByText( + `${ card.expires.month }/${ card.expires.year }` + ) + ).toBeVisible(); } + ); - await expect( - shopperPage.getByText( - 'Payment method successfully added.' - ) - ).toBeVisible(); - - // Verify that the card was added - await expect( - shopperPage.getByText( - 'You cannot add a new payment method so soon after the previous one. Please wait for 20 seconds.' - ) - ).not.toBeVisible(); - await expect( - shopperPage.getByText( - "We're not able to add this payment method. Please refresh the page and try again." - ) - ).not.toBeVisible(); - - await expect( - shopperPage.getByText( - `${ card.expires.month }/${ card.expires.year }` - ) - ).toBeVisible(); - } ); + test( + `should be able to purchase with the saved ${ cardName } card`, + { tag: '@critical' }, + async () => { + await setupProductCheckout( shopperPage, products ); + await selectSavedCardOnCheckout( shopperPage, card ); + await placeOrder( shopperPage ); + if ( cardName !== 'basic' ) { + await confirmCardAuthentication( shopperPage ); + } + await expect( + shopperPage.getByRole( 'heading', { + name: 'Order received', + } ) + ).toBeVisible(); + } + ); - test( `should be able to purchase with the saved ${ cardName } card`, async () => { - await setupProductCheckout( shopperPage, products ); - await selectSavedCardOnCheckout( shopperPage, card ); - await placeOrder( shopperPage ); - if ( cardName !== 'basic' ) { - await confirmCardAuthentication( shopperPage ); + test( + `should be able to set the ${ cardName } card as default payment method`, + { tag: '@critical' }, + async () => { + await goToMyAccount( shopperPage, 'payment-methods' ); + // Make sure that at least 20s had already elapsed since the last card was added. + await waitTwentySecondsSinceLastCardAdded( + shopperPage + ); + + await addSavedCard( shopperPage, card2, 'US', '94110' ); + // Take note of the time when we added this card + timeAdded = +Date.now(); + + await expect( + shopperPage.getByText( + `${ card2.expires.month }/${ card2.expires.year }` + ) + ).toBeVisible(); + await setDefaultPaymentMethod( shopperPage, card2 ); + // Verify that the card was set as default + await expect( + shopperPage.getByText( + 'This payment method was successfully set as your default.' + ) + ).toBeVisible(); } - await expect( - shopperPage.getByRole( 'heading', { - name: 'Order received', - } ) - ).toBeVisible(); - } ); + ); - test( `should be able to set the ${ cardName } card as default payment method`, async () => { - await goToMyAccount( shopperPage, 'payment-methods' ); - // Make sure that at least 20s had already elapsed since the last card was added. - await waitTwentySecondsSinceLastCardAdded( shopperPage ); - - await addSavedCard( shopperPage, card2, 'US', '94110' ); - // Take note of the time when we added this card - timeAdded = +Date.now(); - - await expect( - shopperPage.getByText( - `${ card2.expires.month }/${ card2.expires.year }` - ) - ).toBeVisible(); - await setDefaultPaymentMethod( shopperPage, card2 ); - // Verify that the card was set as default - await expect( - shopperPage.getByText( - 'This payment method was successfully set as your default.' - ) - ).toBeVisible(); - } ); + test( + `should be able to delete ${ cardName } card`, + { tag: '@critical' }, + async () => { + await goToMyAccount( shopperPage, 'payment-methods' ); + await deleteSavedCard( shopperPage, card ); + await expect( + shopperPage.getByText( 'Payment method deleted.' ) + ).toBeVisible(); - test( `should be able to delete ${ cardName } card`, async () => { - await goToMyAccount( shopperPage, 'payment-methods' ); - await deleteSavedCard( shopperPage, card ); - await expect( - shopperPage.getByText( 'Payment method deleted.' ) - ).toBeVisible(); - - await deleteSavedCard( shopperPage, card2 ); - await expect( - shopperPage.getByText( 'Payment method deleted.' ) - ).toBeVisible(); - - await expect( - shopperPage.getByText( 'No saved methods found.' ) - ).toBeVisible(); - } ); + await deleteSavedCard( shopperPage, card2 ); + await expect( + shopperPage.getByText( 'Payment method deleted.' ) + ).toBeVisible(); + + await expect( + shopperPage.getByText( 'No saved methods found.' ) + ).toBeVisible(); + } + ); } ); } ); diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-pay-for-order.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-pay-for-order.spec.ts index 8b24681ff1f..400aa9a0f7b 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-pay-for-order.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-pay-for-order.spec.ts @@ -17,7 +17,7 @@ const cardTestingPreventionStates = [ { cardTestingPreventionEnabled: true }, ]; -test.describe( 'Shopper > Pay for Order', () => { +test.describe( 'Shopper > Pay for Order', { tag: '@critical' }, () => { let merchantPage: Page; let shopperPage: Page; diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-failures.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-failures.spec.ts index 6117986ff53..7324a3f5809 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-failures.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-failures.spec.ts @@ -66,6 +66,7 @@ const errorsInsideStripeFrame = [ describeif( shouldRunWCBlocksTests )( 'WooCommerce Blocks > Checkout failures', + { tag: '@critical' }, () => { let shopperPage: Page; diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-purchase.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-purchase.spec.ts index 04bba069900..f27fd1c944c 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-purchase.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-checkout-purchase.spec.ts @@ -26,6 +26,7 @@ import { config } from '../../../config/default'; describeif( shouldRunWCBlocksTests )( 'WooCommerce Blocks > Successful purchase', + { tag: '@critical' }, () => { let shopperPage: Page; diff --git a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-saved-card-checkout-and-usage.spec.ts b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-saved-card-checkout-and-usage.spec.ts index 81eb9772ff2..f9d3ff8a6c9 100644 --- a/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-saved-card-checkout-and-usage.spec.ts +++ b/tests/e2e-pw/specs/wcpay/shopper/shopper-wc-blocks-saved-card-checkout-and-usage.spec.ts @@ -33,6 +33,7 @@ import { config } from '../../../config/default'; describeif( shouldRunWCBlocksTests )( 'WooCommerce Blocks > Saved cards', + { tag: '@critical' }, () => { let shopperPage: Page; const card = config.cards.basic;