Skip to content

Commit

Permalink
ci(cypress): Add list and revoke for zero auth mandate payments (#6569)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnanasundari24 authored Nov 26, 2024
1 parent acb30ef commit 9baa1ef
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import getConnectorDetails, * as utils from "../PaymentUtils/Utils";

let globalState;

describe("Card - SingleUse Mandates flow test", () => {
describe("Card - List and revoke Mandates flow test", () => {
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {
globalState = new State(state);
Expand Down Expand Up @@ -71,4 +71,55 @@ describe("Card - SingleUse Mandates flow test", () => {
});
}
);
context("Card - Zero auth CIT and MIT payment flow test", () => {
let should_continue = true; // variable that will be used to skip tests if a previous test fails

beforeEach(function () {
if (!should_continue) {
this.skip();
}
});

it("Confirm No 3DS CIT", () => {
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][
"ZeroAuthMandate"
];
let req_data = data["Request"];
let res_data = data["Response"];
cy.citForMandatesCallTest(
fixtures.citConfirmBody,
req_data,
res_data,
0,
true,
"automatic",
"setup_mandate",
globalState
);
if (should_continue)
should_continue = utils.should_continue_further(res_data);
});

it("list-mandate-call-test", () => {
cy.listMandateCallTest(globalState);
});

it("Confirm No 3DS MIT", () => {
cy.mitForMandatesCallTest(
fixtures.mitConfirmBody,
7000,
true,
"automatic",
globalState
);
});

it("list-mandate-call-test", () => {
cy.listMandateCallTest(globalState);
});

it("revoke-mandate-call-test", () => {
cy.revokeMandateCallTest(globalState);
});
});
});
8 changes: 2 additions & 6 deletions cypress-tests/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1969,9 +1969,7 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") {
if (response.body.connector === "fiuu") {
expect(response.body.status).to.equal("failed");
} else {
expect(response.body.status).to.equal("succeeded");
}
}
} else {
throw new Error(
`Invalid authentication type ${response.body.authentication_type}`
Expand Down Expand Up @@ -2051,9 +2049,7 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") {
if (response.body.connector === "fiuu") {
expect(response.body.status).to.equal("failed");
} else {
expect(response.body.status).to.equal("succeeded");
}
}
} else {
throw new Error(
`Invalid authentication type ${response.body.authentication_type}`
Expand Down

0 comments on commit 9baa1ef

Please sign in to comment.