-
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.
Merge branch 'main' into chore/testing_alternate_paste_fny
- Loading branch information
Showing
19 changed files
with
617 additions
and
623 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@adyen/adyen-web': minor | ||
--- | ||
|
||
Updated DonationComponent UI |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
149 changes: 149 additions & 0 deletions
149
packages/e2e-playwright/tests/e2e/card/kcp/card.kcp.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,149 @@ | ||
import { expect, test } from '../../../../fixtures/card.fixture'; | ||
import { URL_MAP } from '../../../../fixtures/URL_MAP'; | ||
import { | ||
KOREAN_TEST_CARD, | ||
PAYMENT_RESULT, | ||
REGULAR_TEST_CARD, | ||
TEST_CVC_VALUE, | ||
TEST_DATE_VALUE, | ||
TEST_PWD_VALUE, | ||
TEST_TAX_NUMBER_VALUE | ||
} from '../../../utils/constants'; | ||
import { getStoryUrl } from '../../../utils/getStoryUrl'; | ||
import { paymentSuccessfulMock } from '../../../../mocks/payments/payments.mock'; | ||
|
||
test.describe('Card with KCP fields', () => { | ||
test.describe('Displaying KCP fields by default', () => { | ||
test('should hide KCP fields if Card is not korean and make the payment', async ({ cardWithKCP }) => { | ||
await cardWithKCP.goto(URL_MAP.cardWithKcp); | ||
await cardWithKCP.typeCardNumber(REGULAR_TEST_CARD); | ||
|
||
await expect(cardWithKCP.passwordInput).not.toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).not.toBeVisible(); | ||
|
||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.pay(); | ||
|
||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
|
||
test('should hide KCP fields if Card is not korean, then show them again once the Card is replaced by korean card and make the payment', async ({ | ||
cardWithKCP, | ||
page | ||
}) => { | ||
await paymentSuccessfulMock(page); | ||
const paymentsRequestPromise = page.waitForRequest(request => request.url().includes('/payments') && request.method() === 'POST'); | ||
|
||
await cardWithKCP.goto(URL_MAP.cardWithKcp); | ||
await cardWithKCP.typeCardNumber(REGULAR_TEST_CARD); | ||
|
||
await expect(cardWithKCP.passwordInput).not.toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).not.toBeVisible(); | ||
|
||
await cardWithKCP.deleteCardNumber(); | ||
|
||
await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD); | ||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.typeTaxNumber(TEST_TAX_NUMBER_VALUE); | ||
await cardWithKCP.typePassword(TEST_PWD_VALUE); | ||
await cardWithKCP.pay(); | ||
|
||
// Check that KCP fields are passed in | ||
const request = await paymentsRequestPromise; | ||
const paymentMethod = await request.postDataJSON().paymentMethod; | ||
expect(paymentMethod.encryptedPassword).not.toBeNull(); | ||
expect(paymentMethod.taxNumber).not.toBeNull(); | ||
|
||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
test('should fill in KCP fields, then replace with non-korean Card and make a payment', async ({ cardWithKCP }) => { | ||
await cardWithKCP.goto(URL_MAP.cardWithKcp); | ||
|
||
await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD); | ||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.typeTaxNumber(TEST_TAX_NUMBER_VALUE); | ||
await cardWithKCP.typePassword(TEST_PWD_VALUE); | ||
|
||
await cardWithKCP.deleteCardNumber(); | ||
await cardWithKCP.typeCardNumber(REGULAR_TEST_CARD); | ||
|
||
await expect(cardWithKCP.passwordInput).not.toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).not.toBeVisible(); | ||
|
||
await cardWithKCP.pay(); | ||
|
||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
}); | ||
|
||
test.describe('Displaying KCP fields once Korean card is detected', () => { | ||
const url = getStoryUrl({ | ||
baseUrl: URL_MAP.card, | ||
componentConfig: { | ||
brands: ['mc', 'visa', 'amex', 'korean_local_card'], | ||
configuration: { | ||
koreanAuthenticationRequired: true | ||
} | ||
} | ||
}); | ||
|
||
test('should display KCP fields once korean card is entered and make the payment', async ({ cardWithKCP, page }) => { | ||
await paymentSuccessfulMock(page); | ||
|
||
await cardWithKCP.goto(url); | ||
|
||
await expect(cardWithKCP.passwordInput).not.toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).not.toBeVisible(); | ||
|
||
await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD); | ||
|
||
await expect(cardWithKCP.passwordInput).toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).toBeVisible(); | ||
|
||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.typeTaxNumber(TEST_TAX_NUMBER_VALUE); | ||
await cardWithKCP.typePassword(TEST_PWD_VALUE); | ||
await cardWithKCP.pay(); | ||
|
||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
|
||
test('should display KCP fields once korean card is entered, then replace by regular Card and make the payment', async ({ cardWithKCP }) => { | ||
await cardWithKCP.goto(url); | ||
|
||
await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD); | ||
|
||
await expect(cardWithKCP.passwordInput).toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).toBeVisible(); | ||
|
||
await cardWithKCP.deleteCardNumber(); | ||
|
||
await cardWithKCP.typeCardNumber(REGULAR_TEST_CARD); | ||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
|
||
await expect(cardWithKCP.passwordInput).not.toBeVisible(); | ||
await expect(cardWithKCP.taxNumberInput).not.toBeVisible(); | ||
|
||
await cardWithKCP.pay(); | ||
|
||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); | ||
}); | ||
|
||
test('should apply validation to KCP fields', async ({ cardWithKCP }) => { | ||
await cardWithKCP.goto(url); | ||
|
||
await cardWithKCP.typeCardNumber(KOREAN_TEST_CARD); | ||
await cardWithKCP.typeCvc(TEST_CVC_VALUE); | ||
await cardWithKCP.typeExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.pay(); | ||
|
||
await expect(cardWithKCP.taxNumberErrorLocator).toHaveText('Invalid Cardholder birthdate or Corporate registration number'); | ||
await expect(cardWithKCP.passwordErrorLocator).toHaveText('Enter the password'); | ||
}); | ||
}); | ||
}); |
11 changes: 0 additions & 11 deletions
11
packages/e2e-playwright/tests/ui/card/kcp/startWithKCP/startWithKCP.clientScripts.js
This file was deleted.
Oops, something went wrong.
137 changes: 0 additions & 137 deletions
137
packages/e2e-playwright/tests/ui/card/kcp/startWithKCP/startWithKCP.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.