Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(cypress): Trustpay collection fix #4410

Open
wants to merge 14 commits into
base: refactor-cypress-for-more-control
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion cypress-tests/.gitignore
@@ -1,2 +1,2 @@
creds.json
screenshots
screenshots
2 changes: 1 addition & 1 deletion cypress-tests/cypress.env.json
@@ -1 +1 @@
{}
{}
@@ -1,5 +1,5 @@
import merchantCreateBody from "../../fixtures/merchant-create-body.json";
import apiKeyCreateBody from "../../fixtures/create-api-key-body.json";
import merchantCreateBody from "../../fixtures/merchant-create-body.json";
import State from "../../utils/State";

let globalState;
Expand Down
@@ -1,8 +1,8 @@
import createPaymentBody from "../../fixtures/create-payment-body.json";
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
import confirmBody from "../../fixtures/confirm-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
import getConnectorDetails from "../ConnectorUtils/utils";

let globalState;

Expand Down
@@ -1,7 +1,7 @@
import createPaymentBody from "../../fixtures/create-payment-body.json";
import confirmBody from "../../fixtures/confirm-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
import getConnectorDetails from "../ConnectorUtils/utils";

let globalState;

Expand Down
@@ -1,9 +1,9 @@
import createPaymentBody from "../../fixtures/create-payment-body.json";
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
import captureBody from "../../fixtures/capture-flow-body.json";
import confirmBody from "../../fixtures/confirm-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";
import createConfirmPaymentBody from "../../fixtures/create-confirm-body.json";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
import captureBody from "../../fixtures/capture-flow-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";

let globalState;

Expand All @@ -27,7 +27,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
context("payment Create and Confirm", () => {

it("create-payment-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.createPaymentIntentTest(createPaymentBody, det, "no_three_ds", "manual", globalState);
});

Expand All @@ -37,7 +37,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {

it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.confirmCallTest(confirmBody, det, true, globalState);
});
Expand All @@ -47,7 +47,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("capture-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.captureCallTest(captureBody, 6500, det.paymentSuccessfulStatus, globalState);
});
Expand All @@ -61,7 +61,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
context("Payment Create+Confirm", () => {
it("create+confirm-payment-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.createConfirmPaymentTest(createConfirmPaymentBody, det, "no_three_ds", "manual", globalState);
});
Expand All @@ -71,7 +71,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("capture-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.captureCallTest(captureBody, 6540, det.paymentSuccessfulStatus, globalState);
});
Expand All @@ -89,7 +89,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
context("payment Create and Payment Confirm", () => {

it("create-payment-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.createPaymentIntentTest(createPaymentBody, det, "no_three_ds", "manual", globalState);
});

Expand All @@ -99,7 +99,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {

it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.confirmCallTest(confirmBody, det, true, globalState);
});
Expand All @@ -109,7 +109,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("capture-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.captureCallTest(captureBody, 100, det.paymentSuccessfulStatus, globalState);
});

Expand All @@ -121,7 +121,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
context("payment + Confirm", () => {
it("create+confirm-payment-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.createConfirmPaymentTest(createConfirmPaymentBody, det, "no_three_ds", "manual", globalState);
});
Expand All @@ -131,7 +131,7 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("capture-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.captureCallTest(captureBody, 5000, det.paymentSuccessfulStatus, globalState);
});
Expand Down
29 changes: 16 additions & 13 deletions cypress-tests/cypress/e2e/ConnectorTest/00006-VoidPayment.cy.js
@@ -1,12 +1,12 @@
import createPaymentBody from "../../fixtures/create-payment-body.json";
import confirmBody from "../../fixtures/confirm-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";
import State from "../../utils/State";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import voidBody from "../../fixtures/void-payment-body.json";
import State from "../../utils/State";
import getConnectorDetails from "../ConnectorUtils/utils";

let globalState;

describe("Card - NoThreeDS Manual payment flow test", () => {
describe("Card - NoThreeDS Manual payment void flow test", () => {

before("seed global state", () => {

Expand All @@ -21,9 +21,9 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
cy.task('setGlobalState', globalState.data);
})

context("Card - void payment in Requires_capture state flow test", () => {
context("Card - void payment in requires_capture state flow test", () => {
it("create-payment-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.createPaymentIntentTest(createPaymentBody, det, "no_three_ds", "manual", globalState);
});

Expand All @@ -33,17 +33,18 @@ describe("Card - NoThreeDS Manual payment flow test", () => {

it("confirm-call-test", () => {
console.log("confirm -> " + globalState.get("connectorId"));
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
console.log("det -> " + det.card);
cy.confirmCallTest(confirmBody, det, true, globalState);
});

it("void-call-test", () => {
cy.voidCallTest(voidBody, globalState);
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.voidCallTest(voidBody, det, globalState);
});
});

context("Card - void payment in Requires_payment_method state flow test", () => {
context("Card - void payment in requires_payment_method state flow with auto confirm test", () => {
it("create-payment-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
cy.createPaymentIntentTest(createPaymentBody, det, "no_three_ds", "manual", globalState);
Expand All @@ -54,13 +55,14 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("void-call-test", () => {
cy.voidCallTest(voidBody, globalState);
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
cy.voidCallTest(voidBody, det, globalState);
});
});

context("Card - void payment in Requires_payment_method state flow test", () => {
context("Card - void payment in requires_payment_method state flow test", () => {
it("create-payment-call-test", () => {
let det = getConnectorDetails(globalState.get("connectorId"))["No3DS"];
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.createPaymentIntentTest(createPaymentBody, det, "no_three_ds", "manual", globalState);
});

Expand All @@ -76,7 +78,8 @@ describe("Card - NoThreeDS Manual payment flow test", () => {
});

it("void-call-test", () => {
cy.voidCallTest(voidBody, globalState);
let det = getConnectorDetails(globalState.get("connectorId"))["No3DSManual"];
cy.voidCallTest(voidBody, det, globalState);
});
});
});
@@ -1,7 +1,7 @@
import createPaymentBody from "../../fixtures/create-payment-body.json";
import confirmBody from "../../fixtures/confirm-body.json";
import getConnectorDetails from "../ConnectorUtils/utils";
import createPaymentBody from "../../fixtures/create-payment-body.json";
import State from "../../utils/State";
import getConnectorDetails from "../ConnectorUtils/utils";

let globalState;

Expand Down