From 17a18e8b49d74d46679309ebc837cc88b0ccb10b Mon Sep 17 00:00:00 2001 From: jtubau Date: Thu, 13 Mar 2025 10:06:05 +0100 Subject: [PATCH 1/7] refactor: refs #8626 improve test messages and selectors in route tests --- .../route/agency/agencyWorkCenter.spec.js | 2 +- .../route/routeExtendedList.spec.js | 32 +++++++++++-------- .../route/vehicle/vehicleDescriptor.spec.js | 4 +-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js index a3e0aac819a..79dcd6f70cb 100644 --- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js +++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js @@ -9,7 +9,7 @@ describe('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/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js index b46ce3ba257..fb2885f3581 100644 --- a/test/cypress/integration/route/routeExtendedList.spec.js +++ b/test/cypress/integration/route/routeExtendedList.spec.js @@ -8,6 +8,8 @@ describe('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('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('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('Starting date_inputDate').type('10-05-2001'); + 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('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').first().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/vehicle/vehicleDescriptor.spec.js b/test/cypress/integration/route/vehicle/vehicleDescriptor.spec.js index 64b9ca0a000..3e9c816c4b0 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'); }); From 8280efc32b1613ebd66b5b3f467afd4cb641afd4 Mon Sep 17 00:00:00 2001 From: jtubau Date: Thu, 13 Mar 2025 13:12:33 +0100 Subject: [PATCH 2/7] test: refs #8626 skip ZoneLocations tests and optimize form filling command --- test/cypress/integration/zone/zoneLocations.spec.js | 2 +- test/cypress/support/commands.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js index cdc2c778b07..3a52d276c54 100644 --- a/test/cypress/integration/zone/zoneLocations.spec.js +++ b/test/cypress/integration/zone/zoneLocations.spec.js @@ -1,4 +1,4 @@ -describe('ZoneLocations', () => { +describe.skip('ZoneLocations', () => { const data = { Warehouse: { val: 'Warehouse One', type: 'select' }, }; diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 105d021addc..1ca2b23923e 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -184,7 +184,7 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => { cy.get('.q-time .q-time__link').contains(val.x).click(); break; default: - cy.wrap(el).type(val); + cy.wrap(el).type(`{selectall}${val}`, { delay: 0 }); break; } }); From 6e240cd0ffd146924ce75932fd9a565dbbde8e9d Mon Sep 17 00:00:00 2001 From: jtubau Date: Thu, 13 Mar 2025 13:18:46 +0100 Subject: [PATCH 3/7] test: refs #8626 enable ZoneLocations tests --- test/cypress/integration/zone/zoneLocations.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/zone/zoneLocations.spec.js b/test/cypress/integration/zone/zoneLocations.spec.js index 3a52d276c54..cdc2c778b07 100644 --- a/test/cypress/integration/zone/zoneLocations.spec.js +++ b/test/cypress/integration/zone/zoneLocations.spec.js @@ -1,4 +1,4 @@ -describe.skip('ZoneLocations', () => { +describe('ZoneLocations', () => { const data = { Warehouse: { val: 'Warehouse One', type: 'select' }, }; From d21e0d6753b1e677ceaf3a41491ce6ad463fe514 Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 14 Mar 2025 11:11:52 +0100 Subject: [PATCH 4/7] refactor: refs #8626 update RouteList columns and enable AgencyWorkCenter tests --- src/pages/Route/RouteList.vue | 23 ++++--------------- .../route/agency/agencyWorkCenter.spec.js | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index dd5ee258616..4dd5ae2df92 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -58,13 +58,6 @@ const columns = computed(() => [ columnFilter: false, width: '100px', }, - { - align: 'left', - name: 'agencyModeFk', - label: t('globals.agency'), - format: ({ agencyName }) => agencyName, - cardVisible: true, - }, { label: t('globals.agency'), name: 'agencyModeFk', @@ -78,20 +71,12 @@ const columns = computed(() => [ }, }, create: true, - columnFilter: false, - visible: false, - }, - { - align: 'left', - name: 'vehicleFk', - label: t('globals.vehicle'), - format: ({ vehiclePlateNumber }) => vehiclePlateNumber, - cardVisible: true, + columnFilter: true, + visible: true, }, { name: 'vehicleFk', label: t('globals.vehicle'), - cardVisible: true, component: 'select', attrs: { url: 'vehicles', @@ -104,8 +89,8 @@ const columns = computed(() => [ }, }, create: true, - columnFilter: false, - visible: false, + columnFilter: true, + visible: true, }, { align: 'center', diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js index c0284250d8d..79dcd6f70cb 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', From a6b356a489ae66af213c879453d03b91e979807c Mon Sep 17 00:00:00 2001 From: jtubau Date: Fri, 14 Mar 2025 11:15:34 +0100 Subject: [PATCH 5/7] refactor: refs #8626 add cardVisible property to RouteList columns --- src/pages/Route/RouteList.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 4dd5ae2df92..64e3abcd5cb 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -56,6 +56,7 @@ const columns = computed(() => [ create: true, format: (row, dashIfEmpty) => dashIfEmpty(row.travelRef), columnFilter: false, + cardVisible: true, width: '100px', }, { @@ -72,6 +73,7 @@ const columns = computed(() => [ }, create: true, columnFilter: true, + cardVisible: true, visible: true, }, { @@ -90,6 +92,7 @@ const columns = computed(() => [ }, create: true, columnFilter: true, + cardVisible: true, visible: true, }, { From 46a0fb7a96cc49503bc6637346b0d2c30a78ff1b Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 17 Mar 2025 10:38:15 +0100 Subject: [PATCH 6/7] test: refs #8626 enable RouteAutonomous tests --- test/cypress/integration/route/routeAutonomous.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/cypress/integration/route/routeAutonomous.spec.js b/test/cypress/integration/route/routeAutonomous.spec.js index 08fd7d7eace..acf82bd95d6 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`; From a5716bea511c66d87ca3a6386f8e9889c132988f Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 17 Mar 2025 11:34:21 +0100 Subject: [PATCH 7/7] test: refs #8626 skip EntryDms, Entry, and EntryStockBought test suites --- test/cypress/integration/entry/entryDms.spec.js | 4 ++-- test/cypress/integration/entry/entryList.spec.js | 4 ++-- test/cypress/integration/entry/stockBought.spec.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/cypress/integration/entry/entryDms.spec.js b/test/cypress/integration/entry/entryDms.spec.js index 47dcdba9e43..06f05725866 100644 --- a/test/cypress/integration/entry/entryDms.spec.js +++ b/test/cypress/integration/entry/entryDms.spec.js @@ -1,4 +1,4 @@ -describe('EntryDms', () => { +describe.skip('EntryDms', () => { const entryId = 1; beforeEach(() => { @@ -30,7 +30,7 @@ describe('EntryDms', () => { const textAreaSelector = '.q-textarea > .q-field__inner > .q-field__control > .q-field__control-container'; cy.get( - `tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon` + `tbody :nth-child(${newFileTd}) > .text-right > .no-wrap > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`, ).click(); cy.get(textAreaSelector).clear(); diff --git a/test/cypress/integration/entry/entryList.spec.js b/test/cypress/integration/entry/entryList.spec.js index 4c4c4f00424..bdaa66f7948 100644 --- a/test/cypress/integration/entry/entryList.spec.js +++ b/test/cypress/integration/entry/entryList.spec.js @@ -1,4 +1,4 @@ -describe('Entry', () => { +describe.skip('Entry', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer'); @@ -20,7 +20,7 @@ describe('Entry', () => { ); }); - it.skip('Create entry, modify travel and add buys', () => { + it('Create entry, modify travel and add buys', () => { createEntryAndBuy(); cy.get('a[data-cy="EntryBasicData-menu-item"]').click(); selectTravel('two'); diff --git a/test/cypress/integration/entry/stockBought.spec.js b/test/cypress/integration/entry/stockBought.spec.js index 91e0d507ef7..2a8431cf0e5 100644 --- a/test/cypress/integration/entry/stockBought.spec.js +++ b/test/cypress/integration/entry/stockBought.spec.js @@ -1,4 +1,4 @@ -describe('EntryStockBought', () => { +describe.skip('EntryStockBought', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('buyer');