From 934a1bff49f302e7d4cc90f29a5aeaae49f62627 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Mon, 11 Dec 2017 08:51:48 +0100 Subject: [PATCH] create client path now adds a sales person --- e2e/helpers/selectors.js | 2 ++ e2e/paths/create_client_path.spec.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+) 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()