Skip to content

Instantly share code, notes, and snippets.

@Nxtra
Created November 6, 2020 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nxtra/34352c408c06c17612697be9f6c09a59 to your computer and use it in GitHub Desktop.
Save Nxtra/34352c408c06c17612697be9f6c09a59 to your computer and use it in GitHub Desktop.
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