ci(cypress): Add list and revoke for zero auth mandate payments (#6569)

This commit is contained in:
Gnanasundari24
2024-11-26 13:50:33 +05:30
committed by GitHub
parent acb30ef6d1
commit 9baa1ef654
2 changed files with 54 additions and 7 deletions

View File

@ -4,7 +4,7 @@ import getConnectorDetails, * as utils from "../PaymentUtils/Utils";
let globalState; let globalState;
describe("Card - SingleUse Mandates flow test", () => { describe("Card - List and revoke Mandates flow test", () => {
before("seed global state", () => { before("seed global state", () => {
cy.task("getGlobalState").then((state) => { cy.task("getGlobalState").then((state) => {
globalState = new State(state); globalState = new State(state);
@ -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);
});
});
}); });

View File

@ -1969,9 +1969,7 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") { } else if (response.body.authentication_type === "no_three_ds") {
if (response.body.connector === "fiuu") { if (response.body.connector === "fiuu") {
expect(response.body.status).to.equal("failed"); expect(response.body.status).to.equal("failed");
} else { }
expect(response.body.status).to.equal("succeeded");
}
} else { } else {
throw new Error( throw new Error(
`Invalid authentication type ${response.body.authentication_type}` `Invalid authentication type ${response.body.authentication_type}`
@ -2051,9 +2049,7 @@ Cypress.Commands.add(
} else if (response.body.authentication_type === "no_three_ds") { } else if (response.body.authentication_type === "no_three_ds") {
if (response.body.connector === "fiuu") { if (response.body.connector === "fiuu") {
expect(response.body.status).to.equal("failed"); expect(response.body.status).to.equal("failed");
} else { }
expect(response.body.status).to.equal("succeeded");
}
} else { } else {
throw new Error( throw new Error(
`Invalid authentication type ${response.body.authentication_type}` `Invalid authentication type ${response.body.authentication_type}`