Skip to content

Commit

Permalink
feat: add adyen3DSCardDetails in fixture and make necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamchasing committed Oct 24, 2024
1 parent 30c060c commit c2da6a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cypress-tests/cypress/e2e/adyen-card-flow-e2e-test.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ describe("Adyen Card payment flow test", () => {
});

it("submit payment form and make successful payment", () => {
getIframeBody().find(`[data-testid=${testIds.addNewCardIcon}]`).click();
cy.enterValueInIframe(testIds.cardNoInputTestId, "4917 6100 0000 0000");
cy.enterValueInIframe(testIds.expiryInputTestId, "03/30");
cy.enterValueInIframe(testIds.cardCVVInputTestId, "737");
cy.clickElementInIframe(testIds.addNewCardIcon);

cy.fixture("adyen3DSCardDetails").then((cardDetails) => {
cy.enterValueInIframe(testIds.cardNoInputTestId, cardDetails.cardNumber);
cy.enterValueInIframe(testIds.expiryInputTestId, cardDetails.expiryDate);
cy.enterValueInIframe(testIds.cardCVVInputTestId, cardDetails.cvv);
});

cy.intercept("**/payments/redirect/**").as("hyperswitchRedriect");
cy.intercept("**/checkoutshopper/threeDS2.shtml*").as("adyenCheckout");
Expand All @@ -58,9 +61,7 @@ describe("Adyen Card payment flow test", () => {

//adyen checkout page
cy.wait("@adyenCheckout").then(() => {
//not using cy.iframe as it can only be applied to exactly one iframe at a time
cy.get(adyenIframeSelector).should("be.visible");

cy.frameLoaded(adyenIframeSelector);
cy.getIframeElement(adyenIframeSelector, ".input-field").type("password");
cy.getIframeElement(adyenIframeSelector, "#buttonSubmit").click();

Expand Down
5 changes: 5 additions & 0 deletions cypress-tests/cypress/fixtures/adyen3DSCardDetails.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cardNumber": "4917 6100 0000 0000",
"expiryDate": "03/30",
"cvv": "737"
}

0 comments on commit c2da6a7

Please sign in to comment.