This commit is contained in:
@@ -38,9 +38,9 @@ Cypress.Commands.add("ayChooseGZPickList", (dataCyTag, selectionText) => {
|
||||
});
|
||||
|
||||
Cypress.Commands.add("ayLogin", (user, urlAfterLogin) => {
|
||||
if(!urlAfterLogin){
|
||||
urlAfterLogin="/ay-evaluate"
|
||||
}
|
||||
if (!urlAfterLogin) {
|
||||
urlAfterLogin = "/ay-evaluate";
|
||||
}
|
||||
cy.visit("/login");
|
||||
|
||||
cy.get("input[name=username]").clear().type(Cypress.env(user).login);
|
||||
@@ -54,23 +54,19 @@ if(!urlAfterLogin){
|
||||
});
|
||||
|
||||
Cypress.Commands.add("ayChooseExistingTags", (dataCyTag, tagList) => {
|
||||
;
|
||||
for(let i=0;i<tagList.length;i++){
|
||||
cy.get(`[data-cy='${dataCyTag}']`).click().type(tagList[i]).wait(250).type("{downarrow}{enter}");
|
||||
for (let i = 0; i < tagList.length; i++) {
|
||||
cy.get(`[data-cy='${dataCyTag}']`)
|
||||
.click()
|
||||
.type(tagList[i])
|
||||
.wait(250)
|
||||
.type("{downarrow}{enter}");
|
||||
}
|
||||
|
||||
// cy.get(`[data-cy='${dataCyTag}']`).then(t=>{
|
||||
// t.click();
|
||||
// for(let i=0;i<tagList.length;i++){
|
||||
// t.type(tagList[i]);
|
||||
// cy.wait(250);
|
||||
// t.type("{downarrow}{enter}");
|
||||
// }
|
||||
// tagList.forEach(z=>{
|
||||
// cy.type(z);
|
||||
// cy.contains(z);//look for the text on the page
|
||||
// cy.type("{downarrow}{enter}");
|
||||
// });
|
||||
//})
|
||||
|
||||
});
|
||||
|
||||
Cypress.Commands.add("aySetTestableUserOptions", () => {
|
||||
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='nativeDateTimeInput']").check({ force: true });
|
||||
});
|
||||
|
||||
@@ -20,4 +20,5 @@ import "./commands";
|
||||
// require('./commands')
|
||||
|
||||
//unique test run ID for all tests
|
||||
Cypress.config("cyid", `cy${new Date().getTime()}`);
|
||||
Cypress.config("cyid", `cy${new Date().getTime()}`);
|
||||
|
||||
|
||||
@@ -17,15 +17,8 @@ describe("Memo features", () => {
|
||||
);
|
||||
cy.get("[data-cy=notes]").type(
|
||||
`The quick brown fox jumped{enter}over the six lazy dogs{enter}eot`
|
||||
);
|
||||
|
||||
//TODO: TURN THIS INTO A COMMAND AND THEN SWAP THAT OUT EVERY EXISTING TEST WITH TAG ENTRY
|
||||
|
||||
// cy.get("[data-cy=tags]").click().type("zone1{downarrow}{enter}"); //select some tags
|
||||
// cy.get("[data-cy=tags]").click().type("blue{downarrow}{enter}");
|
||||
// cy.get("[data-cy=tags]").click().type("zone2{downarrow}{enter}");
|
||||
);
|
||||
cy.ayChooseExistingTags("tags",['zone1','blue','zone2']);
|
||||
|
||||
cy.get("[data-cy='memo-edit:save'] > .v-btn__content").click();
|
||||
cy.url().should("include", "/home-memos"); //wait for nav
|
||||
cy.contains(`${Cypress.config("cyid")}-test-subject`).click(); //find and open memo record
|
||||
|
||||
38
e2e/tests/regression/accounting-user/0300-reminder.js
Normal file
38
e2e/tests/regression/accounting-user/0300-reminder.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/// <reference types="cypress" />
|
||||
describe("Memo features", () => {
|
||||
it("should work", () => {
|
||||
const dNow = new Date();
|
||||
const dToday = `${dNow.getFullYear()}-${(dNow.getMonth() + 1)
|
||||
.toString()
|
||||
.padStart(2, "0")}-${dNow.getDate().toString().padStart(2, "0")}`;
|
||||
const tNow = `${dNow.getHours().toString().padStart(2, "0")}:${dNow
|
||||
.getMinutes()
|
||||
.toString()
|
||||
.padStart(2, "0")}`;
|
||||
const tOneHourFromNow = `${(dNow.getHours() + 1)
|
||||
.toString()
|
||||
.padStart(2, "0")}:${dNow.getMinutes().toString().padStart(2, "0")}`;
|
||||
|
||||
cy.ayLogin("accounting");
|
||||
cy.aySetTestableUserOptions();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=home]").click();
|
||||
cy.get("[data-cy='nav/home-reminders']").click();
|
||||
cy.url().should("include", "/home-reminders");
|
||||
cy.get("[data-cy='reminder-list:new']:first").click();
|
||||
cy.url().should("include", "/home-reminders/");
|
||||
cy.get("[data-cy=name]").type(
|
||||
`${Cypress.config("cyid")}-test-reminder{enter}`
|
||||
);
|
||||
cy.get("[data-cy='startDate:date']").type(dToday);
|
||||
cy.get("[data-cy='startDate:time']").type(tNow);
|
||||
cy.get("[data-cy='stopDate:date']").type(dToday);
|
||||
cy.get("[data-cy='stopDate:time']").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('[data-cy="reminder-edit:save"] > .v-btn__content').click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy='nav/home-reminders']").click();
|
||||
cy.url().should("include", "/home-reminders");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user