Skip to content

Commit

Permalink
General fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoumpierre committed Feb 5, 2025
1 parent b0cc1ed commit 86e1fda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import test, { Page, expect } from '@playwright/test';
*/
import { config } from '../../../config/default';
import { goToMyAccount } from '../../../utils/shopper-navigation';
import { getShopper, isUIUnblocked } from '../../../utils/helpers';
import {
ensureCustomerIsLoggedIn,
getShopper,
isUIUnblocked,
} from '../../../utils/helpers';
import {
addSavedCard,
confirmCardAuthentication,
Expand Down Expand Up @@ -58,6 +62,10 @@ test.describe( 'Payment Methods', () => {
} );
cards.forEach( ( [ cardType, card, errorText ] ) => {
test.describe( `when attempting to add a ${ cardType } card`, () => {
test.beforeAll( async () => {
await ensureCustomerIsLoggedIn( shopperPage );
} );

test( 'it should not add the card', async () => {
const { label } = card;

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e-pw/utils/shopper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export const addSavedCard = async (
) => {
await page.getByRole( 'link', { name: 'Add payment method' } ).click();
await page.waitForLoadState( 'networkidle' );
await page.getByText( 'Cards' ).click();
await page.getByText( 'Cards', { exact: true } ).click();
const frameHandle = page.getByTitle( 'Secure payment input frame' );
const stripeFrame = frameHandle.contentFrame();

Expand Down

0 comments on commit 86e1fda

Please sign in to comment.