From df9373adeda751f5431797d6e6f9d52be06e0c31 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Wed, 19 May 2021 14:14:04 +0200 Subject: [PATCH] e2e amends due to html changes on logs --- e2e/helpers/selectors.js | 7 +++---- e2e/paths/02-client/07_edit_web_access.spec.js | 4 ++-- e2e/paths/02-client/13_log.spec.js | 4 ++-- e2e/paths/05-ticket/02_expeditions_and_log.spec.js | 11 ++++------- e2e/paths/10-travel/01_create.spec.js | 2 ++ e2e/paths/13-supplier/02_basic_data.spec.js | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 042528c92f..69425a1b79 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -448,7 +448,7 @@ export default { }, itemLog: { anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr', - fifthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(5) > vn-td > vn-one:nth-child(3) > div span:nth-child(3)', + fifthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(5) > vn-td > vn-one:nth-child(3) > div span:nth-child(2)', }, ticketSummary: { header: 'vn-ticket-summary > vn-card > h5', @@ -630,10 +630,9 @@ export default { ticketLog: { firstTD: 'vn-ticket-log vn-table vn-td:nth-child(1)', 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', + firstLogEntry: 'vn-ticket-log vn-data-viewer vn-tbody vn-tr', 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' + id: 'vn-ticket-log vn-tr:nth-child(1) vn-one:nth-child(1) span' }, ticketService: { addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button', diff --git a/e2e/paths/02-client/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js index 82a8bb843d..b1af956386 100644 --- a/e2e/paths/02-client/07_edit_web_access.spec.js +++ b/e2e/paths/02-client/07_edit_web_access.spec.js @@ -50,7 +50,7 @@ describe('Client Edit web access path', () => { let lastModificationCurrentValue = await page .waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); - expect(lastModificationPreviousValue).toEqual('name: BruceBanner active: true'); - expect(lastModificationCurrentValue).toEqual('name: Hulk active: false'); + expect(lastModificationPreviousValue).toEqual('name BruceBanner active true'); + expect(lastModificationCurrentValue).toEqual('name Hulk active false'); }); }); diff --git a/e2e/paths/02-client/13_log.spec.js b/e2e/paths/02-client/13_log.spec.js index 1bb859e22a..9b047a47c4 100644 --- a/e2e/paths/02-client/13_log.spec.js +++ b/e2e/paths/02-client/13_log.spec.js @@ -43,7 +43,7 @@ describe('Client log path', () => { let lastModificationCurrentValue = await page. waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); - expect(lastModificationPreviousValue).toEqual('name: DavidCharlesHaller'); - expect(lastModificationCurrentValue).toEqual('name: this is a test'); + expect(lastModificationPreviousValue).toEqual('name DavidCharlesHaller'); + expect(lastModificationCurrentValue).toEqual('name this is a test'); }); }); diff --git a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js index e4f8a77546..0e6482c946 100644 --- a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js +++ b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js @@ -31,17 +31,14 @@ describe('Ticket expeditions and log path', () => { it(`should confirm the expedition deleted is shown now in the ticket log`, async() => { await page.accessToSection('ticket.card.log'); - const changedBy = await page - .waitToGetProperty(selectors.ticketLog.changedBy, 'innerText'); - - const actionTaken = await page - .waitToGetProperty(selectors.ticketLog.actionTaken, 'innerText'); + const firstLogEntry = await page + .waitToGetProperty(selectors.ticketLog.firstLogEntry, 'innerText'); const id = await page .waitToGetProperty(selectors.ticketLog.id, 'innerText'); - expect(changedBy).toEqual('production'); - expect(actionTaken).toEqual('Deletes'); + expect(firstLogEntry).toContain('production'); + expect(firstLogEntry).toContain('Deletes'); expect(id).toEqual('2'); }); }); diff --git a/e2e/paths/10-travel/01_create.spec.js b/e2e/paths/10-travel/01_create.spec.js index 65540d4336..6f5956377c 100644 --- a/e2e/paths/10-travel/01_create.spec.js +++ b/e2e/paths/10-travel/01_create.spec.js @@ -35,6 +35,8 @@ describe('Travel create path', () => { }); it('should check the user was redirected to the travel basic data upon creation', async() => { + // backup code for further intermitences still on track. + // await page.screenshot({path: 'e2e/paths/10-travel/error.jpeg', type: 'jpeg'}); await page.waitForState('travel.card.basicData'); }); diff --git a/e2e/paths/13-supplier/02_basic_data.spec.js b/e2e/paths/13-supplier/02_basic_data.spec.js index 319130b983..2bc94402b3 100644 --- a/e2e/paths/13-supplier/02_basic_data.spec.js +++ b/e2e/paths/13-supplier/02_basic_data.spec.js @@ -65,6 +65,6 @@ describe('Supplier basic data path', () => { it('should check the changes have been recorded', async() => { const result = await page.waitToGetProperty('#newInstance:nth-child(3)', 'innerText'); - expect(result).toEqual('note: Some notes'); + expect(result).toEqual('note Some notes'); }); });