mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 03:13:56 +08:00
refactor(cypress): make connector_label configurable in cypress (#5547)
This commit is contained in:
@ -48,7 +48,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -59,7 +60,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -126,7 +128,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -137,7 +140,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled_in_USD,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -204,7 +208,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled_in_US,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -215,7 +220,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled_in_US,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -282,7 +288,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -293,7 +300,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_enabled,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -362,7 +370,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -373,7 +382,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_and_credit_enabled,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -441,7 +451,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -452,7 +463,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -519,7 +531,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
bank_redirect_ideal_enabled,
|
||||
globalState,
|
||||
"stripe"
|
||||
"stripe",
|
||||
"stripe_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
@ -530,7 +543,8 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
|
||||
createConnectorBody,
|
||||
card_credit_enabled,
|
||||
globalState,
|
||||
"cybersource"
|
||||
"cybersource",
|
||||
"cybersource_US_default"
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ function normalise(input) {
|
||||
bankofamerica: "Bank of America",
|
||||
cybersource: "Cybersource",
|
||||
paypal: "Paypal",
|
||||
wellsfargo: "Wellsfargo"
|
||||
wellsfargo: "Wellsfargo",
|
||||
// Add more known exceptions here
|
||||
};
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ const connectorDetails = {
|
||||
stripe: stripeConnectorDetails,
|
||||
trustpay: trustpayConnectorDetails,
|
||||
datatrans: datatransConnectorDetails,
|
||||
wellsfargo: wellsfargoConnectorDetails
|
||||
wellsfargo: wellsfargoConnectorDetails,
|
||||
};
|
||||
|
||||
export default function getConnectorDetails(connectorId) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,7 @@ function normalise(input) {
|
||||
const exceptions = {
|
||||
adyenplatform: "Adyenplatform",
|
||||
wise: "Wise",
|
||||
wellsfargo: "Wellsfargo"
|
||||
wellsfargo: "Wellsfargo",
|
||||
// Add more known exceptions here
|
||||
};
|
||||
|
||||
|
||||
@ -79,7 +79,6 @@ Cypress.Commands.add("merchantRetrieveCall", (globalState) => {
|
||||
|
||||
expect(response.headers["content-type"]).to.include("application/json");
|
||||
expect(response.body.merchant_id).to.equal(merchant_id);
|
||||
expect(response.body.amount).to.equal(globalState.get("paymentAmount"));
|
||||
expect(response.body.payment_response_hash_key).to.not.be.empty;
|
||||
expect(response.body.publishable_key).to.not.be.empty;
|
||||
expect(response.body.default_profile).to.not.be.empty;
|
||||
@ -282,11 +281,13 @@ Cypress.Commands.add(
|
||||
createConnectorBody,
|
||||
payment_methods_enabled,
|
||||
globalState,
|
||||
connectorName
|
||||
connectorName,
|
||||
connectorLabel
|
||||
) => {
|
||||
const merchantId = globalState.get("merchantId");
|
||||
createConnectorBody.connector_type = connectorType;
|
||||
createConnectorBody.connector_name = connectorName;
|
||||
createConnectorBody.connector_label = connectorLabel;
|
||||
createConnectorBody.payment_methods_enabled = payment_methods_enabled;
|
||||
// readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
|
||||
// it is best to use then() to handle the response within the same block of code
|
||||
|
||||
@ -295,7 +295,11 @@ function threeDsRedirection(redirection_url, expected_url, connectorId) {
|
||||
cy.get('input[type="password"]').type("password");
|
||||
cy.get("#buttonSubmit").click();
|
||||
});
|
||||
} else if (connectorId === "bankofamerica" || connectorId === "cybersource" || connectorId === "wellsfargo"){
|
||||
} else if (
|
||||
connectorId === "bankofamerica" ||
|
||||
connectorId === "cybersource" ||
|
||||
connectorId === "wellsfargo"
|
||||
) {
|
||||
cy.get("iframe", { timeout: TIMEOUT })
|
||||
.its("0.contentDocument.body")
|
||||
.within((body) => {
|
||||
|
||||
Reference in New Issue
Block a user