Skip to content

Commit

Permalink
Merge branch 'develop' into dev/add-logs-when-ece-is-hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrosa authored Jan 24, 2025
2 parents dc3e74e + 1751c12 commit 2039eb4
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 18 deletions.
20 changes: 16 additions & 4 deletions tests/e2e/test-data/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@
"label": "Visa ending in 0002",
"error": [
"The card was declined.",
"Your card was declined."
"Your card was declined.",
"The card has been declined.",
"Your card has been declined."
]
},
"declined-funds": {
Expand Down Expand Up @@ -190,7 +192,7 @@
},
"cvc": "626",
"label": "Visa ending in 0069",
"error": [ "The card has expired.", "Your card has expired." ]
"error": [ "The card has expired.", "Your card has expired.", "Your card is expired." ]
},
"declined-cvc": {
"number": "4000000000000127",
Expand All @@ -202,7 +204,8 @@
"label": "Visa ending in 0127",
"error": [
"The card's security code is incorrect.",
"Your card's security code is incorrect."
"Your card's security code is incorrect.",
"Your card.s CVC is incorrect."
]
},
"declined-processing": {
Expand All @@ -215,7 +218,7 @@
"label": "Visa ending in 0119",
"error": [
"An error occurred while processing the card.",
"An error occurred while processing your card. Try again in a little bit."
"An error occurred while processing your card."
]
},
"declined-3ds": {
Expand Down Expand Up @@ -244,6 +247,15 @@
},
"cvc": "11",
"label": "Visa ending in 4242"
},
"no-3ds": {
"number": "378282246310005",
"expires": {
"month": "06",
"year": "29"
},
"cvc": "626",
"label": "3DS not supported"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test( 'customer can checkout with a SCA card @smoke @blocks', async ( {
name: 'stripe-challenge-frame',
} )
.getByRole( 'button', { name: 'Complete' } )
.click();
.dispatchEvent( 'click' );

await page.waitForURL( '**/checkout/order-received/**' );

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/checkout/blocks/subscription-product.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ test( 'customer can purchase a subscription product @smoke @blocks @subscription
};

await setupBlocksCheckout( page, customerData );
await fillCreditCardDetails( page, config.get( 'cards.basic' ) );
await fillCreditCardDetails( page, config.get( 'cards.no-3ds' ) );

await page.locator( 'text=Sign up now' ).click();
await page.waitForNavigation();
await page.waitForURL( '**/checkout/order-received/**' );

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/checkout/shortcode/card-failures.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const testCard = async ( page, cardKey ) => {
const card = config.get( cardKey );

await fillCreditCardDetailsShortcode( page, card );
await page.locator( 'text=Place order' ).click();
await page.locator( 'text=Place order' ).dispatchEvent( 'click' );

expect
.soft( await page.innerText( '.woocommerce-error' ) )
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/checkout/shortcode/normal-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test( 'customer can checkout with a normal credit card @smoke', async ( {
config.get( 'addresses.customer.billing' )
);
await fillCreditCardDetailsShortcode( page, config.get( 'cards.basic' ) );
await page.locator( 'text=Place order' ).click();
await page.locator( 'text=Place order' ).dispatchEvent( 'click' );
await page.waitForNavigation();

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/checkout/shortcode/saved-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test( 'customer can checkout with a saved card @smoke', async ( { page } ) => {
// check box to save payment method.
await page.locator( '#wc-stripe-new-payment-method' ).click();

await page.locator( 'text=Place order' ).click();
await page.locator( 'text=Place order' ).dispatchEvent( 'click' );

await page.waitForNavigation();
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
Expand All @@ -68,7 +68,7 @@ test( 'customer can checkout with a saved card @smoke', async ( { page } ) => {
)
).toHaveCount( 1 );

await page.locator( 'text=Place order' ).click();
await page.locator( 'text=Place order' ).dispatchEvent( 'click' );

await page.waitForNavigation();
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/checkout/shortcode/sca-card.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test( 'customer can checkout with a SCA card @smoke', async ( { page } ) => {
config.get( 'addresses.customer.billing' )
);
await fillCreditCardDetailsShortcode( page, config.get( 'cards.3ds' ) );
await page.locator( 'text=Place order' ).click();
await page.locator( 'text=Place order' ).dispatchEvent( 'click' );

// Wait until the SCA frame is available
while (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ test( 'customer can purchase a subscription product @smoke @subscriptions', asyn
await fillCreditCardDetailsShortcode( page, config.get( 'cards.basic' ) );

await page.locator( 'text=Sign up now' ).click();
await page.waitForNavigation();
await page.waitForURL( '**/checkout/order-received/**' );

await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/tests/orders/full-refund.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test( 'merchant can issue a full refund @smoke', async ( { browser } ) => {
userPage,
config.get( 'cards.basic' )
);
await userPage.locator( 'text=Place order' ).click();
await userPage.locator( 'text=Place order' ).dispatchEvent( 'click' );
await userPage.waitForURL( '**/checkout/order-received/**' );

await expect( userPage.locator( 'h1.entry-title' ) ).toHaveText(
Expand Down
4 changes: 3 additions & 1 deletion tests/e2e/tests/subscriptions/subscription-renewal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ test( 'customer can renew a subscription @smoke @subscriptions', async ( {
await page.click(
'input[id^="radio-control-wc-payment-method-saved-tokens-"]'
);
await page.click( 'text=Renew subscription' );
await page
.locator( 'text=Renew subscription' )
.dispatchEvent( 'click' );
await expect( page.locator( 'h1.entry-title' ) ).toHaveText(
'Order received'
);
Expand Down
10 changes: 7 additions & 3 deletions tests/e2e/utils/payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,13 @@ export async function setupShortcodeCheckout( page, billingDetails = null ) {

for ( const fieldName of Object.keys( billingDetails ) ) {
if (
[ 'state', 'country', 'state_iso', 'country_iso' ].includes(
fieldName
)
[
'state',
'country',
'state_iso',
'country_iso',
'company',
].includes( fieldName )
) {
continue;
}
Expand Down

0 comments on commit 2039eb4

Please sign in to comment.