👷 Create firsts e2e tests

This commit is contained in:
Pablo Alba 2022-01-19 17:10:53 +01:00 committed by Andrés Moya
parent 36bb5cbe01
commit 6a6f079a84
14 changed files with 21759 additions and 928 deletions

View file

@ -14,8 +14,28 @@ describe("login", () => {
});
it("displays the login form", () => {
cy.contains("Great to see you again!").should("exist");
cy.get("#email").should("exist");
cy.get("#password").should("exist");
});
it("can't login with an invalid user", () => {
cy.get("#email").type("bad@mail.com");
cy.get("#password").type("badpassword");
cy.get("input[type=submit]").first().click();
cy.get(".warning")
.should("exist")
.should("contain", "Username or password seems to be wrong.");
});
it("can login with a valid user", () => {
cy.fixture('validuser.json').then((user) => {
cy.get("#email").type(user.email);
cy.get("#password").type(user.password);
});
cy.get("input[type=submit]").first().click();
cy.get(".dashboard-layout").should("exist");
});
});