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(cypress): validate false positives and fix PML tests (#5293)

Pa1NarK68adda036d48
diff --git a/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js b/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js
index 3728377409..aa28e62d7e 100644
--- a/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js
+++ b/cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js
@@ -1,18 +1,17 @@
import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
import createConnectorBody from "../../fixtures/create-connector-body.json";
-import getConnectorDetails from "../PaymentMethodListUtils/utils";
import merchantCreateBody from "../../fixtures/merchant-create-body.json";
-import * as utils from "../PaymentMethodListUtils/Utils";
+import State from "../../utils/State";
import {
+ bank_redirect_ideal_and_credit_enabled,
+ bank_redirect_ideal_enabled,
card_credit_enabled,
card_credit_enabled_in_US,
card_credit_enabled_in_USD,
- bank_redirect_ideal_enabled,
- bank_redirect_ideal_and_credit_enabled,
create_payment_body_with_currency,
create_payment_body_with_currency_country,
} from "../PaymentMethodListUtils/Commons";
-import State from "../../utils/State";
+import getConnectorDetails from "../PaymentMethodListUtils/Utils";
// Testing for scenario:
// MCA1 -> Stripe configured with ideal = { country = "NL", currency = "EUR" }
diff --git a/cypress-tests/cypress/e2e/PaymentUtils/Utils.js b/cypress-tests/cypress/e2e/PaymentUtils/Utils.js
index b0fe4b9d13..f57f7b4ba0 100644
--- a/cypress-tests/cypress/e2e/PaymentUtils/Utils.js
+++ b/cypress-tests/cypress/e2e/PaymentUtils/Utils.js
@@ -101,6 +101,10 @@ export function defaultErrorHandler(response, response_data) {
response_data = updateDefaultStatusCode();
}
+ if (response_data.status === 200) {
+ throw new Error("Expecting valid response but got an error response");
+ }
+
expect(response.body).to.have.property("error");
for (const key in response_data.body.error) {
expect(response_data.body.error[key]).to.equal(response.body.error[key]);
diff --git a/cypress-tests/cypress/support/commands.js b/cypress-tests/cypress/support/commands.js
index 3a903be1e7..953456a471 100644
--- a/cypress-tests/cypress/support/commands.js
+++ b/cypress-tests/cypress/support/commands.js
@@ -99,7 +99,8 @@ Cypress.Commands.add(
JSON.stringify(jsonContent),
connectorName
);
- createConnectorBody.connector_account_details = authDetails;
+ createConnectorBody.connector_account_details =
+ authDetails.connector_account_details;
cy.request({
method: "POST",
url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
diff --git a/cypress-tests/package-lock.json b/cypress-tests/package-lock.json
index f73474f6e2..6628a70bf4 100644
--- a/cypress-tests/package-lock.json
+++ b/cypress-tests/package-lock.json
@@ -12,7 +12,7 @@
"prettier": "^3.3.2"
},
"devDependencies": {
- "cypress": "^13.12.0",
+ "cypress": "^13.13.0",
"jsqr": "^1.4.0"
}
},
@@ -584,9 +584,9 @@
}
},
"node_modules/cypress": {
- "version": "13.12.0",
- "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.12.0.tgz",
- "integrity": "sha512-udzS2JilmI9ApO/UuqurEwOvThclin5ntz7K0BtnHBs+tg2Bl9QShLISXpSEMDv/u8b6mqdoAdyKeZiSqKWL8g==",
+ "version": "13.13.0",
+ "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.13.0.tgz",
+ "integrity": "sha512-ou/MQUDq4tcDJI2FsPaod2FZpex4kpIK43JJlcBgWrX8WX7R/05ZxGTuxedOuZBfxjZxja+fbijZGyxiLP6CFA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
@@ -630,7 +630,7 @@
"request-progress": "^3.0.0",
"semver": "^7.5.3",
"supports-color": "^8.1.1",
- "tmp": "~0.2.1",
+ "tmp": "~0.2.3",
"untildify": "^4.0.0",
"yauzl": "^2.10.0"
},
diff --git a/cypress-tests/package.json b/cypress-tests/package.json
index b2693e9d1f..2eb58696d8 100644
--- a/cypress-tests/package.json
+++ b/cypress-tests/package.json
@@ -14,7 +14,7 @@
"author": "",
"license": "ISC",
"devDependencies": {
- "cypress": "^13.10.0",
+ "cypress": "^13.13.0",
"jsqr": "^1.4.0"
},
"dependencies": {