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);
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);
try {

View File

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

View File

@ -36,9 +36,7 @@ describe('Client Edit fiscalData path', () => {
it(`should click on the fiscal data button`, async() => {
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
let url = await page.expectURL('fiscal-data');
expect(url).toBe(true);
await page.waitForState('client.card.fiscalData');
});
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
it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton);
let url = await page.expectURL('/address/index');
expect(url).toBe(true);
await page.waitForState('client.card.address.index');
});
// 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
it(`should click on the addresses button to access to the client's addresses`, async() => {
await page.waitToClick(selectors.clientAddresses.addressesButton);
let url = await page.expectURL('/address/index');
expect(url).toBe(true);
await page.waitForState('client.card.address.index');
});
// 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() => {
await page.waitToClick(selectors.clientAddresses.createAddress);
let url = await page.expectURL('address/create');
expect(url).toBe(true);
await page.waitForState('client.card.address.create');
});
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() => {
let url = await page.expectURL('/address/index');
expect(url).toBe(true);
await page.waitForState('client.card.address.index');
});
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() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
let url = await page.expectURL('/edit');
expect(url).toBe(true);
await page.waitForState('client.card.address.edit');
});
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.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
let url = await page.expectURL('address/index');
expect(url).toBe(true);
await page.waitForState('client.card.address.index');
});
});

View File

@ -19,9 +19,7 @@ describe('Client add address notes path', () => {
it(`should click on the edit icon of the default address`, async() => {
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
let url = await page.expectURL('/edit');
expect(url).toBe(true);
await page.waitForState('client.card.address.edit');
});
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() => {
let url = await page.expectURL('/note');
expect(url).toBe(true);
await page.waitForState('client.card.note.index');
});
it(`should click on the add note button`, async() => {
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
let url = await page.expectURL('/note/create');
expect(url).toBe(true);
await page.waitForState('client.card.note.create');
});
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() => {
await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
let url = await page.expectURL('/credit/create');
expect(url).toBe(true);
await page.waitForState('client.card.credit.create');
});
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() => {
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
let url = await page.expectURL('greuge/create');
expect(url).toBe(true);
await page.waitForState('client.card.greuge.create');
});
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() => {
await page.waitToClick(selectors.clientLog.logButton);
let url = await page.expectURL('log');
expect(url).toBe(true);
await page.waitForState('client.card.log');
});
it('should check the previous value of the last logged change', async() => {
@ -46,7 +44,6 @@ describe('Client log path', () => {
let lastModificationCurrentValue = await page.
waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText');
expect(lastModificationPreviousValue).toEqual('name: DavidCharlesHaller');
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() => {
await page.closePopup();
await page.reloadSection('client.card.balance.index');
let url = await page.expectURL('/balance');
expect(url).toBe(true);
await page.waitForState('client.card.balance.index');
});
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.waitToClick(selectors.globalItems.clientsButton);
await page.wait(selectors.clientsIndex.createClientButton);
let url = await page.expectURL('#!/client/index');
expect(url).toBe(true);
await page.waitForState('client.index');
});
it('should now search for the user Petter Parker', async() => {
await page.accessToSearchResult('Petter Parker');
await page.waitToClick(selectors.clientBalance.balanceButton);
let url = await page.expectURL('/balance');
expect(url).toBe(true);
await page.waitForState('client.card.balance.index');
});
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() => {
let url = await page.expectURL('#!/client/102/summary');
expect(url).toBe(true);
await page.waitForState('client.card.summary');
});
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() => {
const url = await page.expectURL('#!/worker/3/summary');
expect(url).toBe(true);
await page.waitForState('worker.card.summary');
});
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() => {
await page.accessToSearchResult('HankPym');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('worker.card.summary');
});
it('should access to the time control section', async() => {
await page.accessToSection('worker.card.timeControl');
let url = await page.expectURL('/time-control');
expect(url).toBe(true);
await page.waitForState('worker.card.timeControl');
});
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() => {
await page.accessToSearchResult('Melee weapon combat fist 15cm');
let url = await page.expectURL('summary');
expect(url).toBe(true);
await page.waitForState('item.card.summary');
});
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() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create');
expect(url).toBe(true);
await page.waitForState('item.create');
});
it('should return to the item index by clickig the cancel button', async() => {
await page.waitToClick(selectors.itemCreateView.cancelButton);
let url = await page.expectURL('#!/item/index');
expect(url).toBe(true);
await page.waitForState('item.index');
});
it('should now access to the create item view by clicking the create floating button', async() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create');
expect(url).toBe(true);
await page.waitForState('item.create');
});
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() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/index');
expect(url).toBe(true);
await page.waitForState('item.index');
});
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.waitToClick(selectors.itemsIndex.searchResultCloneButton);
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
let url = await page.expectURL('tags');
expect(url).toBe(true);
await page.waitForState('item.tags');
});
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() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('item.card.summary');
});
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.waitToClick(selectors.globalItems.ticketsButton)
]);
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
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() => {
await page.keyboard.press('Escape');
await page.accessToSearchResult('missing');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.itemsButton);
let url = await page.expectURL('#!/item/index');
expect(url).toBe(true);
await page.waitForState('item.index');
});
it('should search for the item once again', async() => {
await page.accessToSearchResult('Ranged weapon pistol 9mm');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('item.card.summary');
});
it('should regularize the item once more', async() => {
@ -135,16 +125,12 @@ describe('Item regularize path', () => {
page.waitToClick(selectors.globalItems.ticketsButton)
]);
await page.waitForTransitionEnd('vn-searchbar');
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
it('should search for the ticket with id 25 once again', async() => {
await page.accessToSearchResult('25');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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() => {
await page.waitToClick(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/create');
expect(url).toBe(true);
await page.waitForState('item.create');
});
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() => {
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
await page.wait(selectors.itemsIndex.createItemButton);
let url = await page.expectURL('#!/item/index');
expect(url).toBe(true);
await page.waitForState('item.index');
});
it(`should search for the created item and navigate to it's log section`, async() => {
await page.accessToSearchResult('Knowledge artifact');
await page.accessToSection('item.card.log');
let url = await page.expectURL('/log');
expect(url).toBe(true);
await page.waitForState('item.card.log');
});
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() => {
const result = await page.expectURL('/item/request');
expect(result).toBe(true);
await page.waitForState('item.request');
});
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() => {
await page.waitToClick(selectors.ticketTracking.createStateButton);
await page.waitForSelector(selectors.createStateView.state, {visible: true});
let url = await page.expectURL('tracking/edit');
expect(url).toBe(true);
await page.waitForState('ticket.card.tracking.edit');
});
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() => {
await page.waitToClick(selectors.ticketTracking.createStateButton);
let url = await page.expectURL('tracking/edit');
expect(url).toBe(true);
await page.waitForState('ticket.card.tracking.edit');
});
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() => {
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
let url = await page.expectURL('data/step-two');
expect(url).toBe(true);
await page.waitForState('ticket.card.basicData.stepTwo');
});
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() => {
await page.waitToClick(selectors.ticketBasicData.chargesReason);
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
let url = await page.expectURL('summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
});

