saleor-dashboard/cypress/support/index.js

20 lines
433 B
JavaScript
Raw Normal View History

import "./user";
Cypress.Commands.add("clearSessionData", () => {
// Because of known cypress bug, not all local storage data are cleared.
// Here is workaround to ensure tests have no side effects.
// Suggested usage:
// beforeEach(() => {
// cy.clearSessionData();
// });
cy.clearCookies();
cy.clearLocalStorage();
cy.visit("/", {
onBeforeLoad: win => {
win.sessionStorage.clear();
}
});
});