Skip to content

E2E Playwright Migration: convert Payment Gateways Confirmation spec #10090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: dev

Update the Playwright Payment Gateways Confirmation spec and remove the Puppeteer Payment Gateways Confirmation spec.
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@ import { test, expect, Page } from '@playwright/test';
*/
import { useMerchant } from '../../utils/helpers';

// Skipping the test for now as it is flaky on GH action runs. See #8875.
test.skip( 'payment gateways disable confirmation', () => {
test.describe( 'payment gateways disable confirmation', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 I'm unsure if it is in scope for this PR or project, but have you considered adding @critical tags to these tests as described in this RFC for measuring critical flow e2e coverage paJDYF-dVT-p2 (authored by @alopezari)?

Suggested change
test.describe( 'payment gateways disable confirmation', () => {
test.describe( 'payment gateways disable confirmation', {
tag: '@critical',
},
() => {

Mind you, this is not currently documented in the Playwright E2E README, but we have utilised @critical tagging this for some e2e tests e.g. https://github.com/Automattic/woocommerce-payments/blob/develop/tests/e2e-pw/specs/merchant/merchant-admin-account-balance.spec.ts.

I'm also assuming that this is a critical flow, which may be incorrect. 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging this. I see you also commented on the project thread about it. We can move the discussion forward there. That said, I checked and I don't believe these tests are part of the current critical flows.

useMerchant();

const getToggle = ( page: Page ) =>
page.getByRole( 'link', {
name: '"WooPayments" payment method is currently',
name:
'"WooPayments (Credit card / debit card)" payment method is currently',
} );

const getModalHeading = ( page: Page ) =>
page.getByRole( 'heading', { name: 'Disable WooPayments' } );

const getSaveButton = ( page: Page ) =>
page.getByRole( 'button', { name: 'Save changes' } );

const getCancelButton = ( page: Page ) =>
page.getByRole( 'button', { name: 'Cancel' } );

Expand Down Expand Up @@ -59,7 +56,6 @@ test.skip( 'payment gateways disable confirmation', () => {
if ( ( await getToggle( page ).innerText() ) === 'No' ) {
await getToggle( page ).click();
await waitForToggleLoading( page );
await getSaveButton( page ).click();
}

await expect( getToggle( page ) ).toHaveText( 'Yes' );
Expand All @@ -73,7 +69,6 @@ test.skip( 'payment gateways disable confirmation', () => {

// After clicking "Cancel", the modal should close and WCPay should still be enabled, even after refresh
await expect( getModalHeading( page ) ).not.toBeVisible();
await getSaveButton( page ).click();
await expect( getToggle( page ) ).toHaveText( 'Yes' );
} );

Expand All @@ -88,12 +83,10 @@ test.skip( 'payment gateways disable confirmation', () => {

// and refreshing the page should show WCPay become disabled
await waitForToggleLoading( page );
await getSaveButton( page ).click();

// now we can re-enable it with no issues
await getToggle( page ).click();
await waitForToggleLoading( page );
await getSaveButton( page ).click();
await expect( getToggle( page ) ).toHaveText( 'Yes' );
} );

Expand Down

This file was deleted.

Loading