-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b69cc8
commit c4605fb
Showing
5 changed files
with
46 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/e2e-playwright/tests/e2e/dropin/storedCard/stored-card-amex.spec.ts
This file contains 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
43 changes: 39 additions & 4 deletions
43
packages/e2e-playwright/tests/e2e/dropin/storedCard/stored-card-maestro.spec.ts
This file contains 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 |
---|---|---|
@@ -1,9 +1,44 @@ | ||
import { test } from '@playwright/test'; | ||
import { cardInDropin as test, expect } from '../../../../fixtures/dropin.fixture'; | ||
import { URL_MAP } from '../../../../fixtures/URL_MAP'; | ||
import { PAYMENT_RESULT, TEST_CVC_VALUE, THREEDS2_CHALLENGE_PASSWORD } from '../../../utils/constants'; | ||
|
||
test.describe('Stored Maestro card - cvc optional', () => { | ||
// When user do not fill in the cvc | ||
test('should make a successful payment without the cvc code', async () => {}); | ||
test('should make a successful payment without the cvc code', async ({ dropinWithSession, card }) => { | ||
await dropinWithSession.goto(URL_MAP.dropinWithSession); | ||
await dropinWithSession.selectFirstStoredPaymentMethod('maestro', '0029'); | ||
|
||
await card.cvcInput.waitFor({ state: 'visible' }); | ||
await card.pay({ name: /^Pay/i }); | ||
await card.threeDs2Challenge.fillInPassword(THREEDS2_CHALLENGE_PASSWORD); | ||
await card.threeDs2Challenge.submit(); | ||
|
||
await expect(card.paymentResult).toContainText(PAYMENT_RESULT.success); | ||
}); | ||
// When user fills in the cvc | ||
test('should make a successful payment after filling in the correct 3ds challenge password', async () => {}); | ||
test('should decline the payment after filling in the wrong 3ds challenge password', async () => {}); | ||
test('should make a successful payment after filling in the correct 3ds challenge password', async ({ dropinWithSession, card }) => { | ||
await dropinWithSession.goto(URL_MAP.dropinWithSession); | ||
await dropinWithSession.selectFirstStoredPaymentMethod('maestro', '0029'); | ||
|
||
await card.cvcInput.waitFor({ state: 'visible' }); | ||
await card.fillCvc(TEST_CVC_VALUE); | ||
await card.pay({ name: /^Pay/i }); | ||
await card.threeDs2Challenge.fillInPassword(THREEDS2_CHALLENGE_PASSWORD); | ||
await card.threeDs2Challenge.submit(); | ||
|
||
await expect(card.paymentResult).toContainText(PAYMENT_RESULT.success); | ||
}); | ||
|
||
test('should decline the payment after filling in the wrong 3ds challenge password', async ({ dropinWithSession, card }) => { | ||
await dropinWithSession.goto(URL_MAP.dropinWithSession); | ||
await dropinWithSession.selectFirstStoredPaymentMethod('maestro', '0029'); | ||
|
||
await card.cvcInput.waitFor({ state: 'visible' }); | ||
await card.fillCvc(TEST_CVC_VALUE); | ||
await card.pay({ name: /^Pay/i }); | ||
await card.threeDs2Challenge.fillInPassword('dummy'); | ||
await card.threeDs2Challenge.submit(); | ||
|
||
await expect(card.paymentResult).toContainText(PAYMENT_RESULT.fail); | ||
}); | ||
}); |