-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(cypressV2): update cypress v2 framework to accommodate hyperswitch…
… v2 changes (#6493)
- Loading branch information
1 parent
2c64307
commit 31211d7
Showing
9 changed files
with
412 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
132 changes: 132 additions & 0 deletions
132
cypress-tests-v2/cypress/e2e/spec/Payment/0001-[No3DS]Payments.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
/* | ||
No 3DS Auto capture with Confirm True | ||
No 3DS Auto capture with Confirm False | ||
No 3DS Manual capture with Confirm True | ||
No 3DS Manual capture with Confirm False | ||
No 3DS Manual multiple capture with Confirm True | ||
No 3DS Manual multiple capture with Confirm False | ||
*/ | ||
|
||
import * as fixtures from "../../../fixtures/imports"; | ||
import State from "../../../utils/State"; | ||
import getConnectorDetails from "../../configs/Payment/Utils"; | ||
|
||
let globalState; | ||
|
||
// Below is an example of a test that is skipped just because it is not implemented yet | ||
describe("[Payment] [No 3DS] [Payment Method: Card]", () => { | ||
context("[Payment] [No 3DS] [Capture: Automatic] [Confirm: True]", () => { | ||
let should_continue = true; | ||
|
||
before("seed global state", () => { | ||
cy.task("getGlobalState").then((state) => { | ||
globalState = new State(state); | ||
}); | ||
}); | ||
beforeEach(function () { | ||
if (!should_continue) { | ||
this.skip(); | ||
} | ||
}); | ||
|
||
after("flush global state", () => { | ||
cy.task("setGlobalState", globalState.data); | ||
}); | ||
|
||
it.skip("Create payment intent", () => { | ||
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ | ||
"PaymentIntent" | ||
]; | ||
let req_data = data["Request"]; | ||
let res_data = data["Response"]; | ||
cy.paymentIntentCreateCall( | ||
fixtures.createPaymentBody, | ||
req_data, | ||
res_data, | ||
"no_three_ds", | ||
"automatic", | ||
globalState | ||
); | ||
}); | ||
|
||
it.skip("List payment methods", () => { | ||
cy.paymentMethodsListCall(globalState); | ||
}); | ||
|
||
it.skip("Confirm payment intent", () => { | ||
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ | ||
"No3DSAutoCapture" | ||
]; | ||
let req_data = data["Request"]; | ||
let res_data = data["Response"]; | ||
cy.paymentIntentConfirmCall( | ||
fixtures.confirmBody, | ||
req_data, | ||
res_data, | ||
true, | ||
globalState | ||
); | ||
}); | ||
|
||
it.skip("Retrieve payment intent", () => { | ||
cy.paymentIntentRetrieveCall(globalState); | ||
}); | ||
}); | ||
context("[Payment] [No 3DS] [Capture: Automatic] [Confirm: False]", () => { | ||
let should_continue = true; | ||
|
||
before("seed global state", () => { | ||
cy.task("getGlobalState").then((state) => { | ||
globalState = new State(state); | ||
}); | ||
}); | ||
beforeEach(function () { | ||
if (!should_continue) { | ||
this.skip(); | ||
} | ||
}); | ||
|
||
after("flush global state", () => { | ||
cy.task("setGlobalState", globalState.data); | ||
}); | ||
|
||
it.skip("Create Payment Intent", () => { | ||
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ | ||
"PaymentIntent" | ||
]; | ||
let req_data = data["Request"]; | ||
let res_data = data["Response"]; | ||
cy.paymentIntentCreateCall( | ||
fixtures.createPaymentBody, | ||
req_data, | ||
res_data, | ||
"no_three_ds", | ||
"automatic", | ||
globalState | ||
); | ||
}); | ||
|
||
it.skip("Payment Methods", () => { | ||
cy.paymentMethodsCallTest(globalState); | ||
}); | ||
|
||
it.skip("Confirm No 3DS", () => { | ||
let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ | ||
"No3DSAutoCapture" | ||
]; | ||
let req_data = data["Request"]; | ||
let res_data = data["Response"]; | ||
cy.paymentIntentConfirmCall( | ||
fixtures.confirmBody, | ||
req_data, | ||
res_data, | ||
true, | ||
globalState | ||
); | ||
}); | ||
|
||
it.skip("Retrieve payment intent", () => { | ||
cy.paymentIntentRetrieveCall(globalState); | ||
}); | ||
}); | ||
}); |
8 changes: 8 additions & 0 deletions
8
cypress-tests-v2/cypress/e2e/spec/Payment/0002-[3DS]Payments.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
3DS Auto capture with Confirm True | ||
3DS Auto capture with Confirm False | ||
3DS Manual capture with Confirm True | ||
3DS Manual capture with Confirm False | ||
3DS Manual multiple capture with Confirm True | ||
3DS Manual multiple capture with Confirm False | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.