test: Remove cacheAcrossSpecs to avoid bulk permission failure

This commit is contained in:
Suraj Shetty 2023-11-17 15:03:21 +05:30
parent 443d508669
commit 8f5a199d64

View file

@ -37,22 +37,16 @@ Cypress.Commands.add("login", (email, password) => {
// cy.session clears all localStorage on new login, so we need to retain the last route
const session_last_route = window.localStorage.getItem("session_last_route");
return cy
.session(
[email, password] || "",
() => {
return cy.request({
url: "/api/method/login",
method: "POST",
body: {
usr: email,
pwd: password,
},
});
},
{
cacheAcrossSpecs: true,
}
)
.session([email, password] || "", () => {
return cy.request({
url: "/api/method/login",
method: "POST",
body: {
usr: email,
pwd: password,
},
});
})
.then(() => {
if (session_last_route) {
window.localStorage.setItem("session_last_route", session_last_route);