View File

@ -41,9 +41,7 @@ describe('Ticket descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
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.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
it('should now search for the ticket 11', async() => {
await page.accessToSearchResult('11');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
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() => {
let url = await page.expectURL('/request');
expect(url).toBe(true);
await page.waitForState('ticket.card.request.index');
});
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.keyboard.press('Enter');
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() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
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);
});
@ -37,7 +37,7 @@ xdescribe('Ticket diary path', () => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitForTransitionEnd('.vn-popover');
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);
});

View File

@ -18,9 +18,7 @@ describe('Ticket descriptor path', () => {
describe('Delete ticket', () => {
it('should search for an specific ticket', async() => {
await page.accessToSearchResult('18');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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() => {
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
it(`should search for the deleted ticket and check it's date`, async() => {
@ -68,9 +64,7 @@ describe('Ticket descriptor path', () => {
describe('add stowaway', () => {
it('should search for a ticket', async() => {
await page.accessToSearchResult('16');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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() => {
await page.waitToClick(selectors.ticketDescriptor.shipButton);
let url = await page.expectURL('#!/ticket/17/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
it('should delete the stowaway', async() => {
@ -127,9 +119,7 @@ describe('Ticket descriptor path', () => {
await page.loginAndModule('adminBoss', 'ticket');
await page.accessToSearchResult(invoiceableTicketId);
let url = await page.expectURL(`ticket/${invoiceableTicketId}/summary`);
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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() => {
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
let url = await page.expectURL('#!/ticket/create');
expect(url).toBe(true);
await page.waitForState('ticket.create');
});
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() => {
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
});

View File

@ -19,9 +19,7 @@ describe('Ticket create from client path', () => {
it('should click the create simple ticket on the descriptor menu', async() => {
await page.waitToClick(selectors.clientDescriptor.moreMenu);
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
let url = await page.expectURL('clientFk=102');
expect(url).toBe(true);
await page.waitForState('ticket.create');
});
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
.waitToGetProperty(selectors.createTicketView.address, 'value');
expect(client).toContain('Petter Parker');
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() => {
await page.loginAndModule('employee', 'ticket');
await page.accessToSearchResult(ticketId);
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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() => {
await page.loginAndModule('production', 'ticket');
await page.accessToSearchResult(ticketId);
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('ticket.card.summary');
});
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.accessToSearchResult(ticketId);
await page.accessToSection('ticket.card.observation');
let url = await page.expectURL('/observation');
expect(url).toBe(true);
await page.waitForState('ticket.card.observation');
});
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() => {
await page.accessToSection('ticket.card.log');
let url = await page.expectURL('/log');
expect(url).toBe(true);
await page.waitForState('ticket.card.log');
});
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() => {
let url = await page.expectURL('/detail');
expect(url).toBe(true);
await page.waitForState('claim.card.detail');
});
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() => {
let url = await page.expectURL('/action');
expect(url).toBe(true);
await page.waitForState('claim.card.action');
});
it('should edit a development', async() => {

View File

@ -56,7 +56,7 @@ xdescribe('Claim detail', () => {
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult('1');
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);
});
@ -99,7 +99,7 @@ xdescribe('Claim detail', () => {
});
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);
});

View File

@ -18,9 +18,7 @@ describe('claim Summary path', () => {
it('should navigate to the target claim summary section', async() => {
await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('claim.card.summary');
});
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() => {
await page.loginAndModule('employee', 'claim');
await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('claim.card.summary');
});
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() => {
await page.loginAndModule('salesAssistant', 'claim');
await page.accessToSearchResult(claimId);
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('claim.card.summary');
});
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() => {
let url = await page.expectURL('/claim/index');
expect(url).toBe(true);
await page.waitForState('claim.index');
});
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() => {
const url = await page.expectURL('#!/order/16/summary');
expect(url).toBe(true);
await page.waitForState('order.card.summary');
});
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.accessToSection('order.card.basicData');
await page.waitForSelector(selectors.orderBasicData.observation, {visible: true});
let url = await page.expectURL(`#!/order/${orderId}/basic-data`);
expect(url).toBe(true);
await page.waitForState('order.card.basicData');
});
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.waitForContentLoaded();
await page.waitToClick(selectors.ordersIndex.createOrderButton);
let url = await page.expectURL('#!/order/create');
expect(url).toBe(true);
await page.waitForState('order.create');
});
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.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton);
let url = await page.expectURL('/catalog');
expect(url).toBe(true);
await page.waitForState('order.card.catalog');
});
it('should navigate to the basic data section of the new order', async() => {
await page.accessToSection('order.card.basicData');
let url = await page.expectURL('/basic-data');
expect(url).toBe(true);
await page.waitForState('order.card.basicData');
});
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() => {
await page.waitToClick(selectors.orderLine.confirmOrder);
let hashPartOne = await page.expectURL('ticket/index');
let hashPartTwo = await page.expectURL('clientFk');
expect(hashPartOne).toBe(true);
expect(hashPartTwo).toBe(true);
await page.expectURL('ticket/index');
await page.expectURL('clientFk');
});
});

View File

@ -17,9 +17,7 @@ describe('Order catalog', () => {
it('should open the create new order form', async() => {
await page.waitToClick(selectors.ordersIndex.createOrderButton);
let url = await page.expectURL('order/create');
expect(url).toBe(true);
await page.waitForState('order.create');
});
it('should create a new order', async() => {
@ -27,9 +25,7 @@ describe('Order catalog', () => {
await page.pickDate(selectors.createOrderView.landedDatePicker);
await page.autocompleteSearch(selectors.createOrderView.agency, 'Other agency');
await page.waitToClick(selectors.createOrderView.createButton);
let url = await page.expectURL('/catalog');
expect(url).toBe(true);
await page.waitForState('order.card.catalog');
});
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() => {
let url = await page.expectURL('#!/route/1/summary');
expect(url).toBe(true);
await page.waitForState('route.card.summary');
});
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() => {
await page.waitForContentLoaded();
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
let url = await page.expectURL('#!/route/create');
expect(url).toBe(true);
await page.waitForState('route.create');
});
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() => {
await page.waitToClick(selectors.routeIndex.addNewRouteButton);
let url = await page.expectURL('#!/route/create');
expect(url).toBe(true);
await page.waitForState('route.create');
});
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() => {
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('route.card.summary');
});
});
});

