30 lines
893 B
JavaScript
30 lines
893 B
JavaScript
// https://docs.cypress.io/api/introduction/api.html
|
|
|
|
describe("Login", () => {
|
|
it("Logs in navigates to user options and log out", () => {
|
|
cy.visit("/login");
|
|
|
|
cy.get("input[name=username]")
|
|
.clear()
|
|
.type(Cypress.env("adminusername"));
|
|
|
|
// {enter} causes the form to submit
|
|
cy.get("input[name=password]")
|
|
.clear()
|
|
.type(`${Cypress.env("adminpassword")}{enter}`);
|
|
|
|
// we should be redirected to /dashboard
|
|
cy.url().should("include", "/ay-evaluate");
|
|
|
|
//navigate and confirm
|
|
//open nav and home menu
|
|
cy.get("[data-cy=navicon]").click();
|
|
cy.get("[data-cy=home]").click();
|
|
cy.get("[data-cy='nav/home-user-settings']").click();
|
|
cy.url().should("include", "/home-user-settings");
|
|
cy.get("[data-cy=contextmenu]").click();
|
|
cy.get("[data-cy='app:logout']").click();
|
|
cy.url().should("include", "/login");
|
|
});
|
|
});
|