small e2e refactors

This commit is contained in:
Carlos Jimenez Ruiz 2019-01-23 16:00:56 +01:00
parent 42dc6ec150
commit 2673a36578
31 changed files with 107 additions and 107 deletions

View File

@ -17,7 +17,7 @@ describe('Claim edit basic data path', () => {
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput)
.write(selectors.claimBasicData.observationInput, 'edited observation')
.click(selectors.claimBasicData.saveButton)
.waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
@ -25,9 +25,9 @@ describe('Claim edit basic data path', () => {
it('should confirm the claim state was edited', async() => {
const result = await nightmare
.click(selectors.claimDetail.detailButton)
.waitToClick(selectors.claimDetail.detailButton)
.wait(selectors.claimDetail.addItemButton)
.click(selectors.claimBasicData.basicDataButton)
.waitToClick(selectors.claimBasicData.basicDataButton)
.wait(selectors.claimBasicData.claimStateAutocomplete)
.waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value');
@ -56,7 +56,7 @@ describe('Claim edit basic data path', () => {
.waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox)
.clearInput(selectors.claimBasicData.observationInput)
.write(selectors.claimBasicData.observationInput, 'Observation one')
.click(selectors.claimBasicData.saveButton)
.waitToClick(selectors.claimBasicData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));

View File

@ -43,7 +43,7 @@ describe('Claim development', () => {
const reason = await nightmare
.waitToClick(selectors.claimBasicData.basicDataButton)
.wait(selectors.claimBasicData.claimStateAutocomplete)
.click(selectors.claimDevelopment.developmentButton)
.waitToClick(selectors.claimDevelopment.developmentButton)
.waitToGetProperty(`${selectors.claimDevelopment.firstClaimReasonAutocomplete} input`, 'value');
const result = await nightmare

View File

@ -12,7 +12,7 @@ describe('Client create path', () => {
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
const result = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0)
.countElement(selectors.clientsIndex.searchResult);
@ -21,7 +21,7 @@ describe('Client create path', () => {
it('should now access to the create client view by clicking the create-client floating button', async() => {
const url = await nightmare
.click(selectors.clientsIndex.createClientButton)
.waitToClick(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
@ -30,7 +30,7 @@ describe('Client create path', () => {
it('should receive an error when clicking the create button having all the form fields empty', async() => {
const result = await nightmare
.click(selectors.createClientView.createButton)
.waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -42,7 +42,7 @@ describe('Client create path', () => {
.write(selectors.createClientView.userName, 'CaptainMarvel')
.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es')
.autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory')
.click(selectors.createClientView.createButton)
.waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -54,7 +54,7 @@ describe('Client create path', () => {
.write(selectors.createClientView.socialName, 'AVG tax')
.clearInput(selectors.createClientView.email)
.write(selectors.createClientView.email, 'incorrect email format')
.click(selectors.createClientView.createButton)
.waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -64,7 +64,7 @@ describe('Client create path', () => {
const result = await nightmare
.clearInput(selectors.createClientView.email)
.write(selectors.createClientView.email, 'caroldanvers@verdnatura.es')
.click(selectors.createClientView.createButton)
.waitToClick(selectors.createClientView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -84,7 +84,7 @@ describe('Client create path', () => {
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
const result = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Carol Danvers')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);

View File

@ -34,7 +34,7 @@ describe('Client Edit basicData path', () => {
.clearInput(selectors.clientBasicData.emailInput)
.write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es')
.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets')
.click(selectors.clientBasicData.saveButton)
.waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -42,9 +42,9 @@ describe('Client Edit basicData path', () => {
it('should confirm the name have been edited', async() => {
const result = await nightmare
.click(selectors.clientFiscalData.fiscalDataButton)
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput)
.click(selectors.clientBasicData.basicDataButton)
.waitToClick(selectors.clientBasicData.basicDataButton)
.waitToGetProperty(selectors.clientBasicData.nameInput, 'value');
expect(result).toEqual('Ptonomy Wallace');
@ -119,7 +119,7 @@ describe('Client Edit basicData path', () => {
.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es')
.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory')
.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper')
.click(selectors.clientBasicData.saveButton)
.waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -127,9 +127,9 @@ describe('Client Edit basicData path', () => {
it('should now confirm the name have been edited', async() => {
const result = await nightmare
.click(selectors.clientFiscalData.fiscalDataButton)
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
.wait(selectors.clientFiscalData.addressInput)
.click(selectors.clientBasicData.basicDataButton)
.waitToClick(selectors.clientBasicData.basicDataButton)
.waitToGetProperty(selectors.clientBasicData.nameInput, 'value');
expect(result).toEqual('Ororo Munroe');

View File

@ -312,7 +312,7 @@ describe('Client Edit fiscalData path', () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.firstEditButton)
.waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel)
.click(selectors.clientAddresses.saveButton)
.waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -40,7 +40,7 @@ describe('Client Add address path', () => {
.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
.write(selectors.clientAddresses.cityInput, 'New York')
.click(selectors.clientAddresses.saveButton)
.waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -23,7 +23,7 @@ describe('Client Add notes path', () => {
it(`should create a note`, async() => {
const result = await nightmare
.write(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am')
.click(selectors.clientNotes.saveButton)
.waitToClick(selectors.clientNotes.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -24,7 +24,7 @@ describe('Client Add credit path', () => {
const result = await nightmare
.clearInput(selectors.clientCredit.creditInput)
.write(selectors.clientCredit.creditInput, 999)
.click(selectors.clientCredit.saveButton)
.waitToClick(selectors.clientCredit.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -23,7 +23,7 @@ describe('Client Add greuge path', () => {
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
const result = await nightmare
.autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff')
.click(selectors.clientGreuge.saveButton)
.waitToClick(selectors.clientGreuge.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -34,7 +34,7 @@ describe('Client Add greuge path', () => {
.write(selectors.clientGreuge.amountInput, 999)
.waitForTextInInput(selectors.clientGreuge.amountInput, '999')
.write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!')
.click(selectors.clientGreuge.saveButton)
.waitToClick(selectors.clientGreuge.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -28,7 +28,7 @@ describe('Client lock verified data path', () => {
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
.write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
.click(selectors.clientFiscalData.saveButton)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -66,7 +66,7 @@ describe('Client lock verified data path', () => {
it('should search again for the user Petter Parker', async() => {
const resultCount = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@ -130,7 +130,7 @@ describe('Client lock verified data path', () => {
.wait(selectors.clientFiscalData.socialNameInput)
.clearInput(selectors.clientFiscalData.socialNameInput)
.write(selectors.clientFiscalData.socialNameInput, 'administrative was here')
.click(selectors.clientFiscalData.saveButton)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -168,7 +168,7 @@ describe('Client lock verified data path', () => {
it('should again search for the user Petter Parker', async() => {
const resultCount = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@ -209,7 +209,7 @@ describe('Client lock verified data path', () => {
const result = await nightmare
.clearInput(selectors.clientFiscalData.socialNameInput)
.write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here')
.click(selectors.clientFiscalData.saveButton)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForSnackbar();
expect(result).toEqual(jasmine.arrayContaining([`You can't make changes on a client with verified data`]));
@ -237,7 +237,7 @@ describe('Client lock verified data path', () => {
it('should now search again for the user Petter Parker', async() => {
const resultCount = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);
@ -278,7 +278,7 @@ describe('Client lock verified data path', () => {
const result = await nightmare
.clearInput(selectors.clientFiscalData.socialNameInput)
.write(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here')
.click(selectors.clientFiscalData.saveButton)
.waitToClick(selectors.clientFiscalData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -316,7 +316,7 @@ describe('Client lock verified data path', () => {
it('should once again search for the user Petter Parker', async() => {
const resultCount = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);

View File

@ -104,7 +104,7 @@ describe('Client risk path', () => {
it('should now search for the user Petter Parker', async() => {
let resultCount = await nightmare
.write(selectors.clientsIndex.searchClientInput, 'Petter Parker')
.click(selectors.clientsIndex.searchButton)
.waitToClick(selectors.clientsIndex.searchButton)
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
.countElement(selectors.clientsIndex.searchResult);

View File

@ -12,7 +12,7 @@ describe('Item summary path', () => {
it('should search for an item', async() => {
const result = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@ -83,9 +83,9 @@ describe('Item summary path', () => {
it('should search for other item', async() => {
const result = await nightmare
.clearInput('vn-item-index vn-searchbar input')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.write(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);

View File

@ -32,7 +32,7 @@ describe('Item Edit basic data path', () => {
it(`should confirm the item name was edited`, async() => {
const result = await nightmare
.click(selectors.itemNiches.nicheButton)
.waitToClick(selectors.itemNiches.nicheButton)
.wait(selectors.itemNiches.firstWarehouseDisabled)
.waitToClick(selectors.itemBasicData.basicDataButton)
.waitToGetProperty(selectors.itemBasicData.nameInput, 'value');

View File

@ -16,7 +16,7 @@ describe('Item edit tax path', () => {
.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT')
.autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT')
.autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'Reduced VAT')
.click(selectors.itemTax.submitTaxButton)
.waitToClick(selectors.itemTax.submitTaxButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -24,9 +24,9 @@ describe('Item edit tax path', () => {
it(`should confirm the first item tax class was edited`, async() => {
const firstVatType = await nightmare
.click(selectors.itemTags.tagsButton)
.waitToClick(selectors.itemTags.tagsButton)
.wait(selectors.itemTags.firstTagDisabled)
.click(selectors.itemTax.taxButton)
.waitToClick(selectors.itemTax.taxButton)
.waitToClick(selectors.itemTax.taxButton)
.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');

View File

@ -19,7 +19,7 @@ describe('Item create tags path', () => {
.write(selectors.itemTags.seventhValueInput, '50')
.clearInput(selectors.itemTags.seventhRelevancyInput)
.write(selectors.itemTags.seventhRelevancyInput, '4')
.click(selectors.itemTags.submitItemTagsButton)
.waitToClick(selectors.itemTags.submitItemTagsButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -27,9 +27,9 @@ describe('Item create tags path', () => {
it(`should confirm the fourth row data is the expected one`, async() => {
let result = await nightmare
.click(selectors.itemBasicData.basicDataButton)
.waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
.click(selectors.itemTags.tagsButton)
.waitToClick(selectors.itemTags.tagsButton)
.wait('vn-item-tags')
.waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value');

View File

@ -17,7 +17,7 @@ describe('Item create niche path', () => {
.waitToClick(selectors.itemNiches.secondNicheRemoveButton)
.autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two')
.write(selectors.itemNiches.thirdCodeInput, 'A4')
.click(selectors.itemNiches.submitNichesButton)
.waitToClick(selectors.itemNiches.submitNichesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -25,9 +25,9 @@ describe('Item create niche path', () => {
it(`should confirm the first niche is the expected one`, async() => {
let result = await nightmare
.click(selectors.itemBasicData.basicDataButton)
.waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
.click(selectors.itemNiches.nicheButton)
.waitToClick(selectors.itemNiches.nicheButton)
.waitForTextInInput(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'Warehouse One')
.waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value');

View File

@ -24,9 +24,9 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was created`, async() => {
const result = await nightmare
.click(selectors.itemBasicData.basicDataButton)
.waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
.click(selectors.itemBotanical.botanicalButton)
.waitToClick(selectors.itemBotanical.botanicalButton)
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');
@ -62,9 +62,9 @@ describe('Item Create botanical path', () => {
it(`should confirm the botanical for the item was edited`, async() => {
const result = await nightmare
.click(selectors.itemBasicData.basicDataButton)
.waitToClick(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
.click(selectors.itemBotanical.botanicalButton)
.waitToClick(selectors.itemBotanical.botanicalButton)
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp')
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');

View File

@ -12,7 +12,7 @@ describe('Item Create/Clone path', () => {
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => {
const result = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0)
.countElement(selectors.itemsIndex.searchResult);
@ -21,7 +21,7 @@ describe('Item Create/Clone path', () => {
it('should access to the create item view by clicking the create floating button', async() => {
const url = await nightmare
.click(selectors.itemsIndex.createItemButton)
.waitToClick(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton)
.parsedUrl();
@ -30,7 +30,7 @@ describe('Item Create/Clone path', () => {
it('should return to the item index by clickig the cancel button', async() => {
const url = await nightmare
.click(selectors.itemCreateView.cancelButton)
.waitToClick(selectors.itemCreateView.cancelButton)
.wait(selectors.itemsIndex.createItemButton)
.parsedUrl();
@ -39,7 +39,7 @@ describe('Item Create/Clone path', () => {
it('should now access to the create item view by clicking the create floating button', async() => {
const url = await nightmare
.click(selectors.itemsIndex.createItemButton)
.waitToClick(selectors.itemsIndex.createItemButton)
.wait(selectors.itemCreateView.createButton)
.parsedUrl();
@ -52,7 +52,7 @@ describe('Item Create/Clone path', () => {
.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo')
.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares')
.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand')
.click(selectors.itemCreateView.createButton)
.waitToClick(selectors.itemCreateView.createButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -85,7 +85,7 @@ describe('Item Create/Clone path', () => {
describe('clone', () => {
it('should return to the items index by clicking the return to items button', async() => {
const url = await nightmare
.click(selectors.itemBasicData.goToItemIndexButton)
.waitToClick(selectors.itemBasicData.goToItemIndexButton)
.wait(selectors.itemsIndex.createItemButton)
.waitForURL('#!/item/index')
.parsedUrl();
@ -96,7 +96,7 @@ describe('Item Create/Clone path', () => {
it(`should search for the item Infinity Gauntlet`, async() => {
const result = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@ -106,7 +106,7 @@ describe('Item Create/Clone path', () => {
it(`should clone the Infinity Gauntlet`, async() => {
const url = await nightmare
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet')
.click(selectors.itemsIndex.searchResultCloneButton)
.waitToClick(selectors.itemsIndex.searchResultCloneButton)
.waitToClick(selectors.itemsIndex.acceptClonationAlertButton)
.waitForURL('tags')
.parsedUrl();
@ -118,7 +118,7 @@ describe('Item Create/Clone path', () => {
const result = await nightmare
.waitToClick(selectors.itemTags.goToItemIndexButton)
.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2)
.countElement(selectors.itemsIndex.searchResult);

View File

@ -100,7 +100,7 @@ describe('Item regularize path', () => {
it('should search for the item once again', async() => {
const resultCount = await nightmare
.write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50')
.click(selectors.itemsIndex.searchButton)
.waitToClick(selectors.itemsIndex.searchButton)
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
.countElement(selectors.itemsIndex.searchResult);
@ -143,7 +143,7 @@ describe('Item regularize path', () => {
it('should search for the ticket with id 23 once again', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:23')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);

View File

@ -14,7 +14,7 @@ describe('Order edit basic data path', () => {
it('should not be able to change the client', async() => {
const result = await nightmare
.autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark')
.click(selectors.orderBasicData.saveButton)
.waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
@ -38,7 +38,7 @@ describe('Order edit basic data path', () => {
it('should not be able to change the company', async() => {
const result = await nightmare
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
.click(selectors.orderBasicData.saveButton)
.waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`);
@ -65,7 +65,7 @@ describe('Order edit basic data path', () => {
.autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs')
.clearInput(selectors.orderBasicData.observationInput)
.write(selectors.orderBasicData.observationInput, 'Observation modified')
.click(selectors.orderBasicData.saveButton)
.waitToClick(selectors.orderBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -73,9 +73,9 @@ describe('Order edit basic data path', () => {
it('should now confirm the client have been edited', async() => {
const result = await nightmare
.click(selectors.orderCatalog.catalogButton)
.waitToClick(selectors.orderCatalog.catalogButton)
.wait(selectors.orderCatalog.orderByAutocomplete)
.click(selectors.orderBasicData.basicDataButton)
.waitToClick(selectors.orderBasicData.basicDataButton)
.waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value');
expect(result).toEqual('104: Tony Stark');

View File

@ -17,7 +17,7 @@ describe('Ticket Create notes path', () => {
.waitToClick(selectors.ticketNotes.addNoteButton)
.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one')
.write(selectors.ticketNotes.firstDescriptionInput, 'description')
.click(selectors.ticketNotes.submitNotesButton)
.waitToClick(selectors.ticketNotes.submitNotesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -25,9 +25,9 @@ describe('Ticket Create notes path', () => {
it(`should confirm the note is the expected one`, async() => {
let result = await nightmare
.click(selectors.ticketPackages.packagesButton)
.waitToClick(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageAutocomplete)
.click(selectors.ticketNotes.notesButton)
.waitToClick(selectors.ticketNotes.notesButton)
.waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
expect(result).toEqual('observation one');

View File

@ -16,9 +16,9 @@ xdescribe('Ticket expeditions and log path', () => {
const result = await nightmare
.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton)
.click(selectors.ticketPackages.packagesButton)
.waitToClick(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageAutocomplete)
.click(selectors.ticketExpedition.expeditionButton)
.waitToClick(selectors.ticketExpedition.expeditionButton)
.wait(selectors.ticketExpedition.expeditionRow)
.countElement(selectors.ticketExpedition.expeditionRow);

View File

@ -16,7 +16,7 @@ describe('Ticket Create packages path', () => {
.waitToClick(selectors.ticketPackages.firstRemovePackageButton)
.waitToClick(selectors.ticketPackages.addPackageButton)
.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
.click(selectors.ticketPackages.savePackagesButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -25,7 +25,7 @@ describe('Ticket Create packages path', () => {
it(`should attempt create a new package but receive an error if quantity is a string`, async() => {
const result = await nightmare
.write(selectors.ticketPackages.firstQuantityInput, 'ninety 9')
.click(selectors.ticketPackages.savePackagesButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -35,7 +35,7 @@ describe('Ticket Create packages path', () => {
const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
.write(selectors.ticketPackages.firstQuantityInput, 0)
.click(selectors.ticketPackages.savePackagesButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Some fields are invalid');
@ -45,8 +45,8 @@ describe('Ticket Create packages path', () => {
const result = await nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
.write(selectors.ticketPackages.firstQuantityInput, 99)
.click(selectors.ticketPackages.clearPackageAutocompleteButton)
.click(selectors.ticketPackages.savePackagesButton)
.waitToClick(selectors.ticketPackages.clearPackageAutocompleteButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Package cannot be blank');
@ -55,7 +55,7 @@ describe('Ticket Create packages path', () => {
it(`should create a new package with correct data`, async() => {
const result = await nightmare
.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box')
.click(selectors.ticketPackages.savePackagesButton)
.waitToClick(selectors.ticketPackages.savePackagesButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -43,7 +43,7 @@ describe('Ticket Create new tracking state path', () => {
it(`should create a new state`, async() => {
let result = await nightmare
.autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
.click(selectors.createStateView.saveStateButton)
.waitToClick(selectors.createStateView.saveStateButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
@ -70,7 +70,7 @@ describe('Ticket Create new tracking state path', () => {
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
let result = await nightmare
.autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?')
.click(selectors.createStateView.saveStateButton)
.waitToClick(selectors.createStateView.saveStateButton)
.waitForLastSnackbar();
expect(result).toEqual(`You don't have enough privileges to change the state of this ticket`);
@ -79,7 +79,7 @@ describe('Ticket Create new tracking state path', () => {
it(`should attempt to create an state for the type salesPerson has rights but fail as worker is blank`, async() => {
let result = await nightmare
.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado')
.click(selectors.createStateView.saveStateButton)
.waitToClick(selectors.createStateView.saveStateButton)
.waitForLastSnackbar();
expect(result).toEqual(`Worker cannot be blank`);
@ -88,7 +88,7 @@ describe('Ticket Create new tracking state path', () => {
it(`should create a new state with all it's data`, async() => {
let result = await nightmare
.autocompleteSearch(selectors.createStateView.workerAutocomplete, 'accessory')
.click(selectors.createStateView.saveStateButton)
.waitToClick(selectors.createStateView.saveStateButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');

View File

@ -16,7 +16,7 @@ describe('Ticket Edit basic data path', () => {
.autocompleteSearch(selectors.ticketBasicData.clientAutocomplete, 'Charles Xavier')
.wait(500)
.autocompleteSearch(selectors.ticketBasicData.addressAutocomplete, 'Charles Xavier')
.click(selectors.ticketBasicData.nextStepButton)
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-two')
.parsedUrl();
@ -32,7 +32,7 @@ describe('Ticket Edit basic data path', () => {
it(`should click next to move on to step three`, async() => {
let url = await nightmare
.click(selectors.ticketBasicData.nextStepButton)
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-three')
.parsedUrl();
@ -61,7 +61,7 @@ describe('Ticket Edit basic data path', () => {
it(`should edit the ticket agency then click next`, async() => {
let url = await nightmare
.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Silla247Expensive')
.click(selectors.ticketBasicData.nextStepButton)
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-two')
.parsedUrl();
@ -77,7 +77,7 @@ describe('Ticket Edit basic data path', () => {
it(`should then click next to move on to step three`, async() => {
let url = await nightmare
.click(selectors.ticketBasicData.nextStepButton)
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-three')
.parsedUrl();
@ -87,7 +87,7 @@ describe('Ticket Edit basic data path', () => {
it(`should select a new reason for the changes made then click on finalize`, async() => {
let url = await nightmare
.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket')
.click(selectors.ticketBasicData.finalizeButton)
.waitToClick(selectors.ticketBasicData.finalizeButton)
.waitForURL('summary')
.parsedUrl();

View File

@ -35,7 +35,7 @@ describe('Ticket Edit sale path', () => {
it('should again search for a specific ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -123,7 +123,7 @@ describe('Ticket Edit sale path', () => {
.wait(selectors.globalItems.applicationsMenuVisible)
.waitToClick(selectors.globalItems.ticketsButton)
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@ -228,7 +228,7 @@ describe('Ticket Edit sale path', () => {
it('should search for the claim with id 4', async() => {
const result = await nightmare
.write(selectors.claimsIndex.searchClaimInput, 4)
.click(selectors.claimsIndex.searchButton)
.waitToClick(selectors.claimsIndex.searchButton)
.waitForNumberOfElements(selectors.claimsIndex.searchResult, 1)
.countElement(selectors.claimsIndex.searchResult);
@ -249,7 +249,7 @@ describe('Ticket Edit sale path', () => {
it('should search the ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -318,7 +318,7 @@ describe('Ticket Edit sale path', () => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@ -341,7 +341,7 @@ describe('Ticket Edit sale path', () => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.write(selectors.ticketsIndex.searchTicketInput, 'id:12')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
@ -376,7 +376,7 @@ describe('Ticket Edit sale path', () => {
const url = await nightmare
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
.write(selectors.ticketsIndex.searchTicketInput, 'id:8')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24')
.waitToClick(selectors.ticketsIndex.searchResult)
@ -406,7 +406,7 @@ describe('Ticket Edit sale path', () => {
it('should search for a specific created ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -489,7 +489,7 @@ describe('Ticket Edit sale path', () => {
it('should now search for a specific ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -519,7 +519,7 @@ describe('Ticket Edit sale path', () => {
it(`should set the state of the ticket to preparation`, async() => {
const url = await nightmare
.autocompleteSearch(selectors.ticketTracking.stateAutocomplete, 'Preparación')
.click(selectors.ticketTracking.saveButton)
.waitToClick(selectors.ticketTracking.saveButton)
.waitForURL('/tracking/index')
.parsedUrl();
@ -576,7 +576,7 @@ describe('Ticket Edit sale path', () => {
it('should once again search for a specific ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:16')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);

View File

@ -33,7 +33,7 @@ describe('Ticket descriptor path', () => {
it('should search for the ticket 11', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:11')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -93,7 +93,7 @@ describe('Ticket descriptor path', () => {
it('should now search for the ticket 11', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:11')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);

View File

@ -13,7 +13,7 @@ describe('Ticket diary path', () => {
it('should search for a specific ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:1')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);

View File

@ -12,7 +12,7 @@ describe('Ticket descriptor path', () => {
it('should search for a specific ticket', async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:17')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countElement(selectors.ticketsIndex.searchResult);
@ -49,7 +49,7 @@ describe('Ticket descriptor path', () => {
it(`should search for the deleted ticket and check it's date`, async() => {
const result = await nightmare
.write(selectors.ticketsIndex.searchTicketInput, 'id:17')
.click(selectors.ticketsIndex.searchButton)
.waitToClick(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.wait(selectors.ticketsIndex.searchResultDate)
.waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText');

View File

@ -34,7 +34,7 @@ describe('Ticket services path', () => {
const result = await nightmare
.waitToClick(selectors.ticketBasicData.basicDataButton)
.wait(selectors.ticketBasicData.clientAutocomplete)
.click(selectors.ticketService.serviceButton)
.waitToClick(selectors.ticketService.serviceButton)
.waitToGetProperty(selectors.ticketService.firstDescriptionInput, 'value');
expect(result).toEqual('my service');
@ -77,7 +77,7 @@ describe('Ticket services path', () => {
const result = await nightmare
.waitToClick(selectors.ticketBasicData.basicDataButton)
.wait(selectors.ticketBasicData.clientAutocomplete)
.click(selectors.ticketService.serviceButton)
.waitToClick(selectors.ticketService.serviceButton)
.waitForNumberOfElements(selectors.ticketService.serviceLine, 0)
.countElement(selectors.ticketService.serviceLine);

View File

@ -9,16 +9,16 @@ describe('create client path', () => {
.loginAndModule('employee', 'client');
});
it('should access to the create client view by clicking the create-client floating button', async () => {
it('should access to the create client view by clicking the create-client floating button', async() => {
let url = await nightmare
.click(selectors.clientsIndex.createClientButton)
.waitToClick(selectors.clientsIndex.createClientButton)
.wait(selectors.createClientView.createButton)
.parsedUrl();
expect(url.hash).toEqual('#!/client/create');
});
it('should cancel the client creation to go back to clients index', async () => {
it('should cancel the client creation to go back to clients index', async() => {
let url = await nightmare
.waitToClick(selectors.globalItems.applicationsMenuButton)
.waitToClick(selectors.globalItems.clientsButton)