View File

@ -17,9 +17,7 @@ describe('InvoiceOut summary path', () => {
});
it('should reach the summary section', async() => {
const result = await page.expectURL('/summary');
expect(result).toBe(true);
await page.waitForState('invoiceOut.card.summary');
});
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.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
await page.waitToClick(selectors.ticketsIndex.advancedSearchButton);
let url = await page.expectURL('#!/ticket/3/summary');
expect(url).toEqual(true);
await page.waitForState('ticket.card.summary');
});
it('should navigate to the invoiceOut index', async() => {
@ -30,16 +28,12 @@ describe('InvoiceOut descriptor path', () => {
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
await page.wait(selectors.invoiceOutIndex.topbarSearch);
let url = await page.expectURL('#!/invoice-out/index');
expect(url).toBe(true);
await page.waitForState('invoiceOut.index');
});
it(`should click on the search result to access to the invoiceOut summary`, async() => {
await page.accessToSearchResult('T2222222');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('invoiceOut.card.summary');
});
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() => {
let url = await page.expectURL('#!/invoice-out/index');
expect(url).toBe(true);
await page.waitForState('invoiceOut.index');
});
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.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.ticketsButton);
let url = await page.expectURL('#!/ticket/index');
expect(url).toBe(true);
await page.waitForState('ticket.index');
});
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.write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222');
await page.waitToClick(selectors.ticketsIndex.advancedSearchButton);
@ -91,16 +80,12 @@ describe('InvoiceOut descriptor path', () => {
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
await page.wait(selectors.globalItems.applicationsMenuVisible);
await page.waitToClick(selectors.globalItems.invoiceOutButton);
let url = await page.expectURL('#!/invoice-out/index');
expect(url).toBe(true);
await page.waitForState('invoiceOut.index');
});
it(`should search and access to the invoiceOut summary`, async() => {
await page.accessToSearchResult('T1111111');
let url = await page.expectURL('/summary');
expect(url).toBe(true);
await page.waitForState('invoiceOut.card.summary');
});
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() => {
const result = await page.expectURL('/thermograph/index');
expect(result).toBe(true);
await page.waitForState('travel.card.thermograph.index');
});
it('should click the add thermograph floating button', async() => {
await page.waitToClick(selectors.travelThermograph.add);
const result = await page.expectURL('/thermograph/create');
expect(result).toBe(true);
await page.waitForState('travel.card.thermograph.create');
});
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() => {
const result = await page.expectURL('/basic-data');
expect(result).toBe(true);
await page.waitForState('travel.card.basicData');
});
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() => {
await page.accessToSection('travel.card.log');
const result = await page.expectURL('/log');
expect(result).toBe(true);
await page.waitForState('travel.card.log');
});
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() => {
let url = await page.expectURL('#!/zone/10/basic-data');
expect(url).toBe(true);
await page.waitForState('zone.card.basicData');
});
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() => {
let url = await page.expectURL('#!/entry/2/summary');
expect(url).toBe(true);
await page.waitForState('entry.card.summary');
});
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() => {
let url = await page.expectURL('#!/entry/2/summary');
expect(url).toBe(true);
await page.waitForState('entry.card.summary');
});
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() => {
await page.waitToClick(selectors.entryDescriptor.travelsQuicklink);
const url = await page.expectURL('/travel/index');
const filter = await page.expectURL('agencyFk');
expect(url).toBe(true);
expect(filter).toBe(true);
await page.expectURL('/travel/index');
await page.expectURL('agencyFk');
});
it('should go back to the entry summary', async() => {
await page.waitToClick(selectors.globalItems.homeButton);
await page.selectModule('entry');
await page.accessToSearchResult('2');
let url = await page.expectURL('#!/entry/2/summary');
expect(url).toBe(true);
await page.waitForState('entry.card.summary');
});
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);
const url = await page.expectURL('/entry/index');
const supplierFilter = await page.expectURL('supplierFk');
const toFilter = await page.expectURL('to');
const fromFilter = await page.expectURL('from');
expect(url).toBe(true);
expect(supplierFilter).toBe(true);
expect(toFilter).toBe(true);
expect(fromFilter).toBe(true);
await page.expectURL('/entry/index');
await page.expectURL('supplierFk');
await page.expectURL('to');
await page.expectURL('from');
});
});

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})
.then(res => this.order = res.data),
this.$http.get(`Orders/${this.$params.id}/getTotal`)

View File

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