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

fix(ci): skip unnecessary waits in Cypress mock server replay mode (#13323)

venkatakarthikm-makerf156cd054a77
diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.yml
index 76a3feb78d..ccec013635 100644
--- a/.github/workflows/cypress-tests-runner.yml
+++ b/.github/workflows/cypress-tests-runner.yml
@@ -17,8 +17,7 @@ concurrency:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
- MANDATORY_PAYMENTS_CONNECTORS_BATCH_1: "stripe authorizedotnet"
- MANDATORY_PAYMENTS_CONNECTORS_BATCH_2: "adyen nexixpay finix"
+ MANDATORY_PAYMENTS_CONNECTORS_BATCH_1: "stripe"
OPTIONAL_PAYMENTS_CONNECTORS_BATCH_1: "worldpay braintree cryptopay paypal worldpayxml volt"
OPTIONAL_PAYMENTS_CONNECTORS_BATCH_2: "gigadat checkout redsys novalnet noon"
OPTIONAL_PAYMENTS_CONNECTORS_BATCH_3: "loonio zift airwallex fiuu"
@@ -27,9 +26,10 @@ env:
EXTENDED_PAYMENTS_CONNECTORS_BATCH_1: "bluesnap gigadat loonio nmi"
EXTENDED_PAYMENTS_CONNECTORS_BATCH_2: "paypal redsys zift"
EXTENDED_PAYOUTS_CONNECTORS: "adyenplatform wise"
- MOCK_PAYMENTS_CONNECTORS_BATCH_1: "gigadat zift loonio redsys worldpayxml cybersource"
- MOCK_PAYMENTS_CONNECTORS_BATCH_2: "braintree nmi calida adyen peachpayments novalnet"
- MOCK_PAYMENTS_CONNECTORS_BATCH_3: "checkout cashtocode fiuu"
+ MOCK_PAYMENTS_CONNECTORS_BATCH_1: "gigadat zift loonio payload redsys worldpayxml"
+ MOCK_PAYMENTS_CONNECTORS_BATCH_2: "cybersource braintree nmi calida adyen peachpayments"
+ MOCK_PAYMENTS_CONNECTORS_BATCH_3: "novalnet checkout authorizedotnet cashtocode fiuu nexixpay"
+ MOCK_PAYMENTS_CONNECTORS_BATCH_4: "finix"
MOCK_PAYOUTS_CONNECTORS: "adyenplatform wise"
RUST_BACKTRACE: short
RUSTUP_MAX_RETRIES: 10
@@ -220,13 +220,6 @@ jobs:
"report_artifact_name": "cypress-mandatory-test-results-batch-1",
"server_logs_artifact": "mandatory-server-logs-batch-1"
},
- {
- "name": "batch-2",
- "connectors": "'"${MANDATORY_PAYMENTS_CONNECTORS_BATCH_2}"'",
- "parallel": 3,
- "report_artifact_name": "cypress-mandatory-test-results-batch-2",
- "server_logs_artifact": "mandatory-server-logs-batch-2"
- },
{
"name": "platform",
"connectors": "",
@@ -802,6 +795,15 @@ jobs:
"parallel": 3,
"report_artifact_name": "cypress-mock-test-results-payments-batch-3",
"server_logs_artifact": "mock-server-logs-payments-batch-3"
+ },
+ {
+ "name": "mock-payments-batch-4",
+ "payments_connectors": "'"${MOCK_PAYMENTS_CONNECTORS_BATCH_4}"'",
+ "payouts_connectors": "",
+ "platform_connectors": "",
+ "parallel": 3,
+ "report_artifact_name": "cypress-mock-test-results-payments-batch-4",
+ "server_logs_artifact": "mock-server-logs-payments-batch-4"
}
]
}'
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Payload.js b/cypress-tests/cypress/e2e/configs/Payment/Payload.js
index 4827dcdfba..9868798fb1 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Payload.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Payload.js
@@ -780,6 +780,7 @@ export const connectorDetails = {
STATUS: true,
TIMEOUT: DUPLICATION_TIMEOUT,
},
+ LOCAL_VAULT_REQUIRED: true,
},
Request: {
amount: 6540,
diff --git a/cypress-tests/cypress/e2e/configs/Payment/Utils.js b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
index 8bf666617d..ee9a06552e 100644
--- a/cypress-tests/cypress/e2e/configs/Payment/Utils.js
+++ b/cypress-tests/cypress/e2e/configs/Payment/Utils.js
@@ -517,6 +517,7 @@ export const CONNECTOR_LISTS = {
"loonio",
"mifinity",
"nexinets",
+ "nexixpay",
"nmi",
"noon",
"novalnet",
diff --git a/cypress-tests/cypress/e2e/spec/Payment/00-CoreFlows.cy.js b/cypress-tests/cypress/e2e/spec/Payment/00-CoreFlows.cy.js
index dfd822e2fa..fad478a829 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/00-CoreFlows.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/00-CoreFlows.cy.js
@@ -5,7 +5,6 @@ import {
payment_methods_enabled,
connectorDetails as paymentCommonDetails,
} from "../../configs/Payment/Commons";
-
const pmCollectLinkConnectorDetails = paymentCommonDetails.pm_collect_link;
let globalState;
@@ -215,7 +214,6 @@ describe("Core flows", () => {
});
it("Confirm payment after session expiry - should fail with ClientSecretExpired", () => {
- // eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(SESSION_EXPIRY_WAIT);
const data = getConnectorDetails(globalState.get("connectorId"))[
"card_pm"
diff --git a/cypress-tests/cypress/e2e/spec/Payment/33-ManualRetry.cy.js b/cypress-tests/cypress/e2e/spec/Payment/33-ManualRetry.cy.js
index 958b208f53..919a101523 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/33-ManualRetry.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/33-ManualRetry.cy.js
@@ -1,7 +1,6 @@
import * as fixtures from "../../../fixtures/imports";
import State from "../../../utils/State";
import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
-
const MANUAL_RETRY_EXPIRATION = 35000;
describe("Manual Retry Tests", () => {
@@ -224,7 +223,6 @@ describe("Manual Retry Tests", () => {
});
it("Retry Confirm after cutoff is expired (Should Throw Error)", () => {
- // wait for 35 seconds
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(MANUAL_RETRY_EXPIRATION);
const data = getConnectorDetails(globalState.get("connectorId"))[
@@ -292,7 +290,6 @@ describe("Manual Retry Tests", () => {
});
it("First Confirm after Manual Retry Cutoff (Should Succeed)", () => {
- // wait for 35 seconds
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(MANUAL_RETRY_EXPIRATION);
diff --git a/cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js b/cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js
index bb22ef38b4..48b820416e 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/40-ExternalVault.cy.js
@@ -1,6 +1,7 @@
import * as fixtures from "../../../fixtures/imports";
import State from "../../../utils/State";
import getConnectorDetails, * as utils from "../../configs/Payment/Utils";
+import { isMockServer } from "../../../support/mitmProxy";
let globalState;
@@ -86,7 +87,8 @@ describe("External Vault (VGS) - Connector Integration Tests", () => {
cy.task("cli_log", "Skipping step: Retrieve Payment after Confirm");
return;
}
- cy.wait(10000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(10000);
const createConfirmData = getConnectorDetails(
globalState.get("connectorId")
)["card_pm"]["SaveCardUseNo3DSAutoCapture"];
@@ -180,7 +182,8 @@ describe("External Vault (VGS) - Connector Integration Tests", () => {
cy.task("cli_log", "Skipping step: Retrieve Payment after Confirm");
return;
}
- cy.wait(10000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(10000);
const createConfirmData = getConnectorDetails(
globalState.get("connectorId")
)["card_pm"]["SaveCardUseNo3DSAutoCapture"];
@@ -247,7 +250,8 @@ describe("External Vault (VGS) - Connector Integration Tests", () => {
);
return;
}
- cy.wait(10000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(10000);
const saveCardConfirmData = getConnectorDetails(
globalState.get("connectorId")
)["card_pm"]["SaveCardUseNo3DSManualCapture"];
@@ -279,7 +283,8 @@ describe("External Vault (VGS) - Connector Integration Tests", () => {
cy.task("cli_log", "Skipping step: Retrieve Payment after Capture");
return;
}
- cy.wait(10000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(10000);
const captureData = getConnectorDetails(
globalState.get("connectorId")
)["card_pm"]["Capture"];
@@ -324,7 +329,8 @@ describe("External Vault (VGS) - Connector Integration Tests", () => {
cy.task("cli_log", "Skipping step: Retrieve Payment after Confirm");
return;
}
- cy.wait(10000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(10000);
const createConfirmData = getConnectorDetails(
globalState.get("connectorId")
)["card_pm"]["SaveCardUseNo3DSAutoCaptureOffSession"];
diff --git a/cypress-tests/cypress/e2e/spec/Payment/52-AlternativePayments.cy.js b/cypress-tests/cypress/e2e/spec/Payment/52-AlternativePayments.cy.js
index 2434fce7b7..346e35e011 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/52-AlternativePayments.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/52-AlternativePayments.cy.js
@@ -2,6 +2,7 @@ import * as fixtures from "../../../fixtures/imports";
import State from "../../../utils/State";
import getConnectorDetails from "../../configs/Payment/Utils";
import * as utils from "../../configs/Payment/Utils";
+import { isMockServer } from "../../../support/mitmProxy";
let globalState;
@@ -166,7 +167,8 @@ describe("Airwallex Alternative Payments", () => {
"wallet_pm"
]["Skrill"];
- cy.wait(5000);
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(5000);
cy.retrievePaymentCallTest({
globalState,
data,
diff --git a/cypress-tests/cypress/e2e/spec/Payment/52-ClientSessionValidation.cy.js b/cypress-tests/cypress/e2e/spec/Payment/52-ClientSessionValidation.cy.js
index 82aab3b4fe..7f47a73a9a 100644
--- a/cypress-tests/cypress/e2e/spec/Payment/52-ClientSessionValidation.cy.js
+++ b/cypress-tests/cypress/e2e/spec/Payment/52-ClientSessionValidation.cy.js
@@ -4,6 +4,7 @@ import getConnectorDetails, {
CONNECTOR_LISTS,
} from "../../configs/Payment/Utils";
import * as utils from "../../configs/Payment/Utils";
+import { isMockServer } from "../../../support/mitmProxy";
let globalState;
@@ -210,7 +211,8 @@ describe("Client Session Validation", () => {
});
it("Wait for Redis session TTL to expire", () => {
- cy.wait(61000); // Wait 61 seconds for Redis TTL to expire
+ // eslint-disable-next-line cypress/no-unnecessary-waiting
+ if (!isMockServer()) cy.wait(61000); // Wait 61 seconds for Redis TTL to expire
});
it("Confirm with expired sdk_authorization - expect 401", () => {
diff --git a/cypress-tests/cypress/utils/featureFlags.js b/cypress-tests/cypress/utils/featureFlags.js
index 41dd65a544..ca4a5fb0c3 100644
--- a/cypress-tests/cypress/utils/featureFlags.js
+++ b/cypress-tests/cypress/utils/featureFlags.js
@@ -196,7 +196,7 @@ export function determineConnectorConfig(config) {
}
export function execConfig(configs) {
- if (configs?.DELAY?.STATUS) {
+ if (configs?.DELAY?.STATUS && String(Cypress.env("MOCK_SERVER")) !== "true") {
cy.wait(configs.DELAY.TIMEOUT);
}