diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 5af02780c..ceb6cb9ee 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -5,7 +5,7 @@ import {URL} from 'url'; Nightmare.action('login', function(done) { this.goto(`${config.url}auth/?apiKey=salix`) .wait(`vn-login input[name=user]`) - .write(`vn-login input[name=user]`, 'JessicaJones') + .write(`vn-login input[name=user]`, 'developer') .write(`vn-login input[name=password]`, 'nightmare') .click(`vn-login input[type=submit]`) // FIXME: Wait for dom to be ready: https://github.com/segmentio/nightmare/issues/481 @@ -186,7 +186,7 @@ Nightmare.action('waitForSnackbarReset', function(done) { }); Nightmare.action('waitForSnackbar', function(done) { - this.wait(200) + this.wait(500) .waitForInnerText('vn-snackbar .text') .then(value => { this.waitForSnackbarReset() diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 6ca1e2412..a8850a420 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -38,7 +38,7 @@ export default { faxInput: `${components.vnTextfield}[name="fax"]`, emailInput: `${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)`, + salesPersonOptionOne: `${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)`, channelInput: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > ${components.vnTextfield}`, channelMetropolisOption: `${components.vnAutocomplete}[field="$ctrl.client.contactChannelFk"] > vn-vertical > vn-drop-down > vn-vertical:not(.ng-hide) > vn-auto:nth-child(2) > ul > li:nth-child(3)`, saveButton: `${components.vnSubmit}` diff --git a/e2e/paths/client-module/02_edit_basic_data.spec.js b/e2e/paths/client-module/02_edit_basic_data.spec.js index c8b186347..6b034b36d 100644 --- a/e2e/paths/client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/client-module/02_edit_basic_data.spec.js @@ -159,10 +159,10 @@ describe('Edit basicData path', () => { }); }); - it('should select the sales person', () => { + it('should select the sales person first option', () => { return nightmare .waitToClick(selectors.clientBasicData.salesPersonInput) - .waitToClick(selectors.clientBasicData.salesBruceBannerOption) + .waitToClick(selectors.clientBasicData.salesPersonOptionOne) .wait(200) .waitToClick(selectors.clientBasicData.saveButton) .waitForSnackbar() @@ -179,7 +179,7 @@ describe('Edit basicData path', () => { .wait(200) .getInputValue(selectors.clientBasicData.salesPersonInput) .then(result => { - expect(result).toEqual('Bruce Banner'); + expect(result).toEqual('account account'); }); }); diff --git a/services/db/04-fixtures.sql b/services/db/04-fixtures.sql index 9f7bc3f63..b1210c5cb 100644 --- a/services/db/04-fixtures.sql +++ b/services/db/04-fixtures.sql @@ -1,6 +1,14 @@ INSERT INTO `util`.`config` ( `dbVersion`, `hasTriggersDisabled`, `environment`) VALUES ('1.0.0', '0', 'development'); +INSERT INTO `account`.`user`(`name`,`password`,`role`,`active`,`email`) + SELECT name,'ac754a330530832ba1bf7687f577da91',id,1,CONCAT(name,'@verdnatura.es') + FROM `account`.`role`; + +INSERT INTO `vn`.`worker`(`workerCode`, `firstName`, `name`, `userFk`) + SELECT UPPER(LPAD(role, 3, '0')),name,name,id + FROM `vn`.`user`; + INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`) VALUES (1, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@verdnatura.es'), @@ -15,10 +23,6 @@ INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`) (10, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 9, 1, 'JessicaJones@verdnatura.es'), (11, 'Cyborg', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'cyborg@verdnatura.es'); -INSERT INTO `account`.`user`(`name`,`password`,`role`,`active`,`email`) - SELECT name,'ac754a330530832ba1bf7687f577da91',id,1,CONCAT(name,'@verdnatura.es') - FROM `account`.`role`; - INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`) VALUES (1, 'EspaƱa', 0, 'ES', 1), @@ -186,9 +190,9 @@ INSERT INTO `vn`.`clientCredit`(`id`, `clientFk`, `workerFk`, `amount`, `created INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`) VALUES - (1, 1000, 5), - (2, 600, 5), - (3, 0, 5); + (1, 9999999, 5), + (2, 10000, 5), + (3, 600, 5); INSERT INTO `vn`.`clientObservation`(`id`, `clientFk`, `workerFk`, `text`, `created`) VALUES