Merge branch 'e2eFixes' of https://gitea.verdnatura.es/verdnatura/salix into e2eFixes
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2020-03-24 17:27:55 +01:00
commit 2ec1a5d450
48 changed files with 109 additions and 317 deletions

View File

@ -416,12 +416,6 @@ let actions = {
let builtSelector = await this.selectorFormater(selector); let builtSelector = await this.selectorFormater(selector);
await this.waitToClick(selector); await this.waitToClick(selector);
await this.waitForSelector(selector => {
document
.querySelector(`${selector} vn-drop-down`).$ctrl.content
.querySelectorAll('li');
}, selector);
await this.write('.vn-drop-down.shown vn-textfield', searchValue); await this.write('.vn-drop-down.shown vn-textfield', searchValue);
try { try {

View File

@ -102,15 +102,11 @@ describe('Client create path', async() => {
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton); await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton); await page.wait(selectors.clientsIndex.createClientButton);
let url = await page.expectURL('#!/client/index'); await page.waitForState('client.index');
expect(url).toBe(true);
}); });
it(`should search for the user Carol Danvers to confirm it exists`, async() => { it(`should search for the user Carol Danvers to confirm it exists`, async() => {
await page.accessToSearchResult('Carol Danvers'); await page.accessToSearchResult('Carol Danvers');
let url = await page.expectURL('#!/client/114/summary'); await page.waitForState('client.card.summary');
expect(url).toBe(true);
}); });
}); });

View File

