This commit is contained in:
2021-12-20 23:21:27 +00:00
parent a74d762fe2
commit 8a8a036efa
3 changed files with 23 additions and 50 deletions

View File

@@ -3,13 +3,13 @@
"xxxretries": 3, "xxxretries": 3,
"integrationFolder": "tests", "integrationFolder": "tests",
"supportFile": "support", "supportFile": "support",
"xbaseUrl": "http://localhost:7575", "baseUrl": "http://localhost:7575",
"baseUrl": "https://test.helloayanova.com", "xbaseUrl": "https://test.helloayanova.com",
"xxxxbaseUrl": "http://localhost:8080", "xxxxbaseUrl": "http://localhost:8080",
"video": false, "video": false,
"env": { "env": {
"xapiBaseUrl": "http://localhost:7575/api/v8.0/", "apiBaseUrl": "http://localhost:7575/api/v8.0/",
"apiBaseUrl": "https://test.helloayanova.com/api/v8.0/", "xapiBaseUrl": "https://test.helloayanova.com/api/v8.0/",
"admin": { "admin": {
"login": "superuser", "login": "superuser",
"password": "l3tm3in" "password": "l3tm3in"

View File

@@ -33,8 +33,9 @@ Cypress.Commands.add("ayChooseVSelect", (dataCyTag, selectionText) => {
Cypress.Commands.add("ayChooseGZPickList", (dataCyTag, selectionText) => { Cypress.Commands.add("ayChooseGZPickList", (dataCyTag, selectionText) => {
cy.get(`[data-cy='${dataCyTag}']`).click({ force: true }).type(selectionText); cy.get(`[data-cy='${dataCyTag}']`).click({ force: true }).type(selectionText);
cy.wait(500); cy.get(".menuable__content__active")
cy.get(".v-list-item__title").contains(new RegExp(selectionText)).click(); .contains(new RegExp(selectionText))
.click();
}); });
Cypress.Commands.add("ayLogin", (user, urlAfterLogin) => { Cypress.Commands.add("ayLogin", (user, urlAfterLogin) => {
@@ -55,16 +56,14 @@ Cypress.Commands.add("ayLogin", (user, urlAfterLogin) => {
Cypress.Commands.add("ayChooseExistingTags", (dataCyTag, tagList) => { Cypress.Commands.add("ayChooseExistingTags", (dataCyTag, tagList) => {
for (let i = 0; i < tagList.length; i++) { for (let i = 0; i < tagList.length; i++) {
cy.get(`[data-cy='${dataCyTag}']`) cy.get(`[data-cy='${dataCyTag}']`).click().type(tagList[i]);
.click() cy.get(".v-list-item__mask");
.type(tagList[i]) cy.get(`[data-cy='${dataCyTag}']`).type("{downarrow}{enter}");
.wait(250)
.type("{downarrow}{enter}");
} }
}); });
Cypress.Commands.add("aySetTestableUserOptions", () => { Cypress.Commands.add("aySetTestableUserOptions", () => {
cy.get("[data-cy=navicon]").click(); cy.get("[data-cy=navicon]").click();
cy.get("[data-cy=home]").click(); cy.get("[data-cy=home]").click();
cy.get("[data-cy='nav/home-user-settings']").click(); cy.get("[data-cy='nav/home-user-settings']").click();
cy.url().should("include", "/home-user-settings"); cy.url().should("include", "/home-user-settings");

View File

@@ -2,34 +2,16 @@
import dayjs from "../../../support/dayjs.min.js"; import dayjs from "../../../support/dayjs.min.js";
describe.skip("When Service user logs in", () => { describe("Workorder creation", () => {
it("should correctly run all functionality", () => { it("should work", () => {
cy.ayLogin("service"); cy.ayLogin("service");
cy.aySetTestableUserOptions();
//open nav pane //open nav pane
cy.get("[data-cy=navicon]").click(); cy.get("[data-cy=navicon]").click();
cy.contains("- Service"); //part of name displayed at top cy.contains("- Service"); //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 });
// //PROJECT
// cy.get("[data-cy=navicon]").click();
// cy.get("[data-cy=service]").click();
// cy.get("[data-cy='nav/svc-projects']").click();
// cy.url().should("include", "/svc-projects");
// cy.get("[data-cy=projectsTable]");
// cy.get("[data-cy='project-list:new']:first").click();
// cy.get("[data-cy=name]").type(
// `${Cypress.config("cyid")}-test-project{enter}`
// );
// cy.get("[data-cy='project-edit:save'] > .v-btn__content").click();
//WORKORDER //WORKORDER
cy.get("[data-cy=navicon]").click();
cy.get("[data-cy=service]").click(); //only if not setting project above cy.get("[data-cy=service]").click(); //only if not setting project above
cy.get("[data-cy='nav/svc-workorders']").click(); cy.get("[data-cy='nav/svc-workorders']").click();
cy.url().should("include", "/svc-workorders"); cy.url().should("include", "/svc-workorders");
@@ -41,8 +23,7 @@ describe.skip("When Service user logs in", () => {
cy.ayChooseVSelect("woState:picker", "Scheduled"); cy.ayChooseVSelect("woState:picker", "Scheduled");
cy.get("[data-cy='woState:btnok']").click(); cy.get("[data-cy='woState:btnok']").click();
//Signature
//Signature
//First assert there is no signature currently //First assert there is no signature currently
cy.get("[data-cy=sigImage]").should("not.exist"); cy.get("[data-cy=sigImage]").should("not.exist");
//make a signature //make a signature
@@ -58,7 +39,6 @@ describe.skip("When Service user logs in", () => {
cy.get('[data-cy="sigOK"]').click(); cy.get('[data-cy="sigOK"]').click();
//validate there is a signature now //validate there is a signature now
cy.get("[data-cy=sigImage]").should("exist"); cy.get("[data-cy=sigImage]").should("exist");
//Address; //Address;
cy.get("[data-cy='woAddress:open']").click(); cy.get("[data-cy='woAddress:open']").click();
@@ -96,9 +76,9 @@ describe.skip("When Service user logs in", () => {
cy.get("[data-cy=internalReferenceNumber]").type( cy.get("[data-cy=internalReferenceNumber]").type(
`intref-${Cypress.config("cyid")}` `intref-${Cypress.config("cyid")}`
); );
cy.get("[data-cy=tags]").click().type("zone1{downarrow}{enter}"); //select some tags
cy.get("[data-cy=tags]").click().type("blue{downarrow}{enter}"); cy.ayChooseExistingTags("tags", ["zone1", "blue", "jade"]);
cy.get("[data-cy=tags]").click().type("jade{downarrow}{enter}");
cy.get("[data-cy=wiki] > div > .v-btn").click(); cy.get("[data-cy=wiki] > div > .v-btn").click();
cy.get("[data-cy=wikiDesignView]").click(); cy.get("[data-cy=wikiDesignView]").click();
cy.get("[data-cy=wikiEditor]").type( cy.get("[data-cy=wikiEditor]").type(
@@ -118,7 +98,7 @@ describe.skip("When Service user logs in", () => {
//Unit //Unit
cy.get("[data-cy=woItemHeader]").click(); cy.get("[data-cy=woItemHeader]").click();
cy.get("[data-cy=woItemAddUnit]").click({force:true}); cy.get("[data-cy=woItemAddUnit]").click({ force: true });
cy.ayChooseGZPickList("units.unitId", "e2e"); cy.ayChooseGZPickList("units.unitId", "e2e");
cy.get("[data-cy=woItemUnitGetWarrantyInfo]").click(); cy.get("[data-cy=woItemUnitGetWarrantyInfo]").click();
cy.contains("Receipt Number:"); //just confirm it displayed something cy.contains("Receipt Number:"); //just confirm it displayed something
@@ -156,8 +136,8 @@ describe.skip("When Service user logs in", () => {
cy.get("[data-cy=woItemPartAssemblyAdd]").click(); cy.get("[data-cy=woItemPartAssemblyAdd]").click();
//Labor //Labor
cy.get("[data-cy=woItemHeader]").click({force:true}); cy.get("[data-cy=woItemHeader]").click({ force: true });
cy.get("[data-cy=woItemAddLabor]").click({force:true}); cy.get("[data-cy=woItemAddLabor]").click({ force: true });
cy.get("[data-cy='serviceStartDate:date']").type( cy.get("[data-cy='serviceStartDate:date']").type(
dayjs().format("YYYY-MM-DD") dayjs().format("YYYY-MM-DD")
@@ -274,17 +254,11 @@ describe.skip("When Service user logs in", () => {
//wait for save, workorder save can take forever due to all the separate posts //wait for save, workorder save can take forever due to all the separate posts
//this will ensure it no matter how long it takes up to the timeout period it will wait //this will ensure it no matter how long it takes up to the timeout period it will wait
//for non-zero path //for non-zero path
cy.location("pathname", { timeout: 20000 }).should( cy.location("pathname", { timeout: 30000 }).should(
"not.eq", "not.eq",
"/svc-workorders/0" "/svc-workorders/0"
); );
// //LOGOUT
// cy.get("[data-cy=navicon]").click(); //{force:true}
// cy.get("[data-cy=logout]").click();
// cy.url().should("include", "/login");
//END OF TEST
//----------------------------------------------------- //-----------------------------------------------------
}); });
}); });