-
Notifications
You must be signed in to change notification settings - Fork 60
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
test: add automated Cypress test for card number input validation #796
base: main
Are you sure you want to change the base?
Conversation
ab51e8b
to
63d34dd
Compare
63d34dd
to
245029e
Compare
it("should complete the card payment successfully", () => { | ||
const { cardNo, card_exp_month, card_exp_year, cvc } = stripeCards.successCard; | ||
|
||
getIframeBody().find('[data-testid=cardNoInput]').type(cardNo); | ||
getIframeBody().find('[data-testid=expiryInput]').type(card_exp_month); | ||
getIframeBody().find('[data-testid=expiryInput]').type(card_exp_year); | ||
getIframeBody().find('[data-testid=cvvInput]').type(cvc); | ||
|
||
getIframeBody().get("#submit").click(); | ||
|
||
cy.wait(3000); | ||
cy.contains("Thanks for your order!").should("be.visible"); | ||
}); |
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.
it("should complete the card payment successfully", () => { | |
const { cardNo, card_exp_month, card_exp_year, cvc } = stripeCards.successCard; | |
getIframeBody().find('[data-testid=cardNoInput]').type(cardNo); | |
getIframeBody().find('[data-testid=expiryInput]').type(card_exp_month); | |
getIframeBody().find('[data-testid=expiryInput]').type(card_exp_year); | |
getIframeBody().find('[data-testid=cvvInput]').type(cvc); | |
getIframeBody().get("#submit").click(); | |
cy.wait(3000); | |
cy.contains("Thanks for your order!").should("be.visible"); | |
}); |
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.
This is already being tested in an existing test case, please remove this
|
||
getIframeBody().get("#submit").click(); | ||
|
||
cy.wait(3000); |
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.
cy.wait(3000); |
|
||
getIframeBody().get("#submit").click(); | ||
|
||
cy.wait(3000); |
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.
cy.wait(3000); |
|
||
getIframeBody().get("#submit").click(); | ||
|
||
cy.wait(3000); |
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.
cy.wait(3000); |
|
||
getIframeBody().get("#submit").click(); | ||
|
||
cy.wait(3000); |
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.
cy.wait(3000); |
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.
Please add a test suite to verify that when a user enters a value in the card input field and then clears it, no error message is displayed as long as the focus remains on the card input field.
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.
Okay
Type of Change
Description
add automated Cypress test for card number input validation.
How did you test it?
Screen.Recording.2024-11-14.at.3.00.55.PM.mov
Checklist
npm run re:build