2018-02-15 11:28:05 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-02-20 09:00:19 +00:00
|
|
|
import createNightmare from '../../helpers/helpers';
|
2017-12-13 10:25:50 +00:00
|
|
|
|
2017-11-13 07:36:15 +00:00
|
|
|
describe('Edit fiscalData path', () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
const nightmare = createNightmare();
|
2017-12-07 14:40:16 +00:00
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should click on the Clients button of the top bar menu', () => {
|
|
|
|
return nightmare
|
2017-11-03 17:32:58 +00:00
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.clientsButton)
|
|
|
|
.wait(selectors.clientsIndex.createClientButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.urlParsed()
|
2017-11-03 17:32:58 +00:00
|
|
|
.then(url => {
|
2018-02-20 09:00:19 +00:00
|
|
|
expect(url.hash).toEqual('#!/clients');
|
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should search for the user Bruce Banner', () => {
|
|
|
|
return nightmare
|
2017-11-03 17:32:58 +00:00
|
|
|
.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);
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
|
|
|
|
2018-01-24 08:02:09 +00:00
|
|
|
describe('Confirm all addresses have EQtax false for future propagation test', () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should click on the search result to access to the client's addresses`, () => {
|
|
|
|
return nightmare
|
2017-12-14 13:56:20 +00:00
|
|
|
.waitForTextInElement(selectors.clientsIndex.searchResult, 'Bruce Banner')
|
|
|
|
.waitToClick(selectors.clientsIndex.searchResult)
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
2017-12-14 13:56:20 +00:00
|
|
|
.waitForURL('/addresses/list')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/addresses/list');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should click on the 1st edit icon to check EQtax is checked`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.wait(200)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.then(value => {
|
2018-01-24 08:02:09 +00:00
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.wait(200)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.then(value => {
|
2018-01-24 08:02:09 +00:00
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should click on the fiscal data button to start editing`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
2017-11-03 17:32:58 +00:00
|
|
|
.waitForURL('fiscal-data')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('fiscal-data');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should edit the social name', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.wait(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.type(selectors.clientFiscalData.socialNameInput, 'Hulk edited')
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm the social name have been edited', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.socialNameInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.socialNameInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Hulk edited');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should edit the fiscal id', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.wait(selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.type(selectors.clientFiscalData.fiscalIdInput, '94980061C')
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm the fiscal id have been edited', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.fiscalIdInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.fiscalIdInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('94980061C');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should check the Equalization tax checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-03 17:32:58 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should propagate the Equalization tax', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.acceptPropagationButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-08 14:43:34 +00:00
|
|
|
.then(result => {
|
2018-02-20 09:00:19 +00:00
|
|
|
expect(result).toEqual('Equivalent tax spreaded');
|
|
|
|
});
|
2017-11-08 14:43:34 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm Equalization tax checkbox is checked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.equalizationTaxCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
2018-01-24 08:02:09 +00:00
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
|
2018-01-24 08:02:09 +00:00
|
|
|
describe('Confirm all addresses have now EQtax checked', () => {
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should click on the addresses button to access to the client's addresses`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
2017-12-14 13:56:20 +00:00
|
|
|
.waitForURL('/addresses/list')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/addresses/list');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should click on the 1st edit icon to confirm EQtax is checked`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.firstEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.wait(200)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.then(value => {
|
2018-01-24 08:02:09 +00:00
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should go back to addresses then select the second one and confirm the EQtax is checked`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
|
|
|
.waitToClick(selectors.clientAddresses.secondEditButton)
|
|
|
|
.wait(selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.wait(200)
|
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientAddresses.equalizationTaxCheckboxLabel)
|
2017-12-14 13:56:20 +00:00
|
|
|
.then(value => {
|
2018-01-24 08:02:09 +00:00
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:56:20 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should go to fiscal data then edit the address', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.addressInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.addressInput)
|
|
|
|
.type(selectors.clientFiscalData.addressInput, 'Somewhere edited')
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-09 08:03:41 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm the address have been edited', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.click(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.addressInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.addressInput)
|
2017-11-09 08:03:41 +00:00
|
|
|
.then(result => {
|
2017-12-14 13:56:20 +00:00
|
|
|
expect(result).toEqual('Somewhere edited');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should edit the city', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.wait(selectors.clientFiscalData.cityInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.cityInput)
|
|
|
|
.type(selectors.clientFiscalData.cityInput, 'N/A')
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-09 08:03:41 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm the city have been edited', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.click(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.cityInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.cityInput)
|
2017-11-09 08:03:41 +00:00
|
|
|
.then(result => {
|
2017-11-09 12:54:06 +00:00
|
|
|
expect(result).toEqual('N/A');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should edit the postcode', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.wait(selectors.clientFiscalData.postcodeInput)
|
|
|
|
.clearInput(selectors.clientFiscalData.postcodeInput)
|
|
|
|
.type(selectors.clientFiscalData.postcodeInput, '12345')
|
|
|
|
.click(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-09 12:54:06 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm the postcode have been edited', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.click(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.postcodeInput)
|
|
|
|
.getInputValue(selectors.clientFiscalData.postcodeInput)
|
2017-11-09 12:54:06 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('12345');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 08:03:41 +00:00
|
|
|
});
|
2017-11-09 12:54:06 +00:00
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should edit the province`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.provinceInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.provinceFifthOption)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-11-09 13:47:09 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 13:47:09 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it(`should confirm the province have been selected`, () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.click(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.click(selectors.clientFiscalData.fiscalDataButton)
|
2017-12-07 12:35:40 +00:00
|
|
|
.wait(200)
|
2018-02-15 11:28:05 +00:00
|
|
|
.getInputValue(selectors.clientFiscalData.provinceInput)
|
2017-11-09 13:47:09 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Province two');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-11-09 13:47:09 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should uncheck the active checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.activeCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2017-12-07 12:35:40 +00:00
|
|
|
.then(result => {
|
2017-12-07 14:40:16 +00:00
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm active checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.activeCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.activeCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should uncheck the invoice by address checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:57:11 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm invoice by address checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.invoiceByAddressCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-14 13:57:11 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should check the Verified data checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm Verified data checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.verifiedDataCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.verifiedDataCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should uncheck the Has to invoice checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm Has to invoice checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.hasToInvoiceCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should uncheck the Invoice by mail checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm Invoice by mail checkbox is unchecked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.invoiceByMailCheckboxLabel)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeFalsy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should check the Vies checkbox', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientFiscalData.viesCheckboxInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.saveButton)
|
2018-02-20 09:00:19 +00:00
|
|
|
.waitForSnackbar()
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
|
|
|
|
2018-02-20 09:00:19 +00:00
|
|
|
it('should confirm Vies checkbox is checked', () => {
|
|
|
|
return nightmare
|
2018-02-15 11:28:05 +00:00
|
|
|
.waitToClick(selectors.clientBasicData.basicDataButton)
|
|
|
|
.wait(selectors.clientBasicData.nameInput)
|
|
|
|
.waitToClick(selectors.clientFiscalData.fiscalDataButton)
|
|
|
|
.wait(selectors.clientFiscalData.viesCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.evaluate(selector => {
|
|
|
|
return document.querySelector(selector).checked;
|
2018-02-15 11:28:05 +00:00
|
|
|
}, selectors.clientFiscalData.viesCheckboxInput)
|
2018-01-09 12:51:41 +00:00
|
|
|
.then(value => {
|
|
|
|
expect(value).toBeTruthy();
|
2018-02-20 09:00:19 +00:00
|
|
|
});
|
2017-12-07 12:35:40 +00:00
|
|
|
});
|
2017-11-03 17:32:58 +00:00
|
|
|
});
|