-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add e2e tests for kcpAuthentication, stored-card-amex, stored-card-mc and stored-card-visa #3005
Conversation
|
Size Change: 0 B Total Size: 768 kB ℹ️ View Unchanged
|
size-limit report 📦
|
|
await cardWithKCP.fillExpiryDate(TEST_DATE_VALUE); | ||
await cardWithKCP.isPayable(); | ||
await cardWithKCP.pay(); | ||
await expect(cardWithKCP.paymentResult).toContainText(PAYMENT_RESULT.authorised); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this whole file not overlap with e2e/card/kcp/card.kcp.spec.ts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not 100% sure because there is a paymentSuccessfulMock
in the e2e/card/kcp/card.kcp.spec.ts
file i suppose it's not really making a payment call.
I think if we remove the paymentSuccessfulMock
those 2 files are overlapping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think, at the time, we weren't sure if we had an actual, working korean local card number - so I guess that's why @ribeiroguilherme used a mock?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that testing korean card was flaky - initially it was failing all the time; then it started to work somehow; then from time to time we were getting a redirect to a weird page asking to inform birthdate and 2 digits pin, which causes the current kcp test to fail
@@ -14,6 +14,10 @@ export abstract class Base { | |||
await this.isComponentVisible(); | |||
} | |||
|
|||
async isPayable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have several places where we either say:
await page.waitForFunction(() => globalThis.component.isValid === true);
or
await page.waitForFunction(() => globalThis.component.isValid === false);
This function could take a parameter & then be used in all these places
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's a nice find. I'll refactor this in another PR 😄.
Summary