From 9dcad609d44d92d8d05cde07ec8e2c158e0ac25f Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Fri, 11 Jan 2019 12:41:07 +0100 Subject: [PATCH] #776 e2e de ticket.log --- e2e/helpers/selectors.js | 6 ++++++ e2e/paths/client-module/13_log.spec.js | 8 ++++---- ...s => 02_ticket_expeditions_and_log.spec.js} | 18 ++++++++++++++++-- e2e/paths/ticket-module/03_list_sale.spec.js | 12 ++++++------ 4 files changed, 32 insertions(+), 12 deletions(-) rename e2e/paths/ticket-module/{02_delete_ticket_expeditions.spec.js => 02_ticket_expeditions_and_log.spec.js} (57%) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 7df9af4091..29d8a75770 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -413,6 +413,12 @@ export default { firstDescription: 'vn-ticket-request-index > form > vn-card > div > vn-horizontal > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2)', }, + ticketLog: { + logButton: `vn-left-menu a[ui-sref="ticket.card.log"]`, + changedBy: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(1) > span.value.ng-scope.ng-binding', + actionTaken: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(1) > div > div:nth-child(3) > span.value.ng-scope.ng-binding', + id: 'vn-ticket-log > vn-log > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr > vn-td.before > vn-one:nth-child(1) > div > span.value.ng-scope.ng-binding' + }, createStateView: { stateAutocomplete: `vn-autocomplete[field="$ctrl.ticket.stateFk"]`, clearStateInputButton: `vn-autocomplete[field="$ctrl.ticket.stateFk"] > div > div > div > vn-icon > i`, diff --git a/e2e/paths/client-module/13_log.spec.js b/e2e/paths/client-module/13_log.spec.js index 03d930340b..046c281fc1 100644 --- a/e2e/paths/client-module/13_log.spec.js +++ b/e2e/paths/client-module/13_log.spec.js @@ -11,7 +11,7 @@ describe('Client log path', () => { .accessToSection('client.card.basicData'); }); - it('should update the clients name', async () => { + it('should update the clients name', async() => { let result = await nightmare .wait(selectors.clientBasicData.nameInput) .clearInput(selectors.clientBasicData.nameInput) @@ -22,7 +22,7 @@ describe('Client log path', () => { expect(result).toEqual('Data saved!'); }); - it('should navigate to the log section', async () => { + it('should navigate to the log section', async() => { let url = await nightmare .waitToClick(selectors.clientLog.logButton) .waitForURL('log') @@ -31,14 +31,14 @@ describe('Client log path', () => { expect(url.hash).toContain('log'); }); - it('should check the previous value of the last logged change', async () => { + it('should check the previous value of the last logged change', async() => { let lastModificationPreviousValue = await nightmare .waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText'); expect(lastModificationPreviousValue).toContain('DavidCharlesHaller'); }); - it('should check the current value of the last logged change', async () => { + it('should check the current value of the last logged change', async() => { let lastModificationCurrentValue = await nightmare .waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); diff --git a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js similarity index 57% rename from e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js rename to e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js index 087613b3f5..8e107adb4c 100644 --- a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js +++ b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js @@ -1,12 +1,12 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/nightmare'; -describe('Ticket Delete expeditions path', () => { +fdescribe('Ticket Delete expeditions path', () => { const nightmare = createNightmare(); beforeAll(() => { return nightmare - .loginAndModule('production', 'ticket') + .loginAndModule('developer', 'ticket') .accessToSearchResult('id:1') .accessToSection('ticket.card.expedition'); }); @@ -23,4 +23,18 @@ describe('Ticket Delete expeditions path', () => { expect(result).toEqual(3); }); + + it(`should confirm the expedition deleted is shown now in the ticket log`, async() => { + const changedBy = await nightmare + .waitToClick(selectors.ticketLog.logButton) + .waitToGetProperty(selectors.ticketLog.changedBy, 'innerText'); + const actionTaken = await nightmare + .waitToGetProperty(selectors.ticketLog.actionTaken, 'innerText'); + const id = await nightmare + .waitToGetProperty(selectors.ticketLog.id, 'innerText'); + + expect(changedBy).toEqual('production'); + expect(actionTaken).toEqual('Deletes'); + expect(id).toEqual('3'); + }); }); diff --git a/e2e/paths/ticket-module/03_list_sale.spec.js b/e2e/paths/ticket-module/03_list_sale.spec.js index bd7b485c66..2813bb9880 100644 --- a/e2e/paths/ticket-module/03_list_sale.spec.js +++ b/e2e/paths/ticket-module/03_list_sale.spec.js @@ -11,42 +11,42 @@ describe('Ticket List sale path', () => { .accessToSection('ticket.card.sale'); }); - it('should confirm the first ticket sale contains the colour', async () => { + it('should confirm the first ticket sale contains the colour', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText'); expect(value).toContain('Red'); }); - it('should confirm the first ticket sale contains the lenght', async () => { + it('should confirm the first ticket sale contains the lenght', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText'); expect(value).toContain('3'); }); - it('should confirm the first ticket sale contains the price', async () => { + it('should confirm the first ticket sale contains the price', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText'); expect(value).toContain('1.30'); }); - it('should confirm the first ticket sale contains the discount', async () => { + it('should confirm the first ticket sale contains the discount', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText'); expect(value).toContain('0 %'); }); - it('should confirm the first ticket sale contains the total import', async () => { + it('should confirm the first ticket sale contains the total import', async() => { const value = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); expect(value).toContain('19.50'); }); - it('should navigate to the catalog by pressing the new item button', async () => { + it('should navigate to the catalog by pressing the new item button', async() => { const url = await nightmare .waitToClick(selectors.ticketSales.newItemButton) .waitForURL('/catalog')