#639 Refacto e2e waitForSnackbar + error corrections

This commit is contained in:
Carlos Jimenez 2018-09-17 10:50:15 +02:00
parent df02c35068
commit 38633c1fef
20 changed files with 80 additions and 80 deletions

View File

@ -65,9 +65,9 @@ describe('Client', () => {
it('should receive an error when clicking the create button having all the form fields empty', () => {
return nightmare
.click(selectors.createClientView.createButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -79,9 +79,9 @@ describe('Client', () => {
.waitToClick(selectors.createClientView.salesPersonInput)
.waitToClick(selectors.createClientView.salesBruceBannerOption)
.click(selectors.createClientView.createButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -92,9 +92,9 @@ describe('Client', () => {
.clearInput(selectors.createClientView.email)
.type(selectors.createClientView.email, 'incorrect email format')
.click(selectors.createClientView.createButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -103,9 +103,9 @@ describe('Client', () => {
.clearInput(selectors.createClientView.email)
.type(selectors.createClientView.email, 'caroldanvers@verdnatura.es')
.click(selectors.createClientView.createButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -64,9 +64,9 @@ describe('Client', () => {
.waitToClick(selectors.clientBasicData.channelInput)
.waitToClick(selectors.clientBasicData.channelMetropolisOption)
.click(selectors.clientBasicData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -109,18 +109,18 @@ describe('Client Edit fiscalData path', () => {
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
.click(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
it('should propagate the Equalization tax', () => {
return nightmare
.waitToClick(selectors.clientFiscalData.acceptPropagationButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Equivalent tax spreaded']));
expect(result).toEqual('Equivalent tax spreaded');
});
});
@ -315,9 +315,9 @@ describe('Client Edit fiscalData path', () => {
.waitToClick(selectors.clientAddresses.firstEditButton)
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
.click(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -58,9 +58,9 @@ describe('Client', () => {
.waitToClick(selectors.clientPayMethod.receivedCoreVNLCheckbox)
.waitToClick(selectors.clientPayMethod.receivedB2BVNLCheckbox)
.waitToClick(selectors.clientPayMethod.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['That payment method requires an IBAN']));
expect(result).toEqual('That payment method requires an IBAN');
});
});

View File

@ -88,9 +88,9 @@ describe('Client', () => {
.type(selectors.clientAddresses.phoneInput, '999887744')
.type(selectors.clientAddresses.mobileInput, '999887744')
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -100,9 +100,9 @@ describe('Client', () => {
.type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
.type(selectors.clientAddresses.cityInput, 'New York')
.click(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Data saved!');
});
});
@ -141,9 +141,9 @@ describe('Client', () => {
return nightmare
.waitToClick(selectors.clientAddresses.activeCheckbox)
.waitToClick(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['The default consignee can not be unchecked']));
expect(result).toEqual('The default consignee can not be unchecked');
});
});
});

View File

@ -62,9 +62,9 @@ describe('Client add address notes path', () => {
.wait(selectors.clientAddresses.firstObservationDescriptionInput)
.type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description')
.waitToClick(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Observation type cannot be blank']));
expect(result).toEqual('Observation type cannot be blank');
});
});
@ -74,9 +74,9 @@ describe('Client add address notes path', () => {
.waitToClick(selectors.clientAddresses.firstObservationTypeSelect)
.waitToClick(selectors.clientAddresses.firstObservationTypeSelectOptionOne)
.waitToClick(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -88,9 +88,9 @@ describe('Client add address notes path', () => {
.waitToClick(selectors.clientAddresses.secondObservationTypeSelectOptionTwo)
.type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description')
.waitToClick(selectors.clientAddresses.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
});

View File

@ -52,9 +52,9 @@ describe('Client', () => {
.clearInput(selectors.clientWebAccess.userNameInput)
.type(selectors.clientWebAccess.userNameInput, 'Hulk')
.waitToClick(selectors.clientWebAccess.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -60,9 +60,9 @@ describe('Client', () => {
return nightmare
.type(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am')
.click(selectors.clientNotes.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -61,9 +61,9 @@ describe('Client', () => {
.clearInput(selectors.clientCredit.creditInput)
.type(selectors.clientCredit.creditInput, 999)
.click(selectors.clientCredit.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -61,9 +61,9 @@ describe('Client', () => {
.waitToClick(selectors.clientGreuge.typeInput)
.waitToClick(selectors.clientGreuge.typeSecondOption)
.click(selectors.clientGreuge.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -73,9 +73,9 @@ describe('Client', () => {
.waitForTextInInput(selectors.clientGreuge.amountInput, '999')
.type(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
.click(selectors.clientGreuge.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -74,9 +74,9 @@ describe('Client lock verified data path', () => {
.clearInput(selectors.clientFiscalData.socialNameInput)
.type(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
.click(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
@ -161,9 +161,9 @@ describe('Client lock verified data path', () => {
return nightmare
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
@ -187,13 +187,13 @@ describe('Client lock verified data path', () => {
.clearInput(selectors.clientFiscalData.socialNameInput)
.type(selectors.clientFiscalData.socialNameInput, 'administrative was here')
.click(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
it('should confirm the social name have been edited once and for all', () => {
it('should again confirm the social name have been edited', () => {
return nightmare
.waitToClick(selectors.clientBasicData.basicDataButton)
.wait(selectors.clientBasicData.nameInput)
@ -289,7 +289,7 @@ describe('Client lock verified data path', () => {
.waitForLogin('salesAssistant');
});
it('should navigate to clients index', () => {
it('should now navigate to clients index', () => {
return nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)
@ -301,7 +301,7 @@ describe('Client lock verified data path', () => {
});
});
it('should search again for the user Petter Parker', () => {
it('should now search again for the user Petter Parker', () => {
return nightmare
.wait(selectors.clientsIndex.searchResult)
.type(selectors.clientsIndex.searchClientInput, 'Petter Parker')
@ -350,9 +350,9 @@ describe('Client lock verified data path', () => {
return nightmare
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
@ -370,19 +370,19 @@ describe('Client lock verified data path', () => {
});
});
it('should again edit the social name', () => {
it('should now edit the social name', () => {
return nightmare
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
.type(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here')
.click(selectors.clientFiscalData.saveButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
it('should confirm the social name have been edited once and for all', () => {
it('should now confirm the social name have been edited once and for all', () => {
return nightmare
.waitToClick(selectors.clientBasicData.basicDataButton)
.wait(selectors.clientBasicData.nameInput)
@ -402,7 +402,7 @@ describe('Client lock verified data path', () => {
.waitForLogin('salesPerson');
});
it('should again click on the Clients button of the top bar menu', () => {
it('should now click on the Clients button of the top bar menu', () => {
return nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton)
.wait(selectors.globalItems.applicationsMenuVisible)

View File

@ -61,9 +61,9 @@ describe('Item', () => {
.clearInput(selectors.itemBasicData.longNameInput)
.type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
.click(selectors.itemBasicData.submitBasicDataButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -53,9 +53,9 @@ describe('Item', () => {
.waitToClick(selectors.itemTax.thirdClassSelect)
.waitToClick(selectors.itemTax.thirdClassSelectOptionTwo)
.click(selectors.itemTax.submitTaxButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -54,9 +54,9 @@ describe('Item', () => {
.clearInput(selectors.itemTags.seventhRelevancyInput)
.type(selectors.itemTags.seventhRelevancyInput, '1')
.click(selectors.itemTags.submitItemTagsButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -52,9 +52,9 @@ describe('Item', () => {
.waitToClick(selectors.itemNiches.thirdWarehouseSelectFourthOption)
.type(selectors.itemNiches.thirdCodeInput, 'A4')
.click(selectors.itemNiches.submitNichesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -52,9 +52,9 @@ describe('Item', () => {
.waitToClick(selectors.itemBotanical.speciesSelect)
.waitToClick(selectors.itemBotanical.speciesSelectOptionOne)
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
@ -96,9 +96,9 @@ describe('Item', () => {
.waitToClick(selectors.itemBotanical.speciesSelect)
.waitToClick(selectors.itemBotanical.speciesSelectOptionTwo)
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -51,9 +51,9 @@ describe('Item', () => {
.wait(selectors.itemBarcodes.thirdCodeInput)
.type(selectors.itemBarcodes.thirdCodeInput, '5')
.waitToClick(selectors.itemBarcodes.submitBarcodesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -71,9 +71,9 @@ describe('Item', () => {
.waitToClick(selectors.itemCreateView.originSelect)
.waitToClick(selectors.itemCreateView.originSelectOptionOne)
.click(selectors.itemCreateView.createButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -53,9 +53,9 @@ describe('Ticket', () => {
.waitToClick(selectors.ticketNotes.firstNoteSelectSecondOption)
.type(selectors.ticketNotes.firstDescriptionInput, 'description')
.click(selectors.ticketNotes.submitNotesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});

View File

@ -59,9 +59,9 @@ describe('Ticket', () => {
it(`should attempt create a new state but receive an error if state is empty`, () => {
return nightmare
.click(selectors.createStateView.saveStateButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['No changes to save']));
expect(result).toEqual('No changes to save');
});
});
@ -71,9 +71,9 @@ describe('Ticket', () => {
.waitToClick(selectors.createStateView.stateInputOptionOne)
.waitToClick(selectors.createStateView.clearStateInputButton)
.click(selectors.createStateView.saveStateButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
@ -92,9 +92,9 @@ describe('Ticket', () => {
.waitToClick(selectors.createStateView.stateInput)
.waitToClick(selectors.createStateView.stateInputOptionOne)
.click(selectors.createStateView.saveStateButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});
});