| 1 | import { Given, Then } from "@badeball/cypress-cucumber-preprocessor"; |
| 2 | |
| 3 | Given("I intercept the {string} API call", (apiMethodName: string) => { |
| 4 | cy.intercept({ method: "POST", url: "**/ipa/session/json" }, (req) => { |
| 5 | if (req.body.method === apiMethodName) { |
| 6 | req.alias = "apiCall"; |
| 7 | } |
| 8 | }); |
| 9 | }); |
| 10 | |
| 11 | Then("I should wait for the API call to finish", () => { |
| 12 | cy.wait("@apiCall"); |
| 13 | }); |