Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Daniel Herrero 2018-02-22 11:20:22 +01:00
commit 91b7be32fb
4 changed files with 17 additions and 13 deletions

View File

@ -5,7 +5,7 @@ import {URL} from 'url';
Nightmare.action('login', function(done) { Nightmare.action('login', function(done) {
this.goto(`${config.url}auth/?apiKey=salix`) this.goto(`${config.url}auth/?apiKey=salix`)
.wait(`vn-login input[name=user]`) .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') .write(`vn-login input[name=password]`, 'nightmare')
.click(`vn-login input[type=submit]`) .click(`vn-login input[type=submit]`)
// FIXME: Wait for dom to be ready: https://github.com/segmentio/nightmare/issues/481 // 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) { Nightmare.action('waitForSnackbar', function(done) {
this.wait(200) this.wait(500)
.waitForInnerText('vn-snackbar .text') .waitForInnerText('vn-snackbar .text')
.then(value => { .then(value => {
this.waitForSnackbarReset() this.waitForSnackbarReset()

View File

@ -38,7 +38,7 @@ export default {
faxInput: `${components.vnTextfield}[name="fax"]`, faxInput: `${components.vnTextfield}[name="fax"]`,
emailInput: `${components.vnTextfield}[name="email"]`, emailInput: `${components.vnTextfield}[name="email"]`,
salesPersonInput: `${components.vnAutocomplete}[field="$ctrl.client.salesPersonFk"] > vn-vertical > ${components.vnTextfield}`, 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}`, 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)`, 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}` saveButton: `${components.vnSubmit}`

View File

@ -159,10 +159,10 @@ describe('Edit basicData path', () => {
}); });
}); });
it('should select the sales person', () => { it('should select the sales person first option', () => {
return nightmare return nightmare
.waitToClick(selectors.clientBasicData.salesPersonInput) .waitToClick(selectors.clientBasicData.salesPersonInput)
.waitToClick(selectors.clientBasicData.salesBruceBannerOption) .waitToClick(selectors.clientBasicData.salesPersonOptionOne)
.wait(200) .wait(200)
.waitToClick(selectors.clientBasicData.saveButton) .waitToClick(selectors.clientBasicData.saveButton)
.waitForSnackbar() .waitForSnackbar()
@ -179,7 +179,7 @@ describe('Edit basicData path', () => {
.wait(200) .wait(200)
.getInputValue(selectors.clientBasicData.salesPersonInput) .getInputValue(selectors.clientBasicData.salesPersonInput)
.then(result => { .then(result => {
expect(result).toEqual('Bruce Banner'); expect(result).toEqual('account account');
}); });
}); });

View File

@ -1,6 +1,14 @@
INSERT INTO `util`.`config` ( `dbVersion`, `hasTriggersDisabled`, `environment`) INSERT INTO `util`.`config` ( `dbVersion`, `hasTriggersDisabled`, `environment`)
VALUES ('1.0.0', '0', 'development'); 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`) INSERT INTO `account`.`user`(`id`,`name`,`password`,`role`,`active`,`email`)
VALUES VALUES
(1, 'BruceWayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@verdnatura.es'), (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'), (10, 'JessicaJones', 'ac754a330530832ba1bf7687f577da91', 9, 1, 'JessicaJones@verdnatura.es'),
(11, 'Cyborg', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'cyborg@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`) INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`)
VALUES VALUES
(1, 'España', 0, 'ES', 1), (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`) INSERT INTO `vn`.`clientCreditLimit`(`id`, `maxAmount`, `roleFk`)
VALUES VALUES
(1, 1000, 5), (1, 9999999, 5),
(2, 600, 5), (2, 10000, 5),
(3, 0, 5); (3, 600, 5);
INSERT INTO `vn`.`clientObservation`(`id`, `clientFk`, `workerFk`, `text`, `created`) INSERT INTO `vn`.`clientObservation`(`id`, `clientFk`, `workerFk`, `text`, `created`)
VALUES VALUES