This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
|
||||
Cypress.Commands.add("chooseVSelect", (dataCyTag, selectionText) => {
|
||||
cy.get(`[data-cy='${dataCyTag}']`).click({ force: true });
|
||||
cy.get(".v-list-item__title")
|
||||
cy.get(".v-list-item__title")
|
||||
.contains(new RegExp("^" + selectionText + "$", "g"))
|
||||
.click({ force: true });
|
||||
});
|
||||
@@ -35,6 +35,7 @@ Cypress.Commands.add("choosePickList", (dataCyTag, selectionText) => {
|
||||
cy.get(`[data-cy='${dataCyTag}']`).click({ force: true }).type(selectionText);
|
||||
|
||||
cy.get(".v-list-item__title")
|
||||
.contains(new RegExp("^" + selectionText + "$", "g"))
|
||||
.contains(selectionText)
|
||||
//.contains(new RegExp("^" + selectionText + "$", "g"))
|
||||
.click({ force: true });
|
||||
});
|
||||
|
||||
@@ -60,6 +60,8 @@ function confirmJobDone(jobId, authToken) {
|
||||
confirmJobDone(jobId, authToken);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
before(() => {
|
||||
cy.request({
|
||||
url: `${Cypress.env("apiBaseUrl")}auth`,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
describe("When Accounting user logs in", () => {
|
||||
it.skip("should correctly run all functionality", () => {
|
||||
it("should correctly run all functionality", () => {
|
||||
//format for typing input and setting value is always YYYY-MM-DD for date and HH:MM in 24 hour time for time
|
||||
const dNow = new Date();
|
||||
const dToday = `${dNow.getFullYear()}-${(dNow.getMonth() + 1)
|
||||
@@ -248,7 +248,7 @@ describe("When Accounting user logs in", () => {
|
||||
);
|
||||
cy.get("[data-cy=charge]").type("2.00");
|
||||
cy.get("[data-cy=cost]").type("1.00");
|
||||
cy.chooseVSelect("unit", "km");
|
||||
cy.get("[data-cy=unit]").type("{downarrow}{enter}");//choose first in list
|
||||
cy.get("[data-cy=notes]").type(`Test trvl rate NOTES!!!{enter}eot{enter}`);
|
||||
cy.get("[data-cy='travel-rate-edit:save'] > .v-btn__content").click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import dayjs from "../../../support/dayjs.min.js";
|
||||
|
||||
describe("When Service user logs in", () => {
|
||||
it.skip("should correctly run all functionality", () => {
|
||||
it("should correctly run all functionality", () => {
|
||||
cy.visit("/login");
|
||||
cy.get("input[name=username]").clear().type(Cypress.env("serviceuser"));
|
||||
// {enter} causes the form to submit
|
||||
@@ -106,7 +106,7 @@ describe("When Service user logs in", () => {
|
||||
//Unit
|
||||
cy.get("[data-cy=woItemHeader]").click();
|
||||
cy.get("[data-cy=woItemAddUnit]").click();
|
||||
cy.choosePickList("units.unitId", "zone"); //this works but is indeterminate so there must be a zoneX unit which usually seems to be the case
|
||||
cy.choosePickList("units.unitId", "e2e");
|
||||
cy.get("[data-cy=woItemUnitGetWarrantyInfo]").click();
|
||||
cy.contains("Receipt Number:"); //just confirm it displayed something
|
||||
cy.get("[data-cy=unitUnitNotes]").type(`e2ewoitemunitnotes`);
|
||||
@@ -124,7 +124,7 @@ describe("When Service user logs in", () => {
|
||||
dayjs().add(1, "hour").format("HH:mm")
|
||||
);
|
||||
cy.choosePickList("scheduledUsers.userid", "TechRestricted");
|
||||
cy.choosePickList("scheduledUsers.serviceRateId", "zone");
|
||||
cy.choosePickList("scheduledUsers.serviceRateId", "e2e");
|
||||
|
||||
//Task
|
||||
cy.get("[data-cy=woItemHeader]").click();
|
||||
@@ -155,7 +155,7 @@ describe("When Service user logs in", () => {
|
||||
dayjs().add(1, "hour").format("HH:mm")
|
||||
);
|
||||
cy.choosePickList("labors.userid", "TechRestricted");
|
||||
cy.choosePickList("labors.serviceRateId", "zone");
|
||||
cy.choosePickList("labors.serviceRateId", "e2e");
|
||||
cy.get('[data-cy=laborserviceDetails]').type("e2elabordeets");
|
||||
|
||||
//Travel
|
||||
@@ -171,7 +171,7 @@ describe("When Service user logs in", () => {
|
||||
dayjs().add(1, "hour").format("HH:mm")
|
||||
);
|
||||
cy.choosePickList("travels.userid", "TechRestricted");
|
||||
cy.choosePickList("travels.travelRateId", "zone");
|
||||
cy.choosePickList("travels.travelRateId", "e2e");
|
||||
cy.get('[data-cy=travelTravelRateDistance]').type("123");
|
||||
cy.get('[data-cy=traveltravelDetails]').type("e2etraveldeets");
|
||||
|
||||
@@ -191,7 +191,7 @@ describe("When Service user logs in", () => {
|
||||
//Loan
|
||||
cy.get("[data-cy=woItemHeader]").click();
|
||||
cy.get("[data-cy=woItemAddLoan]").click();
|
||||
cy.choosePickList("loans.loanUnitId", "zone");
|
||||
cy.choosePickList("loans.loanUnitId", "e2e");
|
||||
cy.chooseVSelect("loans.rate", "Hourly charge");
|
||||
cy.get('[data-cy="loans.quantity"]').type("5");
|
||||
|
||||
@@ -212,12 +212,12 @@ describe("When Service user logs in", () => {
|
||||
//OutsideService
|
||||
cy.get("[data-cy=woItemHeader]").click();
|
||||
cy.get("[data-cy=woItemAddOutsideService]").click();
|
||||
cy.choosePickList("outsideServices.unitId", "zone");
|
||||
cy.choosePickList("outsideServices.vendorSentToId", "zone");
|
||||
cy.choosePickList("outsideServices.unitId", "e2e");
|
||||
cy.choosePickList("outsideServices.vendorSentToId", "e2e");
|
||||
cy.get('[data-cy="outsideServices.rma"]').type("e2e-outsideservice-rma");
|
||||
cy.get('[data-cy="outsideServices.repairCost"]').type("123.45");
|
||||
cy.get('[data-cy="outsideServices.repairPrice"]').type("67.89");
|
||||
cy.choosePickList("outsideServices.vendorSentViaId", "zone");
|
||||
cy.choosePickList("outsideServices.vendorSentViaId", "e2e");
|
||||
cy.get('[data-cy="outsideServices.trackingNumber"]').type(
|
||||
"e2e-outsideservice-tracking#"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user