repairs on e2e tests completed plus Fiscal Data Path completed

This commit is contained in:
Carlos Jimenez 2017-12-07 13:35:40 +01:00
parent 78a2887ab3
commit 92fe65b898
5 changed files with 285 additions and 54 deletions

View File

@ -49,7 +49,7 @@
<vn-check label="Invoice by address" field="$ctrl.client.hasToInvoiceByAddress" vn-acl="administrative"></vn-check>
</vn-one>
<vn-one>
<vn-check label="Datos comprobados" field="$ctrl.client.isTaxDataChecked" vn-acl="administrative"></vn-check>
<vn-check label="Verified data" field="$ctrl.client.isTaxDataChecked" vn-acl="administrative"></vn-check>
</vn-one>
</vn-horizontal>
<vn-horizontal>

View File

@ -18,5 +18,6 @@
"Pay method" : "Forma de pago",
"Address": "Consignatario",
"Credit" : "Crédito",
"Secured credit": "Crédito asegurado"
"Secured credit": "Crédito asegurado",
"Verified data": "Datos comprobados"
}

View File

@ -49,17 +49,22 @@ export default {
fiscalData: {
fiscalDataButton: `${components.vnMenuItem}[ui-sref="clientCard.fiscalData"]`,
socialNameInput: `${components.vnTextfield}[name="socialName"]`,
hasToInvoiceCheckboxLabel: `${components.vnCheck}[label='Has to invoice'] > label`,
hasToInvoiceCheckboxInput: `${components.vnCheck}[label='Has to invoice'] > label > label > input`,
invoiceByMailCheckboxLabel: `${components.vnCheck}[label='Invoice by mail'] > label`,
invoiceByMailCheckboxInput: `${components.vnCheck}[label='Invoice by mail'] > label > label > input`,
fiscalIdInput: `${components.vnTextfield}[name="fi"]`,
equalizationTaxCheckboxLabel: `${components.vnCheck}[label='Equalization tax'] > label`,
cancelPropagationButton: `body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-one > vn-vertical > vn-client-fiscal-data > vn-dialog > div > form > div.button-bar > tpl-buttons > button:nth-child(1)`,
addressInput: `${components.vnTextfield}[name="street"]`,
cityInput: `${components.vnTextfield}[name="city"]`,
postcodeInput: `${components.vnTextfield}[name="postcode"]`,
provinceInput: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > ${components.vnTextfield}`,
provinceFifthOption: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(2) > ul > li:nth-child(5)`,
provinceFifthOption: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(5)`,
countryInput: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > ${components.vnTextfield}`,
countryThirdOption: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(3) > ul > li:nth-child(3)`,
countryThirdOption: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`,
activeCheckboxLabel: `${components.vnCheck}[label='Active'] > label`,
invoiceByAddressCheckboxInput: `${components.vnCheck}[label='Invoice by address'] > label > input`,
verifiedDataCheckboxInput: `${components.vnCheck}[label='Verified data'] > label > input`,
hasToInvoiceCheckboxLabel: `${components.vnCheck}[label='Has to invoice'] > label`,
invoiceByMailCheckboxLabel: `${components.vnCheck}[label='Invoice by mail'] > label`,
viesCheckboxInput: `${components.vnCheck}[label='Vies'] > label > input`,
saveButton: `${components.vnSubmit}`
}
};

View File

