-
Notifications
You must be signed in to change notification settings - Fork 135
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
4bd35a2
commit 2295b81
Showing
9 changed files
with
105 additions
and
133 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
61 changes: 61 additions & 0 deletions
61
...ages/e2e-playwright/tests/e2e/card/socialSecurityNumber/card.socialSecurityNumber.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { expect, test } from '../../../../fixtures/card.fixture'; | ||
import { PAYMENT_RESULT, REGULAR_TEST_CARD, TEST_CPF_VALUE, TEST_CVC_VALUE, TEST_DATE_VALUE } from '../../../utils/constants'; | ||
import { binLookupMock } from '../../../../mocks/binLookup/binLookup.mock'; | ||
import { socialSecurityNumberRequiredMock } from '../../../../mocks/binLookup/binLookup.data'; | ||
import { URL_MAP } from '../../../../fixtures/URL_MAP'; | ||
|
||
test.describe('Card payment with Social Security Number ', () => { | ||
test.describe('with "socialSecurityNumberMode" set to "show"', () => { | ||
test('should make a payment with a valid SSN', async ({ cardWithSSN }) => { | ||
await cardWithSSN.goto(URL_MAP.cardWithSsn); | ||
|
||
await cardWithSSN.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithSSN.typeCvc(TEST_CVC_VALUE); | ||
await cardWithSSN.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithSSN.typeSsn(TEST_CPF_VALUE); | ||
await cardWithSSN.pay(); | ||
|
||
await expect(cardWithSSN.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
|
||
test('should display an error if SSN is not valid', async ({ cardWithSSN }) => { | ||
await cardWithSSN.goto(URL_MAP.cardWithSsn); | ||
|
||
await cardWithSSN.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithSSN.typeCvc(TEST_CVC_VALUE); | ||
await cardWithSSN.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithSSN.typeSsn('100200300'); | ||
await cardWithSSN.pay(); | ||
|
||
await expect(cardWithSSN.ssnInputErrorElement).toBeVisible(); | ||
}); | ||
}); | ||
|
||
test.describe('with binLookup forcing the field to be shown ("auto" mode)', () => { | ||
test('should display the SSN field once the card is entered', async ({ page, cardWithSSN }) => { | ||
await binLookupMock(page, socialSecurityNumberRequiredMock); | ||
await cardWithSSN.goto(URL_MAP.card); | ||
|
||
await expect(cardWithSSN.ssnInput).not.toBeVisible(); | ||
|
||
await cardWithSSN.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithSSN.typeCvc(TEST_CVC_VALUE); | ||
await cardWithSSN.typeExpiryDate(TEST_DATE_VALUE); | ||
|
||
await expect(cardWithSSN.ssnInput).toBeVisible(); | ||
}); | ||
|
||
test('should perform SSN validation if the field is displayed', async ({ page, cardWithSSN }) => { | ||
await binLookupMock(page, socialSecurityNumberRequiredMock); | ||
await cardWithSSN.goto(URL_MAP.card); | ||
|
||
await cardWithSSN.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithSSN.typeCvc(TEST_CVC_VALUE); | ||
await cardWithSSN.typeExpiryDate(TEST_DATE_VALUE); | ||
|
||
await cardWithSSN.pay(); | ||
|
||
await expect(cardWithSSN.ssnInputErrorElement).toBeVisible(); | ||
}); | ||
}); | ||
}); |
10 changes: 0 additions & 10 deletions
10
...ages/e2e-playwright/tests/ui/card/socialSecurityNumber/autoMode/autoMode.clientScripts.js
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
packages/e2e-playwright/tests/ui/card/socialSecurityNumber/autoMode/autoMode.spec.ts
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...ages/e2e-playwright/tests/ui/card/socialSecurityNumber/showMode/showMode.clientScripts.js
This file was deleted.
Oops, something went wrong.
60 changes: 0 additions & 60 deletions
60
packages/e2e-playwright/tests/ui/card/socialSecurityNumber/showMode/showMode.spec.ts
This file was deleted.
Oops, something went wrong.
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