#777 e2e item.log unfinished

This commit is contained in:
Carlos Jimenez Ruiz 2019-03-20 08:23:12 +01:00
parent d7d8bff92b
commit f411b11de6
2 changed files with 77 additions and 0 deletions

View File

@ -292,6 +292,10 @@ export default {
fifthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(5) > vn-td.balance', fifthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(5) > vn-td.balance',
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', 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)',
},
ticketSummary: { ticketSummary: {
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',

View File

@ -0,0 +1,73 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
// #777 e2e item.log
xdescribe('Item log path', () => {
const nightmare = createNightmare();
beforeAll(() => {
nightmare
.loginAndModule('developer', 'item');
});
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
const result = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Knowledge artifact')
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0)
.countElement(selectors.itemsIndex.searchResult);
expect(result).toEqual(0);
});
it('should access to the create item view by clicking the create floating button', async() => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton)
.parsedUrl();
expect(url.hash).toEqual('#!/item/create');
});
it('should create the Knowledge artifact item', async() => {
const result = await nightmare
.write(selectors.itemCreateView.temporalName, 'Knowledge artifact')
.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo')
.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares')
.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand')
.waitToClick(selectors.itemCreateView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it('should return to the items index by clicking the return to items button', async() => {
const url = await nightmare
.waitToClick(selectors.itemBasicData.goToItemIndexButton)
.wait(selectors.itemsIndex.createItemButton)
.waitForURL('#!/item/index')
.parsedUrl();
expect(url.hash).toContain('#!/item/index');
});
it(`should search for the created item and navigate to it's log section`, async() => {
const url = await nightmare
.accessToSearchResult('Knowledge artifact')
.accessToSection('item.card.log')
.wait(selectors.itemLog.firstLineCreatedProperty)
.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 thirdLineCreatedProperty = await nightmare
.waitToGetProperty(selectors.itemLog.thirdLineCreatedProperty, 'innerText');
expect(firstLineCreatedProperty).toContain('Knoledge artifact');
expect(thirdLineCreatedProperty).toContain('nos e que');
});
});