Skip to content

Commit 7743255

Browse files
authored
refactor(cypress): pass connector_type externally (#5522)
1 parent 9e358e4 commit 7743255

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

cypress-tests/cypress/e2e/PaymentMethodListTest/00000-PaymentMethodListTests.cy.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
4444
// stripe connector create with ideal enabled
4545
it("connector-create-call-test", () => {
4646
cy.createNamedConnectorCallTest(
47+
"payment_processor",
4748
createConnectorBody,
4849
bank_redirect_ideal_enabled,
4950
globalState,
@@ -54,6 +55,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
5455
// cybersource connector create with card credit enabled
5556
it("connector-create-call-test", () => {
5657
cy.createNamedConnectorCallTest(
58+
"payment_processor",
5759
createConnectorBody,
5860
card_credit_enabled,
5961
globalState,
@@ -120,6 +122,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
120122
// stripe connector create with ideal enabled
121123
it("connector-create-call-test", () => {
122124
cy.createNamedConnectorCallTest(
125+
"payment_processor",
123126
createConnectorBody,
124127
bank_redirect_ideal_enabled,
125128
globalState,
@@ -130,6 +133,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
130133
// cybersource connector create with card credit enabled in USD
131134
it("connector-create-call-test", () => {
132135
cy.createNamedConnectorCallTest(
136+
"payment_processor",
133137
createConnectorBody,
134138
card_credit_enabled_in_USD,
135139
globalState,
@@ -196,6 +200,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
196200
// stripe connector create with credit enabled for US
197201
it("connector-create-call-test", () => {
198202
cy.createNamedConnectorCallTest(
203+
"payment_processor",
199204
createConnectorBody,
200205
card_credit_enabled_in_US,
201206
globalState,
@@ -206,6 +211,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
206211
// cybersource connector create with card credit enabled in US
207212
it("connector-create-call-test", () => {
208213
cy.createNamedConnectorCallTest(
214+
"payment_processor",
209215
createConnectorBody,
210216
card_credit_enabled_in_US,
211217
globalState,
@@ -272,6 +278,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
272278
// stripe connector create with ideal enabled
273279
it("connector-create-call-test", () => {
274280
cy.createNamedConnectorCallTest(
281+
"payment_processor",
275282
createConnectorBody,
276283
bank_redirect_ideal_enabled,
277284
globalState,
@@ -282,6 +289,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
282289
// cybersource connector create with ideal enabled
283290
it("connector-create-call-test", () => {
284291
cy.createNamedConnectorCallTest(
292+
"payment_processor",
285293
createConnectorBody,
286294
bank_redirect_ideal_enabled,
287295
globalState,
@@ -350,6 +358,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
350358
// stripe connector create with card credit enabled
351359
it("connector-create-call-test", () => {
352360
cy.createNamedConnectorCallTest(
361+
"payment_processor",
353362
createConnectorBody,
354363
card_credit_enabled,
355364
globalState,
@@ -360,6 +369,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
360369
// cybersource connector create with card credit and ideal enabled
361370
it("connector-create-call-test", () => {
362371
cy.createNamedConnectorCallTest(
372+
"payment_processor",
363373
createConnectorBody,
364374
bank_redirect_ideal_and_credit_enabled,
365375
globalState,
@@ -427,16 +437,18 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
427437
// stripe connector create with card credit enabled
428438
it("connector-create-call-test", () => {
429439
cy.createNamedConnectorCallTest(
440+
"payment_processor",
430441
createConnectorBody,
431442
card_credit_enabled,
432443
globalState,
433444
"stripe"
434445
);
435446
});
436447

437-
// cybersource connector create with card credit
448+
// cybersource connector create with card credit
438449
it("connector-create-call-test", () => {
439450
cy.createNamedConnectorCallTest(
451+
"payment_processor",
440452
createConnectorBody,
441453
card_credit_enabled,
442454
globalState,
@@ -503,6 +515,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
503515
// stripe connector create with ideal enabled
504516
it("connector-create-call-test", () => {
505517
cy.createNamedConnectorCallTest(
518+
"payment_processor",
506519
createConnectorBody,
507520
bank_redirect_ideal_enabled,
508521
globalState,
@@ -513,6 +526,7 @@ describe("Payment Method list using Constraint Graph flow tests", () => {
513526
// cybersource connector create with card credit enabled
514527
it("connector-create-call-test", () => {
515528
cy.createNamedConnectorCallTest(
529+
"payment_processor",
516530
createConnectorBody,
517531
card_credit_enabled,
518532
globalState,

cypress-tests/cypress/e2e/PaymentTest/00002-ConnectorCreate.cy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ describe("Connector Account Create flow test", () => {
1616

1717
it("connector-create-call-test", () => {
1818
cy.createConnectorCallTest(
19+
"payment_processor",
1920
fixtures.createConnectorBody,
2021
payment_methods_enabled,
2122
globalState

cypress-tests/cypress/e2e/PayoutTest/00002-ConnectorCreate.cy.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ describe("Connector Account Create flow test", () => {
1414
});
1515

1616
it("connector-create-call-test", () => {
17-
cy.createPayoutConnectorCallTest(fixtures.createConnectorBody, globalState);
17+
cy.createPayoutConnectorCallTest(
18+
"payout_processor",
19+
fixtures.createConnectorBody,
20+
globalState
21+
);
1822
});
1923
});

cypress-tests/cypress/fixtures/create-connector-body.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"connector_type": "fiz_operations",
32
"connector_name": "stripe",
43
"business_country": "US",
54
"business_label": "default",

cypress-tests/cypress/support/commands.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ Cypress.Commands.add("apiKeyCreateTest", (apiKeyCreateBody, globalState) => {
8383
Cypress.Commands.add(
8484
"createNamedConnectorCallTest",
8585
(
86+
connectorType,
8687
createConnectorBody,
8788
payment_methods_enabled,
8889
globalState,
8990
connectorName
9091
) => {
9192
const merchantId = globalState.get("merchantId");
93+
createConnectorBody.connector_type = connectorType;
9294
createConnectorBody.connector_name = connectorName;
9395
createConnectorBody.payment_methods_enabled = payment_methods_enabled;
9496
// readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
@@ -134,8 +136,14 @@ Cypress.Commands.add(
134136

135137
Cypress.Commands.add(
136138
"createConnectorCallTest",
137-
(createConnectorBody, payment_methods_enabled, globalState) => {
139+
(
140+
connectorType,
141+
createConnectorBody,
142+
payment_methods_enabled,
143+
globalState
144+
) => {
138145
const merchantId = globalState.get("merchantId");
146+
createConnectorBody.connector_type = connectorType;
139147
createConnectorBody.connector_name = globalState.get("connectorId");
140148
createConnectorBody.payment_methods_enabled = payment_methods_enabled;
141149
// readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
@@ -191,9 +199,10 @@ Cypress.Commands.add(
191199

192200
Cypress.Commands.add(
193201
"createPayoutConnectorCallTest",
194-
(createConnectorBody, globalState) => {
202+
(connectorType, createConnectorBody, globalState) => {
195203
const merchantId = globalState.get("merchantId");
196204
let connectorName = globalState.get("connectorId");
205+
createConnectorBody.connector_type = connectorType;
197206
createConnectorBody.connector_name = connectorName;
198207
createConnectorBody.connector_type = "payout_processor";
199208
// readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature

0 commit comments

Comments
 (0)