Skip to content
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

ci(cypress): Added Config Testcases #6622

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,58 @@ 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);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe("Connector Agnostic Tests", () => {

it("Create Business Profile", () => {
cy.createBusinessProfileTest(
fixtures.createBusinessProfile,
fixtures.businessProfile.bpCreate,
globalState
);
});
Expand Down Expand Up @@ -85,7 +85,7 @@ describe("Connector Agnostic Tests", () => {

it("Create Business Profile", () => {
cy.createBusinessProfileTest(
fixtures.createBusinessProfile,
fixtures.businessProfile.bpCreate,
globalState
);
});
Expand All @@ -101,8 +101,12 @@ describe("Connector Agnostic Tests", () => {

it("Enable Connector Agnostic for Business Profile", () => {
cy.UpdateBusinessProfileTest(
fixtures.updateBusinessProfile,
true,
fixtures.businessProfile.bpUpdate,
true, // is_connector_agnostic_enabled
false, // collect_billing_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector
globalState
);
});
Expand Down Expand Up @@ -141,7 +145,10 @@ describe("Connector Agnostic Tests", () => {
});

it("Create Business Profile", () => {
cy.createBusinessProfileTest(fixtures.createBusinessProfile, globalState);
cy.createBusinessProfileTest(
fixtures.businessProfile.bpCreate,
globalState
);
});

it("connector-create-call-test", () => {
Expand All @@ -159,8 +166,12 @@ describe("Connector Agnostic Tests", () => {

it("Enable Connector Agnostic for Business Profile", () => {
cy.UpdateBusinessProfileTest(
fixtures.updateBusinessProfile,
true,
fixtures.businessProfile.bpUpdate,
true, // is_connector_agnostic_enabled
false, // collect_billing_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector
globalState
);
});
Expand Down Expand Up @@ -205,7 +216,10 @@ describe("Connector Agnostic Tests", () => {
});

it("Create Business Profile", () => {
cy.createBusinessProfileTest(fixtures.createBusinessProfile, globalState);
cy.createBusinessProfileTest(
fixtures.businessProfile.bpCreate,
globalState
);
});

it("connector-create-call-test", () => {
Expand All @@ -219,8 +233,12 @@ describe("Connector Agnostic Tests", () => {

it("Enable Connector Agnostic for Business Profile", () => {
cy.UpdateBusinessProfileTest(
fixtures.updateBusinessProfile,
true,
fixtures.businessProfile.bpUpdate,
true, // is_connector_agnostic_enabled
false, // collect_billing_address_from_wallet_connector
false, // collect_shipping_address_from_wallet_connector
false, // always_collect_billing_address_from_wallet_connector
false, // always_collect_shipping_address_from_wallet_connector
globalState
);
});
Expand Down
Loading
Loading