diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index b0b56ce69..42d9722a9 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -31,6 +31,8 @@ export default { socialName: `${components.vnTextfield}[name="socialName"]`, userName: `${components.vnTextfield}[name="userName"]`, email: `${components.vnTextfield}[name="email"]`, + salesPersonInput: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > ${components.vnTextfield}`, + salesBruceBannerOption: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(1)`, createButton: `${components.vnSubmit}` }, basicData: { diff --git a/e2e/paths/create_client_path.spec.js b/e2e/paths/create_client_path.spec.js index 887475d1b..0868c2239 100644 --- a/e2e/paths/create_client_path.spec.js +++ b/e2e/paths/create_client_path.spec.js @@ -179,6 +179,21 @@ describe('create client path', () => { .catch(catchErrors(done)); }); + it('should receive an error when clicking the create button having all the form fields empty but sales person', done => { + nightmare + .waitToClick(selectors.createClientView.salesPersonInput) + .waitToClick(selectors.createClientView.salesBruceBannerOption) + .wait(200) + .click(selectors.createClientView.createButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toContain(`Error: La instancia`); + done(); + }) + .catch(catchErrors(done)); + }); + it(`should create a new user with all it's data`, done => { nightmare .waitForSnackbarReset()