-
Notifications
You must be signed in to change notification settings - Fork 70
[QA] add: BCDC e2e tests for classic checkout (Mexico) #4297
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
syde-piotr-ostrowski
merged 6 commits into
dev/develop
from
dev/qa/add-card-button-bcdc-e2e
May 5, 2026
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a02421
add: BCDC e2e tests for classic checkout (Mexico)
syde-piotr-ostrowski 64ee28c
add: fill PayPal BCDC billing form
syde-piotr-ostrowski baa8a1d
fix: remove unnecessary tags from the PCP-1211 test
syde-piotr-ostrowski 19b1d1a
fix: use BCDC naming for card button test data
syde-piotr-ostrowski 872c148
fix: fill BCDC billing form from test customer data
syde-piotr-ostrowski 05cb3e1
fix: rename remaining BCDC QA references
syde-piotr-ostrowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tests/qa/tests/05-transactions/_test-data/standard-card-button/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './standard-card-button-classic-checkout.data'; |
65 changes: 65 additions & 0 deletions
65
...ransactions/_test-data/standard-card-button/standard-card-button-classic-checkout.data.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { | ||
| payments, | ||
| orders, | ||
| customers, | ||
| guests, | ||
| merchants, | ||
| ShopOrder, | ||
| } from '../../../../resources'; | ||
|
|
||
| const customer = customers.mexico; | ||
| const guest = guests.mexico; | ||
|
|
||
| /** | ||
| * BCDC (Branded Card Debit/Credit) — classic checkout only. | ||
| * Block checkout is NOT supported). | ||
| */ | ||
| const merchant = merchants.mexico; | ||
|
|
||
| export const standardCardButtonClassicCheckout: ShopOrder[] = [ | ||
| { | ||
| // https://inpsyde.atlassian.net/browse/PCP-1211 | ||
| title: 'PCP-1211 | Transaction - Classic checkout - Standard Card Button - Default order @Critical', | ||
| ...orders.default, | ||
| payment: payments.standardCardButton, | ||
| customer: guest, | ||
| merchant, | ||
| }, | ||
| { | ||
| // https://inpsyde.atlassian.net/browse/PCP-2747 | ||
| title: 'PCP-2747 | Transaction - Classic checkout - Standard Card Button - Order by customer', | ||
| ...orders.default, | ||
| payment: payments.standardCardButton, | ||
| customer, | ||
| merchant, | ||
| }, | ||
| ]; | ||
|
|
||
| export const standardCardButtonClassicCheckoutExcludingTax: ShopOrder[] = [ | ||
| { | ||
| // https://inpsyde.atlassian.net/browse/PCP-1253 | ||
| title: 'PCP-1253 | Transaction - Classic checkout - Standard Card Button - Order with price excluding tax', | ||
| ...orders.excludingTax, | ||
| payment: payments.standardCardButton, | ||
| customer: guest, | ||
| merchant, | ||
| }, | ||
| ]; | ||
|
|
||
| export const standardCardButtonClassicCheckoutIntentAuthorized: ShopOrder[] = [ | ||
| { | ||
| // https://inpsyde.atlassian.net/browse/PCP-2759 | ||
| title: 'PCP-2759 | Transaction - Classic checkout - Standard Card Button - Order with Intent Authorized', | ||
| ...orders.default, | ||
| payment: { | ||
| ...payments.standardCardButton, | ||
| isAuthorized: true, | ||
| }, | ||
| orderStatus: 'on-hold', | ||
| customer: guest, | ||
| merchant, | ||
| }, | ||
| ]; |
80 changes: 80 additions & 0 deletions
80
tests/qa/tests/05-transactions/transaction-mexico-classic.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { test } from '../../utils'; | ||
| import { | ||
| merchants, | ||
| storeConfigMexico, | ||
| gateways, | ||
| taxSettings, | ||
| customers, | ||
| } from '../../resources'; | ||
| import { transactionsOnClassicCheckout } from './_test-scenarios'; | ||
| import { | ||
| standardCardButtonClassicCheckout, | ||
| standardCardButtonClassicCheckoutExcludingTax, | ||
| standardCardButtonClassicCheckoutIntentAuthorized, | ||
| } from './_test-data/standard-card-button'; | ||
|
|
||
| /** | ||
| * Standard Card Button / BCDC | ||
| * BCDC is classic-checkout only — block checkout is not supported. | ||
| */ | ||
|
|
||
| const { payPal, standardCardButton } = gateways; | ||
|
|
||
| test.beforeAll( async ( { utils, pcpApi, wooCommerceApi } ) => { | ||
| await utils.configureStore( { | ||
| ...storeConfigMexico, | ||
| enableClassicPages: true, | ||
| customer: customers.mexico, | ||
| } ); | ||
| await utils.installAndActivatePcp(); | ||
| await pcpApi.resetDb(); | ||
| await pcpApi.connectMerchant( | ||
| merchants.mexico.client_id, | ||
| merchants.mexico.client_secret | ||
| ); | ||
| await pcpApi.updatePcpPaymentMethods( { | ||
| [ payPal.id ]: { id: payPal.id, enabled: true }, | ||
| [ standardCardButton.id ]: { | ||
| id: standardCardButton.id, | ||
| enabled: true, | ||
| }, | ||
| } ); | ||
| await wooCommerceApi.deleteAllOrders(); | ||
| } ); | ||
|
|
||
| for ( const testOrder of standardCardButtonClassicCheckout ) { | ||
| transactionsOnClassicCheckout( testOrder ); | ||
| } | ||
|
|
||
| // Excluding Tax | ||
| test.describe( () => { | ||
| test.beforeAll( async ( { wooCommerceUtils } ) => { | ||
| await wooCommerceUtils.setTaxes( taxSettings.excluding ); | ||
| } ); | ||
|
|
||
| for ( const testOrder of standardCardButtonClassicCheckoutExcludingTax ) { | ||
| transactionsOnClassicCheckout( testOrder ); | ||
| } | ||
|
|
||
| test.afterAll( async ( { wooCommerceUtils } ) => { | ||
| await wooCommerceUtils.setTaxes( taxSettings.including ); | ||
| } ); | ||
| } ); | ||
|
|
||
| // Intent Authorized | ||
| test.describe( () => { | ||
| test.beforeAll( async ( { pcpApi } ) => { | ||
| await pcpApi.updatePcpSettings( { authorizeOnly: true } ); | ||
| } ); | ||
|
|
||
| for ( const testOrder of standardCardButtonClassicCheckoutIntentAuthorized ) { | ||
| transactionsOnClassicCheckout( testOrder ); | ||
| } | ||
|
|
||
| test.afterAll( async ( { pcpApi } ) => { | ||
| await pcpApi.updatePcpSettings( { authorizeOnly: false } ); | ||
| } ); | ||
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.