mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 10:06:32 +08:00 
			
		
		
		
	ci(cypress): Add list and revoke for zero auth mandate payments (#6569)
This commit is contained in:
		| @ -4,7 +4,7 @@ import getConnectorDetails, * as utils from "../PaymentUtils/Utils"; | ||||
|  | ||||
| let globalState; | ||||
|  | ||||
| describe("Card - SingleUse Mandates flow test", () => { | ||||
| describe("Card - List and revoke Mandates flow test", () => { | ||||
|   before("seed global state", () => { | ||||
|     cy.task("getGlobalState").then((state) => { | ||||
|       globalState = new State(state); | ||||
| @ -71,4 +71,55 @@ describe("Card - SingleUse Mandates flow test", () => { | ||||
|       }); | ||||
|     } | ||||
|   ); | ||||
|   context("Card - Zero auth CIT and MIT payment flow test", () => { | ||||
|     let should_continue = true; // variable that will be used to skip tests if a previous test fails | ||||
|  | ||||
|     beforeEach(function () { | ||||
|       if (!should_continue) { | ||||
|         this.skip(); | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     it("Confirm No 3DS CIT", () => { | ||||
|       let data = getConnectorDetails(globalState.get("connectorId"))["card_pm"][ | ||||
|         "ZeroAuthMandate" | ||||
|       ]; | ||||
|       let req_data = data["Request"]; | ||||
|       let res_data = data["Response"]; | ||||
|       cy.citForMandatesCallTest( | ||||
|         fixtures.citConfirmBody, | ||||
|         req_data, | ||||
|         res_data, | ||||
|         0, | ||||
|         true, | ||||
|         "automatic", | ||||
|         "setup_mandate", | ||||
|         globalState | ||||
|       ); | ||||
|       if (should_continue) | ||||
|         should_continue = utils.should_continue_further(res_data); | ||||
|     }); | ||||
|  | ||||
|     it("list-mandate-call-test", () => { | ||||
|       cy.listMandateCallTest(globalState); | ||||
|     }); | ||||
|  | ||||
|     it("Confirm No 3DS MIT", () => { | ||||
|       cy.mitForMandatesCallTest( | ||||
|         fixtures.mitConfirmBody, | ||||
|         7000, | ||||
|         true, | ||||
|         "automatic", | ||||
|         globalState | ||||
|       ); | ||||
|     }); | ||||
|  | ||||
|     it("list-mandate-call-test", () => { | ||||
|       cy.listMandateCallTest(globalState); | ||||
|     }); | ||||
|  | ||||
|     it("revoke-mandate-call-test", () => { | ||||
|       cy.revokeMandateCallTest(globalState); | ||||
|     }); | ||||
|   }); | ||||
| }); | ||||
|  | ||||
| @ -1969,9 +1969,7 @@ Cypress.Commands.add( | ||||
|           } else if (response.body.authentication_type === "no_three_ds") { | ||||
|             if (response.body.connector === "fiuu") { | ||||
|               expect(response.body.status).to.equal("failed"); | ||||
|             } else { | ||||
|               expect(response.body.status).to.equal("succeeded"); | ||||
|             } | ||||
|             }  | ||||
|           } else { | ||||
|             throw new Error( | ||||
|               `Invalid authentication type ${response.body.authentication_type}` | ||||
| @ -2051,9 +2049,7 @@ Cypress.Commands.add( | ||||
|           } else if (response.body.authentication_type === "no_three_ds") { | ||||
|             if (response.body.connector === "fiuu") { | ||||
|               expect(response.body.status).to.equal("failed"); | ||||
|             } else { | ||||
|               expect(response.body.status).to.equal("succeeded"); | ||||
|             } | ||||
|             }  | ||||
|           } else { | ||||
|             throw new Error( | ||||
|               `Invalid authentication type ${response.body.authentication_type}` | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Gnanasundari24
					Gnanasundari24