diff --git a/e2e/tests/regression/accounting-user/accounting-features.js b/e2e/tests/regression/accounting-user/accounting-features.js index a900410..079d294 100644 --- a/e2e/tests/regression/accounting-user/accounting-features.js +++ b/e2e/tests/regression/accounting-user/accounting-features.js @@ -1,6 +1,17 @@ /// describe("When Accounting user logs in", () => { it("should allow user all functionality available to them", () => { + // const dToday = new Date().toISOString().split("T")[0]; + //const tNow = new Date().toISOString().split("T")[1]; + + const date=new Date(); + const dToday = new Date(date.getTime() - date.getTimezoneOffset() * 60000) + .toISOString() + .split("T")[0]; + + const tNow = `${date.getHours()}:${date.getMinutes()}`; + const tOneHourFromNow = `${date.getHours()+1}:${date.getMinutes()}`; + cy.visit("/login"); cy.get("input[name=username]").clear().type(Cypress.env("accountinguser")); @@ -15,10 +26,18 @@ describe("When Accounting user logs in", () => { //open nav pane cy.get("[data-cy=navicon]").click(); cy.contains("Accounting"); //accounting is part of name displayed at top + + //USER OPTIONS 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='nativeDateTimeInput']").check({ force: true }); + + /* //DASHBOARD - /* */ + + cy.get("[data-cy=navicon]").click(); cy.get("[data-cy='nav/home-dashboard']").click(); cy.url().should("include", "/home-dashboard"); @@ -35,7 +54,7 @@ describe("When Accounting user logs in", () => { //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]"); @@ -44,7 +63,7 @@ describe("When Accounting user logs in", () => { cy.url().should("include", "/home-memos/"); cy.get("[data-cy=pickListSelectedUserId]") .click() - .type("accounting{enter}");//select Accounting user (self) + .type("accounting{enter}"); //select Accounting user (self) cy.get("[data-cy=name]").type( `${Cypress.config("cyid")}-test-subject{enter}` ); @@ -73,17 +92,16 @@ describe("When Accounting user logs in", () => { cy.get("[data-cy=contextmenu]").click(); cy.get("[data-cy='memo-edit:forward']").click(); cy.url().should("include", "/home-memos/"); - cy.get("[data-cy=notes]").type(`Hello SuperUser this is my forward to you!{enter}eot{enter}`); - cy.get("[data-cy=pickListSelectedUserId]") - .click() - .type("SuperUser{enter}"); - cy.get("[data-cy='memo-edit:save'] > .v-btn__content").click(); - + cy.get("[data-cy=notes]").type( + `Hello SuperUser this is my forward to you!{enter}eot{enter}` + ); + cy.get("[data-cy=pickListSelectedUserId]").click().type("SuperUser{enter}"); + cy.get("[data-cy='memo-edit:save'] > .v-btn__content").click(); +*/ + //REMINDERS + cy.get("[data-cy=navicon]").click(); + //new reminder - //REMINDERS - cy.get("[data-cy=navicon]").click(); -//new reminder - cy.get("[data-cy='nav/home-reminders']").click(); cy.url().should("include", "/home-reminders"); cy.get("[data-cy='reminder-list:new']:first").click(); @@ -91,12 +109,18 @@ describe("When Accounting user logs in", () => { cy.get("[data-cy=name]").type( `${Cypress.config("cyid")}-test-reminder{enter}` ); - cy.get("[data-cy='dtfpick:startDate']:first").click(); - cy.get('[data-cy="dpicktoday:startDate"] > .v-btn__content').click();//select today - cy.get('[data-cy="ttfpick:startDate"]').click(); - cy.get('[data-cy="ttfpicknow:startDate"] > .v-btn__content').click();//select now + + //set date and time + //format for typing input and setting value is always YYYY-MM-DD for date and HH:MM in 24 hour time for time + + cy.get("[data-cy='dpick:startDate']").type(dToday); + cy.get("[data-cy='tpick:startDate']").type(tNow); + + cy.get("[data-cy='dpick:stopDate']").type(dToday); + cy.get("[data-cy='tpick:stopDate']").type(tOneHourFromNow); + cy.get("[data-cy=notes]").type(`This is a reminder{enter}eot{enter}`); - cy.get('.v-color-picker__input > input').clear().type("#11E1D07E{enter}");//select a color + cy.get(".v-color-picker__input > input").clear().type("#11E1D07E{enter}"); //select a color cy.get('[data-cy="reminder-edit:save"] > .v-btn__content').click(); cy.get("[data-cy=navicon]").click(); cy.get("[data-cy='nav/home-reminders']").click();