#777 e2e item.log

This commit is contained in:
Carlos Jimenez Ruiz 2019-03-20 11:47:00 +01:00
parent 9ef74bbf7a
commit c13dba24b9
2 changed files with 10 additions and 11 deletions

View File

@ -293,8 +293,8 @@ export default {
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]',
},
itemLog: {
firstLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(1) > vn-td > vn-one:nth-child(3) > div span:nth-child(3)',
thirdLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(4) > vn-td > vn-one:nth-child(3) > div span:nth-child(3)',
fourthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(4) > 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(3)',
},
ticketSummary: {
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',

View File

@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
// #777 e2e item.log
xdescribe('Item log path', () => {
describe('Item log path', () => {
const nightmare = createNightmare();
beforeAll(() => {
nightmare
@ -54,20 +53,20 @@ xdescribe('Item log path', () => {
const url = await nightmare
.accessToSearchResult('Knowledge artifact')
.accessToSection('item.card.log')
.wait(selectors.itemLog.firstLineCreatedProperty)
.waitForURL('/log')
.parsedUrl();
expect(url.hash).toContain('/log');
});
it(`should search for the created item and navigate to it's log section`, async() => {
const firstLineCreatedProperty = await nightmare
.waitToGetProperty(selectors.itemLog.firstLineCreatedProperty, 'innerText');
const fourthLineCreatedProperty = await nightmare
.waitToGetProperty(selectors.itemLog.fourthLineCreatedProperty, 'innerText');
const thirdLineCreatedProperty = await nightmare
.waitToGetProperty(selectors.itemLog.thirdLineCreatedProperty, 'innerText');
const fifthLineCreatedProperty = await nightmare
.waitToGetProperty(selectors.itemLog.fifthLineCreatedProperty, 'innerText');
expect(firstLineCreatedProperty).toContain('Knoledge artifact');
expect(thirdLineCreatedProperty).toContain('nos e que');
expect(fourthLineCreatedProperty).toEqual('Knowledge artifact');
expect(fifthLineCreatedProperty).toEqual('5080000');
});
});