59 lines
1.9 KiB
JavaScript
59 lines
1.9 KiB
JavaScript
/// <reference types="cypress" />
|
|
describe("When Accounting user logs in", () => {
|
|
it("should allow user all functionality available to them", () => {
|
|
cy.visit("/login");
|
|
|
|
cy.get("input[name=username]").clear().type(Cypress.env("accountinguser"));
|
|
|
|
// {enter} causes the form to submit
|
|
cy.get("input[name=password]")
|
|
.clear()
|
|
.type(`${Cypress.env("accountingpassword")}{enter}`);
|
|
|
|
cy.url().should("include", "/ay-evaluate");
|
|
|
|
//open nav pane
|
|
cy.get("[data-cy=navicon]").click();
|
|
cy.contains("Accounting"); //accounting is part of name displayed at top
|
|
|
|
//DASHBOARD
|
|
cy.get("[data-cy=home]").click();
|
|
cy.get("[data-cy='nav/home-dashboard']").click();
|
|
cy.url().should("include", "/home-dashboard");
|
|
|
|
//SEARCH
|
|
cy.get("[data-cy=navicon]").click();
|
|
cy.get("[data-cy='nav/home-search']").click();
|
|
cy.url().should("include", "/home-search");
|
|
cy.get("[data-cy=phrase]").clear().type("xyz{enter}");
|
|
//check for expected results
|
|
cy.contains("Customer");
|
|
cy.contains("XYZ Accounting");
|
|
cy.contains("Head Office");
|
|
cy.contains("XYZ Head Office");
|
|
|
|
//MEMOS
|
|
cy.get("[data-cy=navicon]").click();
|
|
cy.get("[data-cy='nav/home-memos']").click();
|
|
cy.url().should("include", "/home-memos");
|
|
cy.get("[data-cy=memosTable]");
|
|
//new memo
|
|
cy.get("[data-cy='memo-list:new']").click();
|
|
// cy.get('[data-cy=pickListSelectedUserId] > .v-input > .v-input__control')
|
|
cy.get('[data-cy=pickListSelectedUserId]').click().type("accounting{enter}");
|
|
cy.get("[data-cy=name]").type("cypress-test-subject-xxx{enter}");
|
|
|
|
|
|
|
|
|
|
// cy.get("[data-cy='nav/home-memos']");
|
|
// cy.get("[data-cy='nav/home-reminders']");
|
|
// cy.get("[data-cy='nav/home-reviews']");
|
|
// cy.get("[data-cy='nav/home-user-settings']");
|
|
// cy.get("[data-cy='nav/home-notify-subscriptions']");
|
|
// cy.get("[data-cy='nav/home-history']");
|
|
|
|
//-----------------------------------------------------
|
|
});
|
|
});
|