#776 e2e de ticket.log

This commit is contained in:
Carlos Jimenez 2019-01-11 12:41:07 +01:00
parent ce0d80f019
commit 9dcad609d4
4 changed files with 32 additions and 12 deletions

View File

@ -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`,

View File

@ -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');

View File

@ -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');
});
});

View File

@ -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')