@ -226,7 +226,7 @@ describe('Edit basicData path', () => {
nightmare
.waitToClick(selectors.basicData.salesPersonInput)
.waitToClick(selectors.basicData.salesBruceBannerOption)
.wait(100)
.wait(200)
.waitToClick(selectors.basicData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -243,7 +243,7 @@ describe('Edit basicData path', () => {
.waitToClick(selectors.fiscalData.fiscalDataButton)
.wait(selectors.fiscalData.addressInput)
.waitToClick(selectors.basicData.basicDataButton)
.wait(selectors.basicData.salesPersonInput)
.wait(200)
.getInputValue(selectors.basicData.salesPersonInput)
.then(result => {
expect(result).toEqual('Bruce Banner');
@ -256,7 +256,7 @@ describe('Edit basicData path', () => {
nightmare
.waitToClick(selectors.basicData.channelInput)
.waitToClick(selectors.basicData.channelMetropolisOption)
.wait(100)
.wait(400)
.waitToClick(selectors.basicData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -273,7 +273,7 @@ describe('Edit basicData path', () => {
.waitToClick(selectors.fiscalData.fiscalDataButton)
.wait(selectors.fiscalData.addressInput)
.waitToClick(selectors.basicData.basicDataButton)
.wait(selectors.basicData.channelInput)
.wait(400)
.getInputValue(selectors.basicData.channelInput)
.then(result => {
expect(result).toEqual('Metropolis newspaper');

View File

@ -73,9 +73,69 @@ describe('Edit fiscalData path', () => {
.catch(catchErrors(done));
});
it('should uncheck the hasToInvoice checkbox', done => {
it('should edit the social name', done => {
nightmare
.waitToClick(selectors.fiscalData.hasToInvoiceCheckboxLabel)
.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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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)
.waitToClick(selectors.fiscalData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -86,27 +146,10 @@ describe('Edit fiscalData path', () => {
.catch(catchErrors(done));
});
it('should confirm hasToInvoice checkbox is unchecked', done => {
// 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 => {
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 invoiceByMail checkbox', done => {
nightmare
.waitToClick(selectors.fiscalData.invoiceByMailCheckboxLabel)
.waitToClick(selectors.fiscalData.saveButton)
.waitToClick(selectors.fiscalData.cancelPropagationButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
.then(result => {
@ -116,16 +159,16 @@ describe('Edit fiscalData path', () => {
.catch(catchErrors(done));
});
it('should confirm invoiceByMail checkbox is unchecked', done => {
it('should confirm Equalization tax checkbox is unchecked', done => {
nightmare
.waitForSnackbarReset()
.waitToClick(selectors.basicData.basicDataButton)
.wait(selectors.basicData.nameInput)
.waitToClick(selectors.fiscalData.fiscalDataButton)
.wait(selectors.fiscalData.invoiceByMailCheckboxLabel)
.wait(selectors.fiscalData.equalizationTaxCheckboxLabel)
.evaluate(selector => {
return document.querySelector(selector).checked;
}, selectors.fiscalData.invoiceByMailCheckboxLabel)
}, selectors.fiscalData.equalizationTaxCheckboxLabel)
.then(value => {
expect(value).toBeFalsy();
done();
@ -137,7 +180,7 @@ describe('Edit fiscalData path', () => {
nightmare
.wait(selectors.fiscalData.addressInput)
.clearInput(selectors.fiscalData.addressInput)
.type(selectors.fiscalData.addressInput, 'Alpha Flight Low-Orbit')
.type(selectors.fiscalData.addressInput, 'Somewhere in New York edited')
.click(selectors.fiscalData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -157,7 +200,7 @@ describe('Edit fiscalData path', () => {
.wait(selectors.fiscalData.addressInput)
.getInputValue(selectors.fiscalData.addressInput)
.then(result => {
expect(result).toEqual('Alpha Flight Low-Orbit');
expect(result).toEqual('Somewhere in New York edited');
done();
})
.catch(catchErrors(done));
@ -227,6 +270,7 @@ describe('Edit fiscalData path', () => {
nightmare
.waitToClick(selectors.fiscalData.provinceInput)
.waitToClick(selectors.fiscalData.provinceFifthOption)
.wait(200)
.waitToClick(selectors.fiscalData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -243,7 +287,7 @@ describe('Edit fiscalData path', () => {
.click(selectors.basicData.basicDataButton)
.wait(selectors.basicData.nameInput)
.click(selectors.fiscalData.fiscalDataButton)
.wait(100)
.wait(200)
.getInputValue(selectors.fiscalData.provinceInput)
.then(result => {
expect(result).toEqual('Province two');
@ -256,6 +300,7 @@ describe('Edit fiscalData path', () => {
nightmare
.waitToClick(selectors.fiscalData.countryInput)
.waitToClick(selectors.fiscalData.countryThirdOption)
.wait(200)
.waitToClick(selectors.fiscalData.saveButton)
.wait(selectors.globalItems.snackbarIsActive)
.getInnerText(selectors.globalItems.snackbarIsActive)
@ -269,10 +314,10 @@ describe('Edit fiscalData path', () => {
it(`should confirm the country have been selected`, done => {
nightmare
.waitForSnackbarReset()
.click(selectors.basicData.basicDataButton)
.wait(selectors.basicData.nameInput)
.click(selectors.fiscalData.fiscalDataButton)
.wait(selectors.fiscalData.addressInput)
.click(selectors.fiscalData.basicDataButton)
.wait(100)
.wait(200)
.getInputValue(selectors.fiscalData.countryInput)
.then(result => {
expect(result).toEqual('Holanda');
@ -280,4 +325,184 @@ describe('Edit fiscalData path', () => {
})
.catch(catchErrors(done));
});
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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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 => {
expect(result).toEqual('¡Datos guardados!');
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));
});
});