@ -36,9 +36,7 @@ describe('Client Edit fiscalData path', () => {
it(`should click on the fiscal data button`, async() => { it(`should click on the fiscal data button`, async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton); await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
let url = await page.expectURL('fiscal-data'); await page.waitForState('client.card.fiscalData');
expect(url).toBe(true);
}); });
it('should not be able to edit the verified data checkbox', async() => { it('should not be able to edit the verified data checkbox', async() => {
@ -124,9 +122,7 @@ describe('Client Edit fiscalData path', () => {
// confirm all addresses have now EQtax checked step 1 // confirm all addresses have now EQtax checked step 1
it(`should click on the addresses button to access to the client's addresses`, async() => { it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton); await page.waitToClick(selectors.clientAddresses.addressesButton);
let url = await page.expectURL('/address/index'); await page.waitForState('client.card.address.index');
expect(url).toBe(true);
}); });
// confirm all addresses have now EQtax checked step 2 // confirm all addresses have now EQtax checked step 2
@ -261,9 +257,7 @@ describe('Client Edit fiscalData path', () => {
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1 // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
it(`should click on the addresses button to access to the client's addresses`, async() => { it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton); await page.waitToClick(selectors.clientAddresses.addressesButton);
let url = await page.expectURL('/address/index'); await page.waitForState('client.card.address.index');
expect(url).toBe(true);
}); });
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2 // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2

View File

@ -18,9 +18,7 @@ describe('Client Add address path', () => {
it(`should click on the add new address button to access to the new address form`, async() => { it(`should click on the add new address button to access to the new address form`, async() => {
await page.waitToClick(selectors.clientAddresses.createAddress); await page.waitToClick(selectors.clientAddresses.createAddress);
let url = await page.expectURL('address/create'); await page.waitForState('client.card.address.create');
expect(url).toBe(true);
}); });
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => { it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
@ -72,9 +70,7 @@ describe('Client Add address path', () => {
}); });
it(`should navigate back to the addresses index`, async() => { it(`should navigate back to the addresses index`, async() => {
let url = await page.expectURL('/address/index'); await page.waitForState('client.card.address.index');
expect(url).toBe(true);
}); });
it(`should confirm the new address exists and it's the default one`, async() => { it(`should confirm the new address exists and it's the default one`, async() => {
@ -101,9 +97,7 @@ describe('Client Add address path', () => {
it(`should click on the edit icon of the default address`, async() => { it(`should click on the edit icon of the default address`, async() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand'); await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
await page.waitToClick(selectors.clientAddresses.firstEditAddress); await page.waitToClick(selectors.clientAddresses.firstEditAddress);
let url = await page.expectURL('/edit'); await page.waitForState('client.card.address.edit');
expect(url).toBe(true);
}); });
it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => { it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => {
@ -119,8 +113,6 @@ describe('Client Add address path', () => {
await page.waitForSelector('#shapes .shown', {hidden: true}); await page.waitForSelector('#shapes .shown', {hidden: true});
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton); await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
await page.waitToClick('.vn-confirm.shown button[response="accept"]'); await page.waitToClick('.vn-confirm.shown button[response="accept"]');
let url = await page.expectURL('address/index'); await page.waitForState('client.card.address.index');
expect(url).toBe(true);
}); });
}); });

View File

@ -19,9 +19,7 @@ describe('Client add address notes path', () => {
it(`should click on the edit icon of the default address`, async() => { it(`should click on the edit icon of the default address`, async() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street'); await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
await page.waitToClick(selectors.clientAddresses.firstEditAddress); await page.waitToClick(selectors.clientAddresses.firstEditAddress);
let url = await page.expectURL('/edit'); await page.waitForState('client.card.address.edit');
expect(url).toBe(true);
}); });
it('should not save a description without observation type', async() => { it('should not save a description without observation type', async() => {

View File

@ -17,16 +17,12 @@ describe('Client Add notes path', () => {
}); });
it(`should reach the notes index`, async() => { it(`should reach the notes index`, async() => {
let url = await page.expectURL('/note'); await page.waitForState('client.card.note.index');
expect(url).toBe(true);
}); });
it(`should click on the add note button`, async() => { it(`should click on the add note button`, async() => {
await page.waitToClick(selectors.clientNotes.addNoteFloatButton); await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
let url = await page.expectURL('/note/create'); await page.waitForState('client.card.note.create');
expect(url).toBe(true);
}); });
it(`should create a note`, async() => { it(`should create a note`, async() => {

View File

@ -18,9 +18,7 @@ describe('Client Add credit path', () => {
it(`should click on the add credit button`, async() => { it(`should click on the add credit button`, async() => {
await page.waitToClick(selectors.clientCredit.addCreditFloatButton); await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
let url = await page.expectURL('/credit/create'); await page.waitForState('client.card.credit.create');
expect(url).toBe(true);
}); });
it(`should edit the credit`, async() => { it(`should edit the credit`, async() => {

View File

@ -18,9 +18,7 @@ describe('Client Add greuge path', () => {
it(`should click on the add greuge button`, async() => { it(`should click on the add greuge button`, async() => {
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton); await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
let url = await page.expectURL('greuge/create'); await page.waitForState('client.card.greuge.create');
expect(url).toBe(true);
}); });
it(`should receive an error if all fields are empty but date and type on submit`, async() => { it(`should receive an error if all fields are empty but date and type on submit`, async() => {

View File

@ -27,9 +27,7 @@ describe('Client log path', () => {
it('should navigate to the log section', async() => { it('should navigate to the log section', async() => {
await page.waitToClick(selectors.clientLog.logButton); await page.waitToClick(selectors.clientLog.logButton);
let url = await page.expectURL('log'); await page.waitForState('client.card.log');
expect(url).toBe(true);
}); });
it('should check the previous value of the last logged change', async() => { it('should check the previous value of the last logged change', async() => {
@ -46,7 +44,6 @@ describe('Client log path', () => {
let lastModificationCurrentValue = await page. let lastModificationCurrentValue = await page.
waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText'); waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText');
expect(lastModificationPreviousValue).toEqual('name: DavidCharlesHaller'); expect(lastModificationPreviousValue).toEqual('name: DavidCharlesHaller');
expect(lastModificationCurrentValue).toEqual('name: this is a test'); expect(lastModificationCurrentValue).toEqual('name: this is a test');
}); });

View File

@ -41,9 +41,7 @@ describe('Client balance path', () => {
it('should click the new payment button', async() => { it('should click the new payment button', async() => {
await page.closePopup(); await page.closePopup();
await page.reloadSection('client.card.balance.index'); await page.reloadSection('client.card.balance.index');
let url = await page.expectURL('/balance'); await page.waitForState('client.card.balance.index');
expect(url).toBe(true);
}); });
it('should create a new payment that clears the debt', async() => { it('should create a new payment that clears the debt', async() => {
@ -110,17 +108,13 @@ describe('Client balance path', () => {
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.clientsButton); await page.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton); await page.wait(selectors.clientsIndex.createClientButton);
let url = await page.expectURL('#!/client/index'); await page.waitForState('client.index');
expect(url).toBe(true);
}); });
it('should now search for the user Petter Parker', async() => { it('should now search for the user Petter Parker', async() => {
await page.accessToSearchResult('Petter Parker'); await page.accessToSearchResult('Petter Parker');
await page.waitToClick(selectors.clientBalance.balanceButton); await page.waitToClick(selectors.clientBalance.balanceButton);
let url = await page.expectURL('/balance'); await page.waitForState('client.card.balance.index');
expect(url).toBe(true);
}); });
it('should not be able to click the new payment button as it isnt present', async() => { it('should not be able to click the new payment button as it isnt present', async() => {

View File

@ -17,9 +17,7 @@ describe('Client summary path', () => {
}); });
it('should reach the first route summary section', async() => { it('should reach the first route summary section', async() => {
let url = await page.expectURL('#!/client/102/summary'); await page.waitForState('client.card.summary');
expect(url).toBe(true);
}); });
it('should display details from the client on the header', async() => { it('should display details from the client on the header', async() => {

View File

@ -16,9 +16,7 @@ describe('Worker summary path', () => {
}); });
it('should reach the employee summary section', async() => { it('should reach the employee summary section', async() => {
const url = await page.expectURL('#!/worker/3/summary'); await page.waitForState('worker.card.summary');
expect(url).toBe(true);
}); });
it('should check the summary contains the name and userName on the header', async() => { it('should check the summary contains the name and userName on the header', async() => {

View File

@ -316,16 +316,12 @@ describe('Worker time control path', () => {
it('should search for a worker and access to its summary', async() => { it('should search for a worker and access to its summary', async() => {
await page.accessToSearchResult('HankPym'); await page.accessToSearchResult('HankPym');
let url = await page.expectURL('/summary'); await page.waitForState('worker.card.summary');
expect(url).toBe(true);
}); });
it('should access to the time control section', async() => { it('should access to the time control section', async() => {
await page.accessToSection('worker.card.timeControl'); await page.accessToSection('worker.card.timeControl');
let url = await page.expectURL('/time-control'); await page.waitForState('worker.card.timeControl');
expect(url).toBe(true);
}); });
it('should lovingly scan in Hank Pym', async() => { it('should lovingly scan in Hank Pym', async() => {

View File

@ -103,9 +103,7 @@ describe('Item summary path', () => {
it(`should navigate to the one of the items detailed section`, async() => { it(`should navigate to the one of the items detailed section`, async() => {
await page.accessToSearchResult('Melee weapon combat fist 15cm'); await page.accessToSearchResult('Melee weapon combat fist 15cm');
let url = await page.expectURL('summary'); await page.waitForState('item.card.summary');
expect(url).toBe(true);
}); });
it(`should check the descritor edit button is not visible for employee`, async() => { it(`should check the descritor edit button is not visible for employee`, async() => {

View File

@ -27,23 +27,17 @@ describe('Item Create/Clone path', () => {
it('should access to the create item view by clicking the create floating button', async() => { it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton); await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create'); await page.waitForState('item.create');
expect(url).toBe(true);
}); });
it('should return to the item index by clickig the cancel button', async() => { it('should return to the item index by clickig the cancel button', async() => {
await page.waitToClick(selectors.itemCreateView.cancelButton); await page.waitToClick(selectors.itemCreateView.cancelButton);
let url = await page.expectURL('#!/item/index'); await page.waitForState('item.index');
expect(url).toBe(true);
}); });
it('should now access to the create item view by clicking the create floating button', async() => { it('should now access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton); await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create'); await page.waitForState('item.create');
expect(url).toBe(true);
}); });
it('should create the Infinity Gauntlet item', async() => { it('should create the Infinity Gauntlet item', async() => {
@ -87,9 +81,7 @@ describe('Item Create/Clone path', () => {
it('should return to the items index by clicking the return to items button', async() => { it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton); await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton); await page.wait(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/index'); await page.waitForState('item.index');
expect(url).toBe(true);
}); });
it(`should search for the item Infinity Gauntlet`, async() => { it(`should search for the item Infinity Gauntlet`, async() => {
@ -106,9 +98,7 @@ describe('Item Create/Clone path', () => {
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet'); await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet');
await page.waitToClick(selectors.itemsIndex.searchResultCloneButton); await page.waitToClick(selectors.itemsIndex.searchResultCloneButton);
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton); await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
let url = await page.expectURL('tags'); await page.waitForState('item.tags');
expect(url).toBe(true);
}); });
it('should search for the item Infinity Gauntlet and find two', async() => { it('should search for the item Infinity Gauntlet and find two', async() => {

View File

@ -34,9 +34,7 @@ describe('Item regularize path', () => {
it('should search for an specific item', async() => { it('should search for an specific item', async() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm'); await page.accessToSearchResult('Ranged weapon pistol 9mm');
let url = await page.expectURL('/summary'); await page.waitForState('item.card.summary');
expect(url).toBe(true);
}); });
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => { it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
@ -63,9 +61,7 @@ describe('Item regularize path', () => {
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}), page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
page.waitToClick(selectors.globalItems.ticketsButton) page.waitToClick(selectors.globalItems.ticketsButton)
]); ]);
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should clear the user local settings now', async() => { it('should clear the user local settings now', async() => {
@ -80,9 +76,7 @@ describe('Item regularize path', () => {
it('should search for the ticket with alias missing', async() => { it('should search for the ticket with alias missing', async() => {
await page.keyboard.press('Escape'); await page.keyboard.press('Escape');
await page.accessToSearchResult('missing'); await page.accessToSearchResult('missing');
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it(`should check the ticket sale quantity is showing a negative value`, async() => { it(`should check the ticket sale quantity is showing a negative value`, async() => {
@ -104,16 +98,12 @@ describe('Item regularize path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.itemsButton); await page.waitToClick(selectors.globalItems.itemsButton);
let url = await page.expectURL('#!/item/index'); await page.waitForState('item.index');
expect(url).toBe(true);
}); });
it('should search for the item once again', async() => { it('should search for the item once again', async() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm'); await page.accessToSearchResult('Ranged weapon pistol 9mm');
let url = await page.expectURL('/summary'); await page.waitForState('item.card.summary');
expect(url).toBe(true);
}); });
it('should regularize the item once more', async() => { it('should regularize the item once more', async() => {
@ -135,16 +125,12 @@ describe('Item regularize path', () => {
page.waitToClick(selectors.globalItems.ticketsButton) page.waitToClick(selectors.globalItems.ticketsButton)
]); ]);
await page.waitForTransitionEnd('vn-searchbar'); await page.waitForTransitionEnd('vn-searchbar');
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should search for the ticket with id 25 once again', async() => { it('should search for the ticket with id 25 once again', async() => {
await page.accessToSearchResult('25'); await page.accessToSearchResult('25');
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it(`should check the ticket contains now two sales`, async() => { it(`should check the ticket contains now two sales`, async() => {

View File

@ -25,9 +25,7 @@ describe('Item log path', () => {
it('should access to the create item view by clicking the create floating button', async() => { it('should access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton); await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create'); await page.waitForState('item.create');
expect(url).toBe(true);
}); });
it('should create the Knowledge artifact item', async() => { it('should create the Knowledge artifact item', async() => {
@ -44,17 +42,13 @@ describe('Item log path', () => {
it('should return to the items index by clicking the return to items button', async() => { it('should return to the items index by clicking the return to items button', async() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton); await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton); await page.wait(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/index'); await page.waitForState('item.index');
expect(url).toBe(true);
}); });
it(`should search for the created item and navigate to it's log section`, async() => { it(`should search for the created item and navigate to it's log section`, async() => {
await page.accessToSearchResult('Knowledge artifact'); await page.accessToSearchResult('Knowledge artifact');
await page.accessToSection('item.card.log'); await page.accessToSection('item.card.log');
let url = await page.expectURL('/log'); await page.waitForState('item.card.log');
expect(url).toBe(true);
}); });
it(`should confirm the log is showing 5 entries`, async() => { it(`should confirm the log is showing 5 entries`, async() => {

View File

@ -16,9 +16,7 @@ describe('Item request path', () => {
}); });
it('should reach the item request section', async() => { it('should reach the item request section', async() => {
const result = await page.expectURL('/item/request'); await page.waitForState('item.request');
expect(result).toBe(true);
}); });
it('should fill the id and quantity then check the concept was updated', async() => { it('should fill the id and quantity then check the concept was updated', async() => {

View File

@ -21,9 +21,7 @@ describe('Ticket Create new tracking state path', () => {
it('should access to the create state view by clicking the create floating button', async() => { it('should access to the create state view by clicking the create floating button', async() => {
await page.waitToClick(selectors.ticketTracking.createStateButton); await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForSelector(selectors.createStateView.state, {visible: true}); await page.waitForSelector(selectors.createStateView.state, {visible: true});
let url = await page.expectURL('tracking/edit'); await page.waitForState('ticket.card.tracking.edit');
expect(url).toBe(true);
}); });
it(`should attempt create a new state but receive an error if state is empty`, async() => { it(`should attempt create a new state but receive an error if state is empty`, async() => {
@ -51,9 +49,7 @@ describe('Ticket Create new tracking state path', () => {
it('should now access to the create state view by clicking the create floating button', async() => { it('should now access to the create state view by clicking the create floating button', async() => {
await page.waitToClick(selectors.ticketTracking.createStateButton); await page.waitToClick(selectors.ticketTracking.createStateButton);
let url = await page.expectURL('tracking/edit'); await page.waitForState('ticket.card.tracking.edit');
expect(url).toBe(true);
}); });
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => { it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {

View File

@ -68,9 +68,7 @@ describe('Ticket Edit basic data path', () => {
it(`should click next`, async() => { it(`should click next`, async() => {
await page.waitToClick(selectors.ticketBasicData.nextStepButton); await page.waitToClick(selectors.ticketBasicData.nextStepButton);
let url = await page.expectURL('data/step-two'); await page.waitForState('ticket.card.basicData.stepTwo');
expect(url).toBe(true);
}); });
it(`should have a price diference`, async() => { it(`should have a price diference`, async() => {
@ -83,8 +81,6 @@ describe('Ticket Edit basic data path', () => {
it(`should select a new reason for the changes made then click on finalize`, async() => { it(`should select a new reason for the changes made then click on finalize`, async() => {
await page.waitToClick(selectors.ticketBasicData.chargesReason); await page.waitToClick(selectors.ticketBasicData.chargesReason);
await page.waitToClick(selectors.ticketBasicData.finalizeButton); await page.waitToClick(selectors.ticketBasicData.finalizeButton);
let url = await page.expectURL('summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
}); });

View File

@ -41,9 +41,7 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton); await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should confirm the ticket 11 was added to thursday', async() => { it('should confirm the ticket 11 was added to thursday', async() => {
@ -57,16 +55,12 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton); await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should now search for the ticket 11', async() => { it('should now search for the ticket 11', async() => {
await page.accessToSearchResult('11'); await page.accessToSearchResult('11');
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it('should add the ticket to saturday turn using the descriptor more menu', async() => { it('should add the ticket to saturday turn using the descriptor more menu', async() => {
@ -82,9 +76,7 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton); await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should confirm the ticket 11 was added on saturday', async() => { it('should confirm the ticket 11 was added on saturday', async() => {

View File

@ -30,13 +30,10 @@ describe('Ticket purchase request path', () => {
}); });
it('should have been redirected to the request index', async() => { it('should have been redirected to the request index', async() => {
let url = await page.expectURL('/request'); await page.waitForState('ticket.card.request.index');
expect(url).toBe(true);
}); });
it(`should edit the third request quantity as it's state is still new`, async() => { it(`should edit the third request quantity as it's state is still new`, async() => {
await page.waitFor(2000); // looks like it needs more than a single second some times to load
await page.write(selectors.ticketRequests.thirdRequestQuantity, '9'); await page.write(selectors.ticketRequests.thirdRequestQuantity, '9');
await page.keyboard.press('Enter'); await page.keyboard.press('Enter');
const result = await page.waitForLastSnackbar(); const result = await page.waitForLastSnackbar();

View File

@ -28,7 +28,7 @@ xdescribe('Ticket diary path', () => {
it(`should click on the search result to access to the ticket summary`, async() => { it(`should click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave'); await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
await page.waitToClick(selectors.ticketsIndex.searchResult); await page.waitToClick(selectors.ticketsIndex.searchResult);
let url = await page.expectURL('/summary'); let url = await page.expectURL('/summary'); // use waitForState instead
expect(url).toBe(true); expect(url).toBe(true);
}); });
@ -37,7 +37,7 @@ xdescribe('Ticket diary path', () => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId); await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitForTransitionEnd('.vn-popover'); await page.waitForTransitionEnd('.vn-popover');
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton); await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
let url = await page.expectURL('/diary'); let url = await page.expectURL('/diary'); // use waitForState instead
expect(url).toBe(true); expect(url).toBe(true);
}); });

View File

@ -18,9 +18,7 @@ describe('Ticket descriptor path', () => {
describe('Delete ticket', () => { describe('Delete ticket', () => {
it('should search for an specific ticket', async() => { it('should search for an specific ticket', async() => {
await page.accessToSearchResult('18'); await page.accessToSearchResult('18');
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it(`should update the shipped hour using the descriptor menu`, async() => { it(`should update the shipped hour using the descriptor menu`, async() => {
@ -50,9 +48,7 @@ describe('Ticket descriptor path', () => {
}); });
it('should have been relocated to the ticket index', async() => { it('should have been relocated to the ticket index', async() => {
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it(`should search for the deleted ticket and check it's date`, async() => { it(`should search for the deleted ticket and check it's date`, async() => {
@ -68,9 +64,7 @@ describe('Ticket descriptor path', () => {
describe('add stowaway', () => { describe('add stowaway', () => {
it('should search for a ticket', async() => { it('should search for a ticket', async() => {
await page.accessToSearchResult('16'); await page.accessToSearchResult('16');
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it('should open the add stowaway dialog', async() => { it('should open the add stowaway dialog', async() => {
@ -101,9 +95,7 @@ describe('Ticket descriptor path', () => {
it(`should navigate back to the added ticket using the descriptors ship button`, async() => { it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
await page.waitToClick(selectors.ticketDescriptor.shipButton); await page.waitToClick(selectors.ticketDescriptor.shipButton);
let url = await page.expectURL('#!/ticket/17/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it('should delete the stowaway', async() => { it('should delete the stowaway', async() => {
@ -127,9 +119,7 @@ describe('Ticket descriptor path', () => {
await page.loginAndModule('adminBoss', 'ticket'); await page.loginAndModule('adminBoss', 'ticket');
await page.accessToSearchResult(invoiceableTicketId); await page.accessToSearchResult(invoiceableTicketId);
let url = await page.expectURL(`ticket/${invoiceableTicketId}/summary`); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => { it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {

View File

@ -17,9 +17,7 @@ describe('Ticket create path', () => {
it('should open the new ticket form', async() => { it('should open the new ticket form', async() => {
await page.waitToClick(selectors.ticketsIndex.newTicketButton); await page.waitToClick(selectors.ticketsIndex.newTicketButton);
let url = await page.expectURL('#!/ticket/create'); await page.waitForState('ticket.create');
expect(url).toBe(true);
}); });
it('should succeed to create a ticket', async() => { it('should succeed to create a ticket', async() => {
@ -38,8 +36,6 @@ describe('Ticket create path', () => {
}); });
it('should check the url is now the summary of the ticket', async() => { it('should check the url is now the summary of the ticket', async() => {
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
}); });

View File

@ -19,9 +19,7 @@ describe('Ticket create from client path', () => {
it('should click the create simple ticket on the descriptor menu', async() => { it('should click the create simple ticket on the descriptor menu', async() => {
await page.waitToClick(selectors.clientDescriptor.moreMenu); await page.waitToClick(selectors.clientDescriptor.moreMenu);
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton); await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
let url = await page.expectURL('clientFk=102'); await page.waitForState('ticket.create');
expect(url).toBe(true);
}); });
it('should check if the client details are the expected ones', async() => { it('should check if the client details are the expected ones', async() => {
@ -31,7 +29,6 @@ describe('Ticket create from client path', () => {
const address = await page const address = await page
.waitToGetProperty(selectors.createTicketView.address, 'value'); .waitToGetProperty(selectors.createTicketView.address, 'value');
expect(client).toContain('Petter Parker'); expect(client).toContain('Petter Parker');
expect(address).toContain('20 Ingram Street'); expect(address).toContain('20 Ingram Street');
}); });

View File

@ -18,9 +18,7 @@ describe('Ticket Summary path', () => {
it('should navigate to the target ticket summary section', async() => { it('should navigate to the target ticket summary section', async() => {
await page.loginAndModule('employee', 'ticket'); await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId); await page.accessToSearchResult(ticketId);
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it(`should display details from the ticket and it's client on the top of the header`, async() => { it(`should display details from the ticket and it's client on the top of the header`, async() => {
@ -75,9 +73,7 @@ describe('Ticket Summary path', () => {
it('should log in as production then navigate to the summary of the same ticket', async() => { it('should log in as production then navigate to the summary of the same ticket', async() => {
await page.loginAndModule('production', 'ticket'); await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult(ticketId); await page.accessToSearchResult(ticketId);
let url = await page.expectURL('/summary'); await page.waitForState('ticket.card.summary');
expect(url).toBe(true);
}); });
it('should click on the SET OK button', async() => { it('should click on the SET OK button', async() => {

View File

@ -19,9 +19,7 @@ describe('Ticket log path', () => {
await page.loginAndModule('employee', 'ticket'); await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId); await page.accessToSearchResult(ticketId);
await page.accessToSection('ticket.card.observation'); await page.accessToSection('ticket.card.observation');
let url = await page.expectURL('/observation'); await page.waitForState('ticket.card.observation');
expect(url).toBe(true);
}); });
it('should create a new note for the test', async() => { it('should create a new note for the test', async() => {
@ -36,9 +34,7 @@ describe('Ticket log path', () => {
it('should navigate to the log section', async() => { it('should navigate to the log section', async() => {
await page.accessToSection('ticket.card.log'); await page.accessToSection('ticket.card.log');
let url = await page.expectURL('/log'); await page.waitForState('ticket.card.log');
expect(url).toBe(true);
}); });
it('should set the viewport width to 1920 to see the table full width', async() => { it('should set the viewport width to 1920 to see the table full width', async() => {

View File

@ -31,9 +31,7 @@ describe('Claim edit basic data path', () => {
}); });
it(`should have been redirected to the next section of claims as the role is salesAssistant`, async() => { it(`should have been redirected to the next section of claims as the role is salesAssistant`, async() => {
let url = await page.expectURL('/detail'); await page.waitForState('claim.card.detail');
expect(url).toBe(true);
}); });
it('should confirm the claim state was edited', async() => { it('should confirm the claim state was edited', async() => {

View File

@ -32,9 +32,7 @@ describe('Claim development', () => {
}); });
it(`should redirect to the next section of claims as the role is salesAssistant`, async() => { it(`should redirect to the next section of claims as the role is salesAssistant`, async() => {
let url = await page.expectURL('/action'); await page.waitForState('claim.card.action');
expect(url).toBe(true);
}); });
it('should edit a development', async() => { it('should edit a development', async() => {

View File

@ -56,7 +56,7 @@ xdescribe('Claim detail', () => {
await page.loginAndModule('salesAssistant', 'claim'); await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult('1'); await page.accessToSearchResult('1');
await page.accessToSection('claim.card.detail'); await page.accessToSection('claim.card.detail');
let url = await page.expectURL('/detail'); let url = await page.expectURL('/detail'); // replace with waitForState
expect(url).toBe(true); expect(url).toBe(true);
}); });
@ -99,7 +99,7 @@ xdescribe('Claim detail', () => {
}); });
it(`should have been redirected to the next section in claims`, async() => { it(`should have been redirected to the next section in claims`, async() => {
let url = await page.expectURL('development'); let url = await page.expectURL('development'); // replace with waitForState
expect(url).toBe(true); expect(url).toBe(true);
}); });

View File

@ -18,9 +18,7 @@ describe('claim Summary path', () => {
it('should navigate to the target claim summary section', async() => { it('should navigate to the target claim summary section', async() => {
await page.loginAndModule('employee', 'claim'); await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId); await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary'); await page.waitForState('claim.card.summary');
expect(url).toBe(true);
}); });
it(`should display details from the claim and it's client on the top of the header`, async() => { it(`should display details from the claim and it's client on the top of the header`, async() => {

View File

@ -18,9 +18,7 @@ describe('claim Descriptor path', () => {
it('should now navigate to the target claim summary section', async() => { it('should now navigate to the target claim summary section', async() => {
await page.loginAndModule('employee', 'claim'); await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId); await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary'); await page.waitForState('claim.card.summary');
expect(url).toBe(true);
}); });
it(`should not be able to see the delete claim button of the descriptor more menu`, async() => { it(`should not be able to see the delete claim button of the descriptor more menu`, async() => {
@ -31,9 +29,7 @@ describe('claim Descriptor path', () => {
it(`should log in as salesAssistant and navigate to the target claim`, async() => { it(`should log in as salesAssistant and navigate to the target claim`, async() => {
await page.loginAndModule('salesAssistant', 'claim'); await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult(claimId); await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary'); await page.waitForState('claim.card.summary');
expect(url).toBe(true);
}); });
it(`should be able to see the delete claim button of the descriptor more menu`, async() => { it(`should be able to see the delete claim button of the descriptor more menu`, async() => {
@ -50,9 +46,7 @@ describe('claim Descriptor path', () => {
}); });
it(`should have been relocated to the claim index`, async() => { it(`should have been relocated to the claim index`, async() => {
let url = await page.expectURL('/claim/index'); await page.waitForState('claim.index');
expect(url).toBe(true);
}); });
it(`should search for the deleted claim to find no results`, async() => { it(`should search for the deleted claim to find no results`, async() => {

View File

@ -16,9 +16,7 @@ describe('Order summary path', () => {
}); });
it('should reach the order summary section', async() => { it('should reach the order summary section', async() => {
const url = await page.expectURL('#!/order/16/summary'); await page.waitForState('order.card.summary');
expect(url).toBe(true);
}); });
it('should check the summary contains the order id', async() => { it('should check the summary contains the order id', async() => {

View File

@ -39,9 +39,7 @@ describe('Order edit basic data path', () => {
await page.accessToSearchResult(orderId); await page.accessToSearchResult(orderId);
await page.accessToSection('order.card.basicData'); await page.accessToSection('order.card.basicData');
await page.waitForSelector(selectors.orderBasicData.observation, {visible: true}); await page.waitForSelector(selectors.orderBasicData.observation, {visible: true});
let url = await page.expectURL(`#!/order/${orderId}/basic-data`); await page.waitForState('order.card.basicData');
expect(url).toBe(true);
}); });
it('should not be able to change anything', async() => { it('should not be able to change anything', async() => {
@ -59,9 +57,7 @@ describe('Order edit basic data path', () => {
await page.waitToClick(selectors.orderBasicData.acceptButton); await page.waitToClick(selectors.orderBasicData.acceptButton);
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitToClick(selectors.ordersIndex.createOrderButton); await page.waitToClick(selectors.ordersIndex.createOrderButton);
let url = await page.expectURL('#!/order/create'); await page.waitForState('order.create');
expect(url).toBe(true);
}); });
it('should now create a new one', async() => { it('should now create a new one', async() => {
@ -69,16 +65,12 @@ describe('Order edit basic data path', () => {
await page.pickDate(selectors.createOrderView.landedDatePicker); await page.pickDate(selectors.createOrderView.landedDatePicker);
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency'); await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton); await page.waitToClick(selectors.createOrderView.createButton);
let url = await page.expectURL('/catalog'); await page.waitForState('order.card.catalog');
expect(url).toBe(true);
}); });
it('should navigate to the basic data section of the new order', async() => { it('should navigate to the basic data section of the new order', async() => {
await page.accessToSection('order.card.basicData'); await page.accessToSection('order.card.basicData');
let url = await page.expectURL('/basic-data'); await page.waitForState('order.card.basicData');
expect(url).toBe(true);
}); });
it('should be able to modify all the properties', async() => { it('should be able to modify all the properties', async() => {

View File

@ -41,10 +41,7 @@ describe('Order lines', () => {
it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => { it('should confirm the whole order and redirect to ticket index filtered by clientFk', async() => {
await page.waitToClick(selectors.orderLine.confirmOrder); await page.waitToClick(selectors.orderLine.confirmOrder);
let hashPartOne = await page.expectURL('ticket/index'); await page.expectURL('ticket/index');
let hashPartTwo = await page.expectURL('clientFk'); await page.expectURL('clientFk');
expect(hashPartOne).toBe(true);
expect(hashPartTwo).toBe(true);
}); });
}); });

View File

@ -17,9 +17,7 @@ describe('Order catalog', () => {
it('should open the create new order form', async() => { it('should open the create new order form', async() => {
await page.waitToClick(selectors.ordersIndex.createOrderButton); await page.waitToClick(selectors.ordersIndex.createOrderButton);
let url = await page.expectURL('order/create'); await page.waitForState('order.create');
expect(url).toBe(true);
}); });
it('should create a new order', async() => { it('should create a new order', async() => {
@ -27,9 +25,7 @@ describe('Order catalog', () => {
await page.pickDate(selectors.createOrderView.landedDatePicker); await page.pickDate(selectors.createOrderView.landedDatePicker);
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency'); await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton); await page.waitToClick(selectors.createOrderView.createButton);
let url = await page.expectURL('/catalog'); await page.waitForState('order.card.catalog');
expect(url).toBe(true);
}); });
it('should add the realm and type filters and obtain results', async() => { it('should add the realm and type filters and obtain results', async() => {

View File

@ -17,9 +17,7 @@ describe('Route summary path', () => {
}); });
it('should reach the first route summary section', async() => { it('should reach the first route summary section', async() => {
let url = await page.expectURL('#!/route/1/summary'); await page.waitForState('route.card.summary');
expect(url).toBe(true);
}); });
it(`should display details from the route on the header`, async() => { it(`should display details from the route on the header`, async() => {

View File

@ -19,9 +19,7 @@ describe('Route create path', () => {
it('should click on the add new route button and open the creation form', async() => { it('should click on the add new route button and open the creation form', async() => {
await page.waitForContentLoaded(); await page.waitForContentLoaded();
await page.waitToClick(selectors.routeIndex.addNewRouteButton); await page.waitToClick(selectors.routeIndex.addNewRouteButton);
let url = await page.expectURL('#!/route/create'); await page.waitForState('route.create');
expect(url).toBe(true);
}); });
it(`should attempt to create a new route but fail since employee has no access rights`, async() => { it(`should attempt to create a new route but fail since employee has no access rights`, async() => {
@ -41,9 +39,7 @@ describe('Route create path', () => {
it('should again click on the add new route button and open the creation form', async() => { it('should again click on the add new route button and open the creation form', async() => {
await page.waitToClick(selectors.routeIndex.addNewRouteButton); await page.waitToClick(selectors.routeIndex.addNewRouteButton);
let url = await page.expectURL('#!/route/create'); await page.waitForState('route.create');
expect(url).toBe(true);
}); });
it(`should create a new route`, async() => { it(`should create a new route`, async() => {
@ -59,9 +55,7 @@ describe('Route create path', () => {
}); });
it(`should confirm the redirection to the created route summary`, async() => { it(`should confirm the redirection to the created route summary`, async() => {
let url = await page.expectURL('/summary'); await page.waitForState('route.card.summary');
expect(url).toBe(true);
}); });
}); });
}); });

View File

@ -17,9 +17,7 @@ describe('InvoiceOut summary path', () => {
}); });
it('should reach the summary section', async() => { it('should reach the summary section', async() => {
const result = await page.expectURL('/summary'); await page.waitForState('invoiceOut.card.summary');
expect(result).toBe(true);
}); });
it('should contain the company from which the invoice is emited', async() => { it('should contain the company from which the invoice is emited', async() => {

View File

@ -20,9 +20,7 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton); await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222'); await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
await page.waitToClick(selectors.ticketsIndex.advancedSearchButton); await page.waitToClick(selectors.ticketsIndex.advancedSearchButton);
let url = await page.expectURL('#!/ticket/3/summary'); await page.waitForState('ticket.card.summary');
expect(url).toEqual(true);
}); });
it('should navigate to the invoiceOut index', async() => { it('should navigate to the invoiceOut index', async() => {
@ -30,16 +28,12 @@ describe('InvoiceOut descriptor path', () => {
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton); await page.waitToClick(selectors.globalItems.invoiceOutButton);
await page.wait(selectors.invoiceOutIndex.topbarSearch); await page.wait(selectors.invoiceOutIndex.topbarSearch);
let url = await page.expectURL('#!/invoice-out/index'); await page.waitForState('invoiceOut.index');
expect(url).toBe(true);
}); });
it(`should click on the search result to access to the invoiceOut summary`, async() => { it(`should click on the search result to access to the invoiceOut summary`, async() => {
await page.accessToSearchResult('T2222222'); await page.accessToSearchResult('T2222222');
let url = await page.expectURL('/summary'); await page.waitForState('invoiceOut.card.summary');
expect(url).toBe(true);
}); });
it('should delete the invoiceOut using the descriptor more menu', async() => { it('should delete the invoiceOut using the descriptor more menu', async() => {
@ -52,9 +46,7 @@ describe('InvoiceOut descriptor path', () => {
}); });
it('should have been relocated to the invoiceOut index', async() => { it('should have been relocated to the invoiceOut index', async() => {
let url = await page.expectURL('#!/invoice-out/index'); await page.waitForState('invoiceOut.index');
expect(url).toBe(true);
}); });
it(`should search for the deleted invouceOut to find no results`, async() => { it(`should search for the deleted invouceOut to find no results`, async() => {
@ -70,13 +62,10 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton); await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index'); await page.waitForState('ticket.index');
expect(url).toBe(true);
}); });
it('should search for tickets with an specific invoiceOut to find no results', async() => { it('should search for tickets with an specific invoiceOut to find no results', async() => {
await page.waitFor(2000);
await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton); await page.waitToClick(selectors.ticketsIndex.openAdvancedSearchButton);
await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222'); await page.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
await page.waitToClick(selectors.ticketsIndex.advancedSearchButton); await page.waitToClick(selectors.ticketsIndex.advancedSearchButton);
@ -91,16 +80,12 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton); await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible); await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton); await page.waitToClick(selectors.globalItems.invoiceOutButton);
let url = await page.expectURL('#!/invoice-out/index'); await page.waitForState('invoiceOut.index');
expect(url).toBe(true);
}); });
it(`should search and access to the invoiceOut summary`, async() => { it(`should search and access to the invoiceOut summary`, async() => {
await page.accessToSearchResult('T1111111'); await page.accessToSearchResult('T1111111');
let url = await page.expectURL('/summary'); await page.waitForState('invoiceOut.card.summary');
expect(url).toBe(true);
}); });
it(`should check the invoiceOut is booked in the summary data`, async() => { it(`should check the invoiceOut is booked in the summary data`, async() => {

View File

@ -18,16 +18,12 @@ describe('Travel thermograph path', () => {
}); });
it('should reach the thermograph section', async() => { it('should reach the thermograph section', async() => {
const result = await page.expectURL('/thermograph/index'); await page.waitForState('travel.card.thermograph.index');
expect(result).toBe(true);
}); });
it('should click the add thermograph floating button', async() => { it('should click the add thermograph floating button', async() => {
await page.waitToClick(selectors.travelThermograph.add); await page.waitToClick(selectors.travelThermograph.add);
const result = await page.expectURL('/thermograph/create'); await page.waitForState('travel.card.thermograph.create');
expect(result).toBe(true);
}); });
it('should select the thermograph and then the file to upload', async() => { it('should select the thermograph and then the file to upload', async() => {

View File

@ -18,9 +18,7 @@ describe('Travel basic data path', () => {
}); });
it('should reach the thermograph section', async() => { it('should reach the thermograph section', async() => {
const result = await page.expectURL('/basic-data'); await page.waitForState('travel.card.basicData');
expect(result).toBe(true);
}); });
it('should set a wrong delivery date then receive an error on submit', async() => { it('should set a wrong delivery date then receive an error on submit', async() => {
@ -92,9 +90,7 @@ describe('Travel basic data path', () => {
it('should navigate to the travel logs', async() => { it('should navigate to the travel logs', async() => {
await page.accessToSection('travel.card.log'); await page.accessToSection('travel.card.log');
const result = await page.expectURL('/log'); await page.waitForState('travel.card.log');
expect(result).toBe(true);
}); });
it('should check the 1st log contains details from the changes made', async() => { it('should check the 1st log contains details from the changes made', async() => {

View File

@ -18,9 +18,7 @@ describe('Zone basic data path', () => {
}); });
it('should reach the basic data section', async() => { it('should reach the basic data section', async() => {
let url = await page.expectURL('#!/zone/10/basic-data'); await page.waitForState('zone.card.basicData');
expect(url).toBe(true);
}); });
it('should edit de form and then save', async() => { it('should edit de form and then save', async() => {

View File

@ -17,9 +17,7 @@ describe('Entry summary path', () => {
}); });
it('should reach the second entry summary section', async() => { it('should reach the second entry summary section', async() => {
let url = await page.expectURL('#!/entry/2/summary'); await page.waitForState('entry.card.summary');
expect(url).toBe(true);
}); });
it(`should display details from the entry on the header`, async() => { it(`should display details from the entry on the header`, async() => {

View File

@ -17,9 +17,7 @@ describe('Entry descriptor path', () => {
}); });
it('should reach the second entry summary section', async() => { it('should reach the second entry summary section', async() => {
let url = await page.expectURL('#!/entry/2/summary'); await page.waitForState('entry.card.summary');
expect(url).toBe(true);
}); });
it('should show some entry information', async() => { it('should show some entry information', async() => {
@ -30,32 +28,22 @@ describe('Entry descriptor path', () => {
it('should click the travels button to be redirected to the travels index filtered by the current agency', async() => { it('should click the travels button to be redirected to the travels index filtered by the current agency', async() => {
await page.waitToClick(selectors.entryDescriptor.travelsQuicklink); await page.waitToClick(selectors.entryDescriptor.travelsQuicklink);
const url = await page.expectURL('/travel/index'); await page.expectURL('/travel/index');
const filter = await page.expectURL('agencyFk'); await page.expectURL('agencyFk');
expect(url).toBe(true);
expect(filter).toBe(true);
}); });
it('should go back to the entry summary', async() => { it('should go back to the entry summary', async() => {
await page.waitToClick(selectors.globalItems.homeButton); await page.waitToClick(selectors.globalItems.homeButton);
await page.selectModule('entry'); await page.selectModule('entry');
await page.accessToSearchResult('2'); await page.accessToSearchResult('2');
let url = await page.expectURL('#!/entry/2/summary'); await page.waitForState('entry.card.summary');
expect(url).toBe(true);
}); });
it('should click the entries button to be redirected to the entries index filtered by the current supplier', async() => { it('should click the entries button to be redirected to the entries index filtered by the current supplier', async() => {
await page.waitToClick(selectors.entryDescriptor.entriesQuicklink); await page.waitToClick(selectors.entryDescriptor.entriesQuicklink);
const url = await page.expectURL('/entry/index'); await page.expectURL('/entry/index');
const supplierFilter = await page.expectURL('supplierFk'); await page.expectURL('supplierFk');
const toFilter = await page.expectURL('to'); await page.expectURL('to');
const fromFilter = await page.expectURL('from'); await page.expectURL('from');
expect(url).toBe(true);
expect(supplierFilter).toBe(true);
expect(toFilter).toBe(true);
expect(fromFilter).toBe(true);
}); });
}); });

View File

@ -47,7 +47,7 @@ class Controller extends ModuleCard {
] ]
}; };
this.$q.all([ return this.$q.all([
this.$http.get(`Orders/${this.$params.id}`, {filter}) this.$http.get(`Orders/${this.$params.id}`, {filter})
.then(res => this.order = res.data), .then(res => this.order = res.data),
this.$http.get(`Orders/${this.$params.id}/getTotal`) this.$http.get(`Orders/${this.$params.id}/getTotal`)

View File

@ -43,10 +43,9 @@ class Controller extends Section {
rows: [row.id], rows: [row.id],
actualOrderId: this.$params.id actualOrderId: this.$params.id
}; };
return this.$http.post(`OrderRows/removes`, params).then(() => { return this.$http.post(`OrderRows/removes`, params)
this.card.reload(); .then(() => this.card.reload())
this.vnApp.showSuccess(this.$t('Data saved!')); .then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
});
} }
showDescriptor(event, itemFk) { showDescriptor(event, itemFk) {