early-optician-55799
08/23/2022, 5:31 PMcy.intercept("POST", "**/application").as("startApplication");
cy.get("@startApplication")
.its("response")
.then((response) => {
const applicationId = response.body.applicationId;
cy.request({
method: "POST",
url: `${apiBaseUrl}/e2e/application/${applicationId}`,
});
});
However, I need to use this applicationId few more times during my e2e tests in order to call other api endpoints later... I don't want to redo the same thing each time, meaning cy.get + .then (cy.request). I would like to do cy.request right off the bat with this applicationId I already managed to get...
btw, for what I care it doesn't have to be an environmental variable, it might be alias, const or whatever that would let me nicely reuse that applciationId later 🙂