Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

ci(cypress): skip SingleUse and MultiUse mandate tests for unsupported connectors (#11617)

likhinbopanna0ebae641c8a3
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index eb7f1a3343..eb5432efd4 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -444,6 +444,7 @@ export const CONNECTOR_LISTS = {
"mollie",
"zift",
],
+ MANDATE_ID_TEST: ["airwallex", "payload"],
// Add more exclusion lists
},
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js
index 9f4e4e2dde..879a902a2e 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00009-RefundPayment.cy.js
@@ -934,103 +934,6 @@ describe("Card - Refund flow - No 3DS", () => {
});
});
});
-
- context(
- "Card - Full Refund for Create + Confirm Automatic CIT and MIT payment flow test",
- () => {
- it("CIT for Mandates Call -> MIT for Mandates Call -> MIT for Mandates Call - 2nd Attempt -> Refund Payment -> Sync Refund Payment", () => {
- let shouldContinue = true;
-
- cy.step("CIT for Mandates Call", () => {
- const citData = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MandateMultiUseNo3DSAutoCapture"];
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- citData,
- 6000,
- true,
- "automatic",
- "new_mandate",
- globalState
- );
- if (!utils.should_continue_further(citData)) {
- shouldContinue = false;
- }
- });
-
- cy.step("MIT for Mandates Call", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: MIT for Mandates Call");
- return;
- }
- const mitData = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- mitData,
- 6000,
- true,
- "automatic",
- globalState
- );
- if (!utils.should_continue_further(mitData)) {
- shouldContinue = false;
- }
- });
-
- cy.step("MIT for Mandates Call - 2nd Attempt", () => {
- if (!shouldContinue) {
- cy.task(
- "cli_log",
- "Skipping step: MIT for Mandates Call - 2nd Attempt"
- );
- return;
- }
- const mitData = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- mitData,
- 6000,
- true,
- "automatic",
- globalState
- );
- if (!utils.should_continue_further(mitData)) {
- shouldContinue = false;
- }
- });
-
- cy.step("Refund Payment", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: Refund Payment");
- return;
- }
- const refundData = getConnectorDetails(
- globalState.get("connectorId")
- )["card_pm"]["Refund"];
- cy.refundCallTest(fixtures.refundBody, refundData, globalState);
- if (!utils.should_continue_further(refundData)) {
- shouldContinue = false;
- }
- });
-
- cy.step("Sync Refund Payment", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: Sync Refund Payment");
- return;
- }
- const syncRefundData = getConnectorDetails(
- globalState.get("connectorId")
- )["card_pm"]["SyncRefund"];
- cy.syncRefundCallTest(syncRefundData, globalState);
- });
- });
- }
- );
});
describe("Card - Refund flow - 3DS", () => {
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js
index 6b4dc105fc..16270e3285 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00011-CreateSingleuseMandate.cy.js
@@ -5,10 +5,29 @@ import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
let globalState;
describe("Card - SingleUse Mandates flow test", () => {
- before("seed global state", () => {
- cy.task("getGlobalState").then((state) => {
- globalState = new State(state);
- });
+ before(function () {
+ // Changed to regular function instead of arrow function
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+
+ // Skip running test against a connector that is added in the exclude list
+ if (
+ utils.shouldExcludeConnector(
+ globalState.get("connectorId"),
+ utils.CONNECTOR_LISTS.EXCLUDE.MANDATE_ID_TEST
+ )
+ ) {
+ skip = true;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
});
after("flush global state", () => {
@@ -199,4 +218,146 @@ describe("Card - SingleUse Mandates flow test", () => {
});
}
);
+
+ context(
+ "Card - Recurring mandate with greater mandate amount flow test",
+ () => {
+ let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateSingleUseNo3DSManualCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "manual",
+ "new_mandate",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("cit-capture-call-test", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.captureCallTest(fixtures.captureBody, data, globalState);
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Retrieve payment", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Capture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 60000,
+ true,
+ "manual",
+ globalState
+ );
+ });
+ }
+ );
+
+ context(
+ "Card - NoThreeDS Zero Auth Mandate Create + Confirm Automatic CIT and Single use MIT payment flow test",
+ () => {
+ let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("customer-create-call-test", () => {
+ cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 0,
+ true,
+ "automatic",
+ "setup_mandate",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
+
+ it("retrieve-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+ }
+ );
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js
index c568c08d35..53c80c191b 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00012-CreateMultiuseMandate.cy.js
@@ -5,10 +5,29 @@ import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
let globalState;
describe("Card - MultiUse Mandates flow test", () => {
- before("seed global state", () => {
- cy.task("getGlobalState").then((state) => {
- globalState = new State(state);
- });
+ before(function () {
+ // Changed to regular function instead of arrow function
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+
+ // Skip running test against a connector that is added in the exclude list
+ if (
+ utils.shouldExcludeConnector(
+ globalState.get("connectorId"),
+ utils.CONNECTOR_LISTS.EXCLUDE.MANDATE_ID_TEST
+ )
+ ) {
+ skip = true;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
});
after("flush global state", () => {
@@ -231,4 +250,189 @@ describe("Card - MultiUse Mandates flow test", () => {
});
}
);
+
+ context(
+ "Card - Full Refund for Create + Confirm Automatic CIT and MIT payment flow test",
+ () => {
+ let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("CIT for Mandates Call", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MandateMultiUseNo3DSAutoCapture"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ "new_mandate",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("MIT for Mandates Call", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("MIT for Mandates Call - 2nd Attempt", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Refund Payment", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["Refund"];
+
+ cy.refundCallTest(fixtures.refundBody, data, globalState);
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("Sync Refund Payment", () => {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["SyncRefund"];
+
+ cy.syncRefundCallTest(data, globalState);
+ });
+ }
+ );
+
+ context(
+ "Card - NoThreeDS Zero Auth Mandate Create + Confirm Automatic CIT and Multi use MIT payment flow test",
+ () => {
+ let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
+
+ beforeEach(function () {
+ if (!shouldContinue) {
+ this.skip();
+ }
+ });
+
+ it("Confirm No 3DS CIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+
+ cy.citForMandatesCallTest(
+ fixtures.citConfirmBody,
+ data,
+ 0,
+ true,
+ "automatic",
+ "setup_mandate",
+ globalState
+ );
+
+ if (shouldContinue)
+ shouldContinue = utils.should_continue_further(data);
+ });
+
+ it("retrieve-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["ZeroAuthMandate"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
+
+ it("retrieve-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+
+ it("Confirm No 3DS MIT", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.mitForMandatesCallTest(
+ fixtures.mitConfirmBody,
+ data,
+ 6000,
+ true,
+ "automatic",
+ globalState
+ );
+ });
+
+ it("retrieve-payment-call-test", () => {
+ const data = getConnectorDetails(globalState.get("connectorId"))[
+ "card_pm"
+ ]["MITAutoCapture"];
+
+ cy.retrievePaymentCallTest({ globalState, data });
+ });
+ }
+ );
});
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00013-ListAndRevokeMandate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00013-ListAndRevokeMandate.cy.js
index dba24208b5..1aadd63692 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00013-ListAndRevokeMandate.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00013-ListAndRevokeMandate.cy.js
@@ -5,10 +5,29 @@ import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
let globalState;
describe("Card - List and revoke Mandates flow test", () => {
- before("seed global state", () => {
- cy.task("getGlobalState").then((state) => {
- globalState = new State(state);
- });
+ before(function () {
+ // Changed to regular function instead of arrow function
+ let skip = false;
+
+ cy.task("getGlobalState")
+ .then((state) => {
+ globalState = new State(state);
+
+ // Skip running test against a connector that is added in the exclude list
+ if (
+ utils.shouldExcludeConnector(
+ globalState.get("connectorId"),
+ utils.CONNECTOR_LISTS.EXCLUDE.MANDATE_ID_TEST
+ )
+ ) {
+ skip = true;
+ }
+ })
+ .then(() => {
+ if (skip) {
+ this.skip();
+ }
+ });
});
after("flush global state", () => {
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js
index ca4a48a150..71ed77cc84 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00015-ZeroAuthMandate.cy.js
@@ -15,158 +15,6 @@ describe("Card - SingleUse Mandates flow test", () => {
cy.task("setGlobalState", globalState.data);
});
- context(
- "Card - NoThreeDS Create + Confirm Automatic CIT and Single use MIT payment flow test",
- () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("customer-create-call-test", () => {
- cy.createCustomerCallTest(fixtures.customerCreateBody, globalState);
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["ZeroAuthMandate"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 0,
- true,
- "automatic",
- "setup_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["ZeroAuthMandate"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
- }
- );
- context(
- "Card - NoThreeDS Create + Confirm Automatic CIT and Multi use MIT payment flow test",
- () => {
- let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
-
- beforeEach(function () {
- if (!shouldContinue) {
- this.skip();
- }
- });
-
- it("Confirm No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["ZeroAuthMandate"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 0,
- true,
- "automatic",
- "setup_mandate",
- globalState
- );
-
- if (shouldContinue)
- shouldContinue = utils.should_continue_further(data);
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["ZeroAuthMandate"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- it("Confirm No 3DS MIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- data,
- 6000,
- true,
- "automatic",
- globalState
- );
- });
-
- it("retrieve-payment-call-test", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
- }
- );
-
context("Card - Zero Auth Payment", () => {
let shouldContinue = true; // variable that will be used to skip tests if a previous test fails
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
index 3ce9e9eddd..cebb63b26f 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00023-Variations.cy.js
@@ -700,89 +700,6 @@ describe("Corner cases", () => {
});
});
- context("[Payment] Recurring mandate with greater mandate amount", () => {
- before("seed global state", () => {
- cy.task("getGlobalState").then((state) => {
- globalState = new State(state);
- });
- });
-
- after("flush global state", () => {
- cy.task("setGlobalState", globalState.data);
- });
-
- it("No 3DS CIT -> cit-capture-call-test -> Retrieve payment -> Confirm No 3DS MIT", () => {
- let shouldContinue = true;
-
- cy.step("No 3DS CIT", () => {
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MandateSingleUseNo3DSManualCapture"];
-
- cy.citForMandatesCallTest(
- fixtures.citConfirmBody,
- data,
- 6000,
- true,
- "manual",
- "new_mandate",
- globalState
- );
-
- if (!utils.should_continue_further(data)) {
- shouldContinue = false;
- }
- });
-
- cy.step("cit-capture-call-test", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: cit-capture-call-test");
- return;
- }
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.captureCallTest(fixtures.captureBody, data, globalState);
-
- if (!utils.should_continue_further(data)) {
- shouldContinue = false;
- }
- });
-
- cy.step("Retrieve payment", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: Retrieve payment");
- return;
- }
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["Capture"];
-
- cy.retrievePaymentCallTest({ globalState, data });
- });
-
- cy.step("Confirm No 3DS MIT", () => {
- if (!shouldContinue) {
- cy.task("cli_log", "Skipping step: Confirm No 3DS MIT");
- return;
- }
- const data = getConnectorDetails(globalState.get("connectorId"))[
- "card_pm"
- ]["MITAutoCapture"];
-
- cy.mitForMandatesCallTest(
- fixtures.mitConfirmBody,
- data,
- 60000,
- true,
- "manual",
- globalState
- );
- });
- });
- });
-
context("Card-NoThreeDS fail payment flow test", () => {
before("seed global state", () => {
cy.task("getGlobalState").then((state) => {