Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Call custom signIn command before cypress test suite
describe("Example test", () => {
before(() => {
cy.signIn();
});
after(() => {
cy.clearLocalStorageSnapshot();
cy.clearLocalStorage();
});
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
it("should be logged in", () => {
cy.visit("/");
cy.get(".App-logo").should("be.visible");
it("Should talk about react", () => {
cy.visit("/")
cy.contains("React")
})
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment