{{ entity.id }} - {{ entity.firstName }} {{ entity.lastName }}
diff --git a/src/router/modules/route.js b/src/router/modules/route.js
index 4c145710a..be0b8a1f6 100644
--- a/src/router/modules/route.js
+++ b/src/router/modules/route.js
@@ -271,6 +271,7 @@ export default {
path: 'roadmap',
name: 'RouteRoadmap',
redirect: { name: 'RoadmapList' },
+ component: () => import('src/pages/Route/RouteRoadmap.vue'),
meta: {
title: 'RouteRoadmap',
icon: 'vn:troncales',
@@ -301,6 +302,7 @@ export default {
path: 'agency',
name: 'RouteAgency',
redirect: { name: 'AgencyList' },
+ component: () => import('src/pages/Route/Agency/AgencyList.vue'),
meta: {
title: 'agency',
icon: 'garage_home',
@@ -322,6 +324,7 @@ export default {
path: 'vehicle',
name: 'RouteVehicle',
redirect: { name: 'VehicleList' },
+ component: () => import('src/pages/Route/Vehicle/VehicleList.vue'),
meta: {
title: 'vehicle',
icon: 'directions_car',
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 22a1a0143..79dcd6f70 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -1,4 +1,4 @@
-describe.skip('AgencyWorkCenter', () => {
+describe('AgencyWorkCenter', () => {
const selectors = {
workCenter: 'workCenter_select',
popupSave: 'FormModelPopup_save',
@@ -9,7 +9,7 @@ describe.skip('AgencyWorkCenter', () => {
const messages = {
dataCreated: 'Data created',
alreadyAssigned: 'This workCenter is already assigned to this agency',
- removed: 'WorkCenter removed successfully',
+ removed: 'Work center removed successfully',
};
beforeEach(() => {
diff --git a/test/cypress/integration/route/routeAutonomous.spec.js b/test/cypress/integration/route/routeAutonomous.spec.js
index 08fd7d7ea..acf82bd95 100644
--- a/test/cypress/integration/route/routeAutonomous.spec.js
+++ b/test/cypress/integration/route/routeAutonomous.spec.js
@@ -1,4 +1,4 @@
-describe.skip('RouteAutonomous', () => {
+describe('RouteAutonomous', () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js
index 5fda93b25..fb2885f35 100644
--- a/test/cypress/integration/route/routeExtendedList.spec.js
+++ b/test/cypress/integration/route/routeExtendedList.spec.js
@@ -1,4 +1,4 @@
-describe.skip('Route extended list', () => {
+describe('Route extended list', () => {
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
const selectors = {
@@ -8,6 +8,8 @@ describe.skip('Route extended list', () => {
date: getSelector('dated'),
description: getSelector('description'),
served: getSelector('isOk'),
+ firstRowSelectCheckBox:
+ 'tbody > tr:first-child > :nth-child(1) .q-checkbox__inner',
lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
removeBtn: '[title="Remove"]',
resetBtn: '[title="Reset"]',
@@ -19,7 +21,7 @@ describe.skip('Route extended list', () => {
markServedBtn: '#st-actions > .q-btn-group > :nth-child(3)',
searchbar: 'searchbar',
firstTicketsRowSelectCheckBox:
- '.q-card > :nth-child(2) > .q-table__container > .q-table__middle > .q-table > tbody > :nth-child(1) > .q-table--col-auto-width > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg > .q-checkbox__svg',
+ '.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
};
const checkboxState = {
@@ -117,12 +119,21 @@ describe.skip('Route extended list', () => {
});
});
- it('Should clone selected route', () => {
- cy.get(selectors.lastRowSelectCheckBox).click();
+ it('Should clone selected route and add ticket', () => {
+ cy.get(selectors.firstRowSelectCheckBox).click();
cy.get(selectors.cloneBtn).click();
- cy.dataCy('route.Starting date_inputDate').type('10-05-2001').click();
+ cy.dataCy('Starting date_inputDate').type('01-01-2001');
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
- cy.validateContent(selectors.date, '05/10/2001');
+ cy.validateContent(selectors.date, '01/01/2001');
+
+ cy.dataCy('tableAction-0').last().click();
+ cy.get(selectors.firstTicketsRowSelectCheckBox).click();
+ cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
+ cy.checkNotification(dataSaved);
+
+ cy.get(selectors.lastRowSelectCheckBox).click();
+ cy.get(selectors.removeBtn).click();
+ cy.dataCy(selectors.confirmBtn).click();
});
it('Should download selected route', () => {
@@ -143,22 +154,15 @@ describe.skip('Route extended list', () => {
cy.validateContent(selectors.served, checkboxState.check);
});
- it('Should delete the selected route', () => {
+ it('Should delete the selected routes', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
-
cy.get(selectors.removeBtn).click();
+
cy.dataCy(selectors.confirmBtn).click();
cy.checkNotification(dataSaved);
});
- it('Should add ticket to route', () => {
- cy.dataCy('tableAction-0').last().click();
- cy.get(selectors.firstTicketsRowSelectCheckBox).click();
- cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
- cy.checkNotification(dataSaved);
- });
-
it('Should save changes in route', () => {
updateFields.forEach(({ selector, type, value }) => {
fillField(selector, type, value);
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index 04278cfc5..f08c267a4 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -1,37 +1,205 @@
describe('Route', () => {
+ const getSelector = (colField) =>
+ `tr:last-child > [data-col-field="${colField}"] > .no-padding > .link`;
+
+ const selectors = {
+ lastRow: 'tr:last-child > [data-col-field="workerFk"]',
+ workerLink: getSelector('workerFk'),
+ agencyLink: getSelector('agencyModeFk'),
+ vehicleLink: getSelector('vehicleFk'),
+ assignedTicketsBtn: 'tableAction-0',
+ rowSummaryBtn: 'tableAction-1',
+ summaryTitle: '.summaryHeader',
+ descriptorTitle: '.descriptor .title',
+ descriptorOpenSummaryBtn: '.descriptor [data-cy="openSummaryBtn"]',
+ descriptorGoToSummaryBtn: '.descriptor [data-cy="goToSummaryBtn"]',
+ SummaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
+ };
+
+ const data = {
+ Worker: { val: 'logistic', type: 'select' },
+ Agency: { val: 'Walking', type: 'select' },
+ Vehicle: { val: '3333-BAT', type: 'select' },
+ Description: { val: 'routeTest' },
+ };
+
+ const summaryUrl = '/summary';
+
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/route/extended-list`);
+ cy.visit(`/#/route/list`);
+ cy.typeSearchbar('{enter}');
});
- it('Route list create route', () => {
+ it('Should list routes', () => {
+ cy.get('.q-table')
+ .children()
+ .should('be.visible')
+ .should('have.length.greaterThan', 0);
+ });
+
+ it('Should create new route', () => {
cy.addBtnClick();
- cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
- cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.url().should('include', '/summary');
+
+ cy.fillInForm(data);
+
+ cy.dataCy('FormModelPopup_save').should('be.visible').click();
+
+ cy.checkNotification('Data created');
+ cy.url().should('include', summaryUrl);
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Description.val);
+ });
});
- it('Route list search and edit', () => {
- cy.get('#searchbar input').type('{enter}');
- cy.get('[data-col-field="description"][data-row-index="0"]')
- .click()
- .type('routeTestOne{enter}');
- cy.get('.q-table tr')
- .its('length')
- .then((rowCount) => {
- expect(rowCount).to.be.greaterThan(0);
+ it('Should open route summary by clicking a route', () => {
+ cy.get(selectors.lastRow).should('be.visible').click();
+ cy.url().should('include', summaryUrl);
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Description.val);
});
- cy.get('[data-col-field="workerFk"][data-row-index="0"]')
- .click()
- .type('{downArrow}{enter}');
- cy.get('[data-col-field="agencyModeFk"][data-row-index="0"]')
- .click()
- .type('{downArrow}{enter}');
- cy.get('[data-col-field="vehicleFk"][data-row-index="0"]')
- .click()
- .type('{downArrow}{enter}');
- cy.get('button[title="Save"]').click();
- cy.get('.q-notification__message').should('have.text', 'Data saved');
+ });
+
+ it('Should redirect to the summary from the route pop-up summary', () => {
+ cy.dataCy(selectors.rowSummaryBtn).last().should('be.visible').click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Description.val);
+ });
+ cy.get(selectors.SummaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Description.val);
+ });
+ });
+
+ it('Should redirect to the route assigned tickets from the row assignedTicketsBtn', () => {
+ cy.dataCy(selectors.assignedTicketsBtn).first().should('be.visible').click();
+ cy.url().should('include', '1/tickets');
+ cy.get('.q-table')
+ .children()
+ .should('be.visible')
+ .should('have.length.greaterThan', 0);
+ });
+
+ describe('Worker pop-ups', () => {
+ it('Should redirect to summary from the worker pop-up descriptor', () => {
+ cy.get(selectors.workerLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Worker.val);
+ });
+ cy.get(selectors.descriptorGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Worker.val);
+ });
+ });
+
+ it('Should redirect to the summary from the worker pop-up summary', () => {
+ cy.get(selectors.workerLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Worker.val);
+ });
+ cy.get(selectors.descriptorOpenSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Worker.val);
+ });
+ cy.get(selectors.SummaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Worker.val);
+ });
+ });
+ });
+
+ describe('Agency pop-ups', () => {
+ it('Should redirect to summary from the agency pop-up descriptor', () => {
+ cy.get(selectors.agencyLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Agency.val);
+ });
+ cy.get(selectors.descriptorGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Agency.val);
+ });
+ });
+
+ it('Should redirect to the summary from the agency pop-up summary', () => {
+ cy.get(selectors.agencyLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Agency.val);
+ });
+ cy.get(selectors.descriptorOpenSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Agency.val);
+ });
+ cy.get(selectors.SummaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Agency.val);
+ });
+ });
+ });
+
+ describe('Vehicle pop-ups', () => {
+ it('Should redirect to summary from the vehicle pop-up descriptor', () => {
+ cy.get(selectors.vehicleLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Vehicle.val);
+ });
+ cy.get(selectors.descriptorGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Vehicle.val);
+ });
+ });
+
+ it('Should redirect to the summary from the vehicle pop-up summary', () => {
+ cy.get(selectors.vehicleLink).click();
+ cy.get(selectors.descriptorTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Vehicle.val);
+ });
+ cy.get(selectors.descriptorOpenSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Vehicle.val);
+ });
+ cy.get(selectors.SummaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryTitle)
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(data.Vehicle.val);
+ });
+ });
});
});
diff --git a/test/cypress/integration/route/vehicle/vehicleDescriptor.spec.js b/test/cypress/integration/route/vehicle/vehicleDescriptor.spec.js
index 64b9ca0a0..3e9c816c4 100644
--- a/test/cypress/integration/route/vehicle/vehicleDescriptor.spec.js
+++ b/test/cypress/integration/route/vehicle/vehicleDescriptor.spec.js
@@ -2,11 +2,11 @@ describe('Vehicle', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('deliveryAssistant');
- cy.visit(`/#/route/vehicle/7`);
+ cy.visit(`/#/route/vehicle/7/summary`);
});
it('should delete a vehicle', () => {
- cy.openActionsDescriptor();
+ cy.dataCy('descriptor-more-opts').click();
cy.get('[data-cy="delete"]').click();
cy.checkNotification('Vehicle removed');
});