diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 2e4384b40..ccc1b7d1d 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -560,7 +560,7 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF (16, 1, 7, 1, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 106, 'Many Places', 126, NULL, 0, 3, CURDATE()), (17, 1, 7, 2, 6, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 106, 'Many Places', 126, NULL, 0, 3, CURDATE()), (18, 1, 4, 4, 4, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 108, 'Cerebro', 128, NULL, 0, 12, CURDATE()), - (19, 1, 5, 5, 3, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 109, 'Somewhere in Thailand', 129, NULL, 1, 13, CURDATE()), + (19, 1, 5, 5, NULL, CURDATE(), DATE_ADD(CURDATE(), INTERVAL + 1 DAY), 109, 'Somewhere in Thailand', 129, NULL, 1, 13, CURDATE()), (20, 1, 5, 5, 3, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Thailand', 129, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (21, NULL, 5, 5, 5, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Holland', 102, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), (22, NULL, 5, 5, 5, DATE_ADD(CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 109, 'Somewhere in Japan', 103, NULL, 0, 13, DATE_ADD(CURDATE(), INTERVAL +1 MONTH)), diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index e1b6b1c65..93755d724 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -544,6 +544,7 @@ export default { logButton: 'vn-left-menu a[ui-sref="ticket.card.log"]', changedBy: 'vn-ticket-log > vn-log vn-tr:nth-child(1) > vn-td:nth-child(2) > span', actionTaken: 'vn-ticket-log > vn-log vn-td:nth-child(1) > div > div:nth-child(3) > span.value', + changes: 'vn-ticket-log vn-data-viewer vn-tbody > vn-tr > vn-td:nth-child(7)', id: 'vn-ticket-log > vn-log vn-td.before > vn-one:nth-child(1) > div > span.value' }, ticketService: { @@ -852,6 +853,13 @@ export default { createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr', upload: 'vn-travel-thermograph-create button[type=submit]' }, + zoneIndex: { + searchResult: 'vn-zone-index a.vn-tr', + }, + zoneDescriptor: { + menu: 'vn-zone-descriptor vn-icon-button[vn-popover="menu"]', + deleteZone: 'slot-menu vn-item[ng-click="$ctrl.onDelete()"]' + }, zoneBasicData: { name: 'vn-zone-basic-data vn-textfield[ng-model="$ctrl.zone.name"]', agency: 'vn-zone-basic-data vn-autocomplete[ng-model="$ctrl.zone.agencyModeFk"]', diff --git a/e2e/paths/11-zone/02_descriptor.spec.js b/e2e/paths/11-zone/02_descriptor.spec.js new file mode 100644 index 000000000..1de84d601 --- /dev/null +++ b/e2e/paths/11-zone/02_descriptor.spec.js @@ -0,0 +1,42 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Zone descriptor path', () => { + let browser; + let page; + + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('deliveryBoss', 'zone'); + await page.accessToSearchResult('13'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should eliminate the zone using the descriptor option', async() => { + await page.waitToClick(selectors.zoneDescriptor.menu); + await page.waitToClick(selectors.zoneDescriptor.deleteZone); + await page.respondToDialog('accept'); + await page.waitForState('zone.index'); + }); + + it('should search for the deleted zone to find no results', async() => { + await page.doSearch('13'); + const count = await page.countElement(selectors.zoneIndex.searchResult); + + expect(count).toEqual(0); + }); + + it('should check the ticket whom lost the zone and see evidence on the logs', async() => { + await page.waitToClick(selectors.globalItems.homeButton); + await page.selectModule('ticket'); + await page.accessToSearchResult('20'); + await page.accessToSection('ticket.card.log'); + const lastChanges = await page.waitToGetProperty(selectors.ticketLog.changes, 'innerText'); + + expect(lastChanges).toContain('Arreglar'); + }); +});