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,
"integrationFolder": "tests",
"supportFile": "support",
"xbaseUrl": "http://localhost:7575",
"baseUrl": "https://test.helloayanova.com",
"baseUrl": "http://localhost:7575",
"xbaseUrl": "https://test.helloayanova.com",
"xxxxbaseUrl": "http://localhost:8080",
"video": false,
"env": {
"xapiBaseUrl": "http://localhost:7575/api/v8.0/",
"apiBaseUrl": "https://test.helloayanova.com/api/v8.0/",
"apiBaseUrl": "http://localhost:7575/api/v8.0/",
"xapiBaseUrl": "https://test.helloayanova.com/api/v8.0/",
"admin": {
"login": "superuser",
"password": "l3tm3in"

View File

@@ -33,8 +33,9 @@ Cypress.Commands.add("ayChooseVSelect", (dataCyTag, selectionText) => {
Cypress.Commands.add("ayChooseGZPickList", (dataCyTag, selectionText) => {
cy.get(`[data-cy='${dataCyTag}']`).click({ force: true }).type(selectionText);
cy.wait(500);
cy.get(".v-list-item__title").contains(new RegExp(selectionText)).click();
cy.get(".menuable__content__active")
.contains(new RegExp(selectionText))
.click();
});
Cypress.Commands.add("ayLogin", (user, urlAfterLogin) => {
@@ -55,11 +56,9 @@ Cypress.Commands.add("ayLogin", (user, 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}");
cy.get(`[data-cy='${dataCyTag}']`).click().type(tagList[i]);
cy.get(".v-list-item__mask");
cy.get(`[data-cy='${dataCyTag}']`).type("{downarrow}{enter}");
}
});

View File

@@ -2,34 +2,16 @@
import dayjs from "../../../support/dayjs.min.js";
describe.skip("When Service user logs in", () => {
it("should correctly run all functionality", () => {
describe("Workorder creation", () => {
it("should work", () => {
cy.ayLogin("service");
cy.aySetTestableUserOptions();
//open nav pane
cy.get("[data-cy=navicon]").click();
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
cy.get("[data-cy=navicon]").click();
cy.get("[data-cy=service]").click(); //only if not setting project above
cy.get("[data-cy='nav/svc-workorders']").click();
cy.url().should("include", "/svc-workorders");
@@ -41,7 +23,6 @@ describe.skip("When Service user logs in", () => {
cy.ayChooseVSelect("woState:picker", "Scheduled");
cy.get("[data-cy='woState:btnok']").click();
//Signature
//First assert there is no signature currently
cy.get("[data-cy=sigImage]").should("not.exist");
@@ -59,7 +40,6 @@ describe.skip("When Service user logs in", () => {
//validate there is a signature now
cy.get("[data-cy=sigImage]").should("exist");
//Address;
cy.get("[data-cy='woAddress:open']").click();
cy.get("[data-cy=address]").type(
@@ -96,9 +76,9 @@ describe.skip("When Service user logs in", () => {
cy.get("[data-cy=internalReferenceNumber]").type(
`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.get("[data-cy=tags]").click().type("jade{downarrow}{enter}");
cy.ayChooseExistingTags("tags", ["zone1", "blue", "jade"]);
cy.get("[data-cy=wiki] > div > .v-btn").click();
cy.get("[data-cy=wikiDesignView]").click();
cy.get("[data-cy=wikiEditor]").type(
@@ -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
//this will ensure it no matter how long it takes up to the timeout period it will wait
//for non-zero path
cy.location("pathname", { timeout: 20000 }).should(
cy.location("pathname", { timeout: 30000 }).should(
"not.eq",
"/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
//-----------------------------------------------------
});
});