2017-11-03 17:32:58 +00:00
|
|
|
import config from '../helpers/config.js';
|
|
|
|
import createNightmare from '../helpers/nightmare';
|
|
|
|
import selectors from '../helpers/selectors.js';
|
|
|
|
import {catchErrors} from '../../services/utils/jasmineHelpers';
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
const moduleAccessViewHashURL = '#!/';
|
|
|
|
|
2017-11-13 07:36:15 +00:00
|
|
|
describe('Edit fiscalData path', () => {
|
2017-11-03 17:32:58 +00:00
|
|
|
describe('warm up', () => {
|
|
|
|
it('should warm up login and fixtures', done => {
|
|
|
|
nightmare
|
|
|
|
.login()
|
|
|
|
.waitForURL(moduleAccessViewHashURL)
|
|
|
|
.waitToClick(selectors.globalItems.logOutButton)
|
|
|
|
.then(() => {
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should log in', done => {
|
|
|
|
nightmare
|
|
|
|
.login()
|
|
|
|
.waitForURL(moduleAccessViewHashURL)
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
2017-11-08 14:43:34 +00:00
|
|
|
expect(url).toEqual(config.url + moduleAccessViewHashURL);
|
2017-11-03 17:32:58 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-12-07 14:40:16 +00:00
|
|
|
it('should make sure the language is English', done => {
|
|
|
|
nightmare
|
|
|
|
.wait(selectors.globalItems.languageButton)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).title;
|
|
|
|
}, selectors.globalItems.languageButton)
|
|
|
|
.then(result => {
|
|
|
|
if (result === 'Cambiar idioma') {
|
|
|
|
nightmare.click(selectors.globalItems.languageButton)
|
|
|
|
.then(done);
|
|
|
|
}
|
|
|
|
if (result != 'Cambiar idioma') {
|
|
|
|
nightmare
|
|
|
|
.then(done);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-11-03 17:32:58 +00:00
|
|
|
it('should click on the Clients button of the top bar menu', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
2017-11-08 14:43:34 +00:00
|
|
|
expect(url).toEqual(config.url + '#!/clients');
|
2017-11-03 17:32:58 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-11-09 12:54:06 +00:00
|
|
|
it('should search for the user Bruce Banner', done => {
|
2017-11-03 17:32:58 +00:00
|
|
|
nightmare
|
|
|
|
.wait(selectors.clientsIndex.searchResult)
|
|
|
|
.type(selectors.clientsIndex.searchClientInput, 'Bruce Banner')
|
|
|
|
.click(selectors.clientsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1)
|
|
|
|
.countSearchResults(selectors.clientsIndex.searchResult)
|
|
|
|
.then(result => {
|
2017-11-08 14:43:34 +00:00
|
|
|
expect(result).toEqual(1);
|
2017-11-03 17:32:58 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should click on the search result to access to the client's fiscal data`, done => {
|
|
|
|
nightmare
|
|
|
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
|
|
|
.waitToClick(selectors.clientsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.waitForURL('fiscal-data')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('fiscal-data');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-12-07 12:35:40 +00:00
|
|
|
it('should edit the social name', done => {
|
2017-11-03 17:32:58 +00:00
|
|
|
nightmare
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(selectors.fiscalData.socialNameInput)
|
|
|
|
.clearInput(selectors.fiscalData.socialNameInput)
|
|
|
|
.type(selectors.fiscalData.socialNameInput, 'Hulk edited')
|
|
|
|
.click(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the social name have been edited', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.socialNameInput)
|
|
|
|
.getInputValue(selectors.fiscalData.socialNameInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Hulk edited');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should edit the fiscal id', done => {
|
|
|
|
nightmare
|
|
|
|
.wait(selectors.fiscalData.fiscalIdInput)
|
|
|
|
.clearInput(selectors.fiscalData.fiscalIdInput)
|
|
|
|
.type(selectors.fiscalData.fiscalIdInput, '94980061C')
|
|
|
|
.click(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the fiscal id have been edited', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.fiscalIdInput)
|
|
|
|
.getInputValue(selectors.fiscalData.fiscalIdInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('94980061C');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should uncheck the Equalization tax checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.equalizationTaxCheckboxLabel)
|
2017-11-03 17:32:58 +00:00
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-03 17:32:58 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-12-07 12:35:40 +00:00
|
|
|
// there should be a test to confirm propagation on addresses view once equalization tax propagation is shown on each address
|
|
|
|
it('should not propagate the Equalization tax', done => {
|
2017-11-08 14:43:34 +00:00
|
|
|
nightmare
|
2017-12-07 12:35:40 +00:00
|
|
|
.waitToClick(selectors.fiscalData.cancelPropagationButton)
|
2017-11-08 14:43:34 +00:00
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-08 14:43:34 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-12-07 12:35:40 +00:00
|
|
|
it('should confirm Equalization tax checkbox is unchecked', done => {
|
2017-11-08 14:43:34 +00:00
|
|
|
nightmare
|
2017-12-07 12:35:40 +00:00
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
|
2017-11-09 12:54:06 +00:00
|
|
|
it('should edit the address', done => {
|
2017-11-09 08:03:41 +00:00
|
|
|
nightmare
|
|
|
|
.wait(selectors.fiscalData.addressInput)
|
|
|
|
.clearInput(selectors.fiscalData.addressInput)
|
2017-12-07 12:35:40 +00:00
|
|
|
.type(selectors.fiscalData.addressInput, 'Somewhere in New York edited')
|
2017-11-09 08:03:41 +00:00
|
|
|
.click(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-09 08:03:41 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-11-09 12:54:06 +00:00
|
|
|
it('should confirm the address have been edited', done => {
|
2017-11-09 08:03:41 +00:00
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.click(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.click(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.addressInput)
|
|
|
|
.getInputValue(selectors.fiscalData.addressInput)
|
|
|
|
.then(result => {
|
2017-12-07 12:35:40 +00:00
|
|
|
expect(result).toEqual('Somewhere in New York edited');
|
2017-11-09 08:03:41 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-11-09 12:54:06 +00:00
|
|
|
it('should edit the city', done => {
|
2017-11-09 08:03:41 +00:00
|
|
|
nightmare
|
|
|
|
.wait(selectors.fiscalData.cityInput)
|
|
|
|
.clearInput(selectors.fiscalData.cityInput)
|
|
|
|
.type(selectors.fiscalData.cityInput, 'N/A')
|
|
|
|
.click(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-09 08:03:41 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
2017-11-09 12:54:06 +00:00
|
|
|
it('should confirm the city have been edited', done => {
|
2017-11-09 08:03:41 +00:00
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.click(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.click(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.cityInput)
|
|
|
|
.getInputValue(selectors.fiscalData.cityInput)
|
|
|
|
.then(result => {
|
2017-11-09 12:54:06 +00:00
|
|
|
expect(result).toEqual('N/A');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should edit the postcode', done => {
|
|
|
|
nightmare
|
|
|
|
.wait(selectors.fiscalData.postcodeInput)
|
|
|
|
.clearInput(selectors.fiscalData.postcodeInput)
|
|
|
|
.type(selectors.fiscalData.postcodeInput, '12345')
|
|
|
|
.click(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-09 12:54:06 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm the postcode have been edited', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.click(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.click(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.postcodeInput)
|
|
|
|
.getInputValue(selectors.fiscalData.postcodeInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('12345');
|
2017-11-09 08:03:41 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
|
2017-11-09 13:47:09 +00:00
|
|
|
it(`should edit the province`, done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.provinceInput)
|
|
|
|
.waitToClick(selectors.fiscalData.provinceFifthOption)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2017-11-09 13:47:09 +00:00
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-09 13:47:09 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the province have been selected`, done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
2017-11-13 07:36:15 +00:00
|
|
|
.click(selectors.basicData.basicDataButton)
|
2017-11-09 13:47:09 +00:00
|
|
|
.wait(selectors.basicData.nameInput)
|
2017-11-13 07:36:15 +00:00
|
|
|
.click(selectors.fiscalData.fiscalDataButton)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2017-11-09 13:47:09 +00:00
|
|
|
.getInputValue(selectors.fiscalData.provinceInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Province two');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should edit the country`, done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.countryInput)
|
|
|
|
.waitToClick(selectors.fiscalData.countryThirdOption)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2017-11-09 13:47:09 +00:00
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-11-09 13:47:09 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the country have been selected`, done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
2017-12-07 12:35:40 +00:00
|
|
|
.click(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
2017-11-09 13:47:09 +00:00
|
|
|
.click(selectors.fiscalData.fiscalDataButton)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2017-11-09 13:47:09 +00:00
|
|
|
.getInputValue(selectors.fiscalData.countryInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Holanda');
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
|
|
|
it('should uncheck the active checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.activeCheckboxLabel)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm active checkbox is unchecked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.activeCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.activeCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the invoice by address checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm invoice by address checkbox is checked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the Verified data checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.verifiedDataCheckboxInput)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm Verified data checkbox is checked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.verifiedDataCheckboxInput)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.verifiedDataCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should uncheck the Has to invoice checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm Has to invoice checkbox is unchecked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should uncheck the Invoice by mail checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm Invoice by mail checkbox is unchecked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the Vies checkbox', done => {
|
|
|
|
nightmare
|
|
|
|
.waitToClick(selectors.fiscalData.viesCheckboxInput)
|
|
|
|
.waitToClick(selectors.fiscalData.saveButton)
|
|
|
|
.wait(selectors.globalItems.snackbarIsActive)
|
|
|
|
.getInnerText(selectors.globalItems.snackbarIsActive)
|
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2017-12-07 12:35:40 +00:00
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should confirm Vies checkbox is checked', done => {
|
|
|
|
nightmare
|
|
|
|
.waitForSnackbarReset()
|
|
|
|
.waitToClick(selectors.basicData.basicDataButton)
|
|
|
|
.wait(selectors.basicData.nameInput)
|
|
|
|
.waitToClick(selectors.fiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.fiscalData.viesCheckboxInput)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
|
|
|
}, selectors.fiscalData.viesCheckboxInput)
|
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
|
|
|
done();
|
|
|
|
})
|
|
|
|
.catch(catchErrors(done));
|
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|