mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
54 lines
1.6 KiB
JavaScript
54 lines
1.6 KiB
JavaScript
import * as fixtures from "../../fixtures/imports";
|
|
import State from "../../utils/State";
|
|
import { payment_methods_enabled } from "../PaymentUtils/Commons";
|
|
|
|
let globalState;
|
|
describe("Connector Account Create flow test", () => {
|
|
before("seed global state", () => {
|
|
cy.task("getGlobalState").then((state) => {
|
|
globalState = new State(state);
|
|
});
|
|
});
|
|
|
|
after("flush global state", () => {
|
|
cy.task("setGlobalState", globalState.data);
|
|
});
|
|
|
|
it("connector-create-call-test", () => {
|
|
cy.createConnectorCallTest(
|
|
"payment_processor",
|
|
fixtures.createConnectorBody,
|
|
payment_methods_enabled,
|
|
globalState
|
|
);
|
|
});
|
|
|
|
it("check and create multiple connectors", () => {
|
|
const multiple_connectors = Cypress.env("MULTIPLE_CONNECTORS");
|
|
// multiple_connectors will be undefined if not set in the env
|
|
if (multiple_connectors?.status) {
|
|
// Create multiple connectors based on the count
|
|
// The first connector is already created when creating merchant account, so start from 1
|
|
for (let i = 1; i < multiple_connectors.count; i++) {
|
|
cy.createBusinessProfileTest(
|
|
fixtures.businessProfile.bpCreate,
|
|
globalState,
|
|
"profile" + i
|
|
);
|
|
cy.createConnectorCallTest(
|
|
"payment_processor",
|
|
fixtures.createConnectorBody,
|
|
payment_methods_enabled,
|
|
globalState,
|
|
`profile${i}`,
|
|
`merchantConnector${i}`
|
|
);
|
|
}
|
|
} else {
|
|
cy.log(
|
|
"Multiple connectors not enabled. Skipping creation of multiple profiles and respective MCAs"
|
|
);
|
|
}
|
|
});
|
|
});
|