Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2056-entry_descriptor
gitea/salix/2056-entry_descriptor There was a failure building this commit
Details
gitea/salix/2056-entry_descriptor There was a failure building this commit
Details
This commit is contained in:
commit
cec1f7b90f
|
@ -31,7 +31,9 @@ module.exports = Self => {
|
|||
const recipient = to.replace('@', '');
|
||||
|
||||
if (sender.name != recipient)
|
||||
return sendMessage(sender, to, `@${sender.name}: ${message} `);
|
||||
return sendMessage(sender, to, message);
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
async function sendMessage(sender, channel, message) {
|
||||
|
@ -42,10 +44,12 @@ module.exports = Self => {
|
|||
return sendAuth(uri, {
|
||||
'channel': channel,
|
||||
'avatar': avatar,
|
||||
'alias': sender.nickname,
|
||||
'text': message
|
||||
}).catch(async error => {
|
||||
if (error.statusCode === 401 && !this.resendAttempted) {
|
||||
this.resendAttempted = true;
|
||||
this.auth = null;
|
||||
|
||||
return sendMessage(sender, channel, message);
|
||||
}
|
||||
|
|
|
@ -30,24 +30,19 @@ module.exports = Self => {
|
|||
const query = `SELECT worker_isWorking(?) isWorking`;
|
||||
const [result] = await Self.rawSql(query, [workerId]);
|
||||
|
||||
let room;
|
||||
if (result.isWorking)
|
||||
room = `@${account.name}`;
|
||||
else {
|
||||
if (!result.isWorking) {
|
||||
const workerDepartment = await models.WorkerDepartment.findById(workerId, {
|
||||
include: {
|
||||
relation: 'department'
|
||||
}
|
||||
});
|
||||
const department = workerDepartment.department();
|
||||
const department = workerDepartment && workerDepartment.department();
|
||||
const channelName = department.chatName;
|
||||
room = `#${channelName}`;
|
||||
|
||||
if (channelName)
|
||||
room = `#${channelName}`;
|
||||
else room = `@${account.name}`;
|
||||
return Self.send(ctx, `#${channelName}`, `@${account.name} => ${message}`);
|
||||
}
|
||||
|
||||
return Self.send(ctx, room, message);
|
||||
return Self.send(ctx, `@${account.name}`, message);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('sendMessage', {
|
||||
description: 'Send a RocketChat message',
|
||||
accessType: 'WRITE',
|
||||
accepts: [{
|
||||
arg: 'to',
|
||||
type: 'String',
|
||||
required: true,
|
||||
description: 'user (@) or channel (#) to send the message'
|
||||
}, {
|
||||
arg: 'message',
|
||||
type: 'String',
|
||||
required: true,
|
||||
description: 'The message'
|
||||
}],
|
||||
returns: {
|
||||
type: 'Object',
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/sendMessage`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
// FIXME: Deprecate this method #2019
|
||||
Self.sendMessage = async(ctx, to, message) => {
|
||||
return Self.send(ctx, to, message);
|
||||
};
|
||||
};
|
|
@ -9,10 +9,10 @@ describe('chat send()', () => {
|
|||
expect(response.message).toEqual('Fake notification sent');
|
||||
});
|
||||
|
||||
it('should not return a response', async() => {
|
||||
it('should retrun false as response', async() => {
|
||||
let ctx = {req: {accessToken: {userId: 18}}};
|
||||
let response = await app.models.Chat.send(ctx, '@salesPerson', 'I changed something');
|
||||
|
||||
expect(response).toBeUndefined();
|
||||
expect(response).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('chat sendCheckingPresence()', () => {
|
|||
|
||||
expect(response.statusCode).toEqual(200);
|
||||
expect(response.message).toEqual('Fake notification sent');
|
||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', 'I changed something');
|
||||
expect(chatModel.send).toHaveBeenCalledWith(ctx, '#cooler', '@HankPym => I changed something');
|
||||
});
|
||||
|
||||
it(`should call to send() method with the worker username when the worker is working`, async() => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/chat/send')(Self);
|
||||
require('../methods/chat/sendMessage')(Self);
|
||||
require('../methods/chat/sendCheckingPresence')(Self);
|
||||
};
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
CREATE TABLE `vn`.`zoneClosure` (
|
||||
`zoneFk` INT NOT NULL,
|
||||
`dated` DATE NOT NULL,
|
||||
`hour` TIME NOT NULL,
|
||||
PRIMARY KEY (`zoneFk`, `dated`));
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
DROP procedure IF EXISTS vn.`zoneClosure_recalc`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE vn.`zoneClosure_recalc`()
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Recalculates the delivery time (hour) for every zone in days + scope in future
|
||||
*/
|
||||
DECLARE vScope INT;
|
||||
DECLARE vCounter INT DEFAULT 0;
|
||||
DECLARE vShipped DATE DEFAULT CURDATE();
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
DO RELEASE_LOCK('vn.zoneClosure_recalc');
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
IF NOT GET_LOCK('vn.zoneClosure_recalc', 0) THEN
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
SELECT scope INTO vScope
|
||||
FROM zoneConfig;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
|
||||
CREATE TEMPORARY TABLE tmp.zone
|
||||
(INDEX (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT id FROM zone;
|
||||
|
||||
TRUNCATE TABLE zoneClosure;
|
||||
|
||||
REPEAT
|
||||
CALL zone_getOptionsForShipment(vShipped);
|
||||
INSERT INTO zoneClosure(zoneFk, dated, `hour`)
|
||||
SELECT zoneFk, vShipped, `hour` FROM tmp.zoneOption;
|
||||
|
||||
SET vCounter = vCounter + 1;
|
||||
SET vShipped = TIMESTAMPADD(DAY, 1, vShipped);
|
||||
UNTIL vCounter > vScope
|
||||
END REPEAT;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.zone;
|
||||
DO RELEASE_LOCK('vn.zoneClosure_recalc');
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
CREATE TABLE `vn`.`zoneConfig` (
|
||||
`id` INT UNSIGNED NOT NULL,
|
||||
`scope` INT UNSIGNED NOT NULL,
|
||||
PRIMARY KEY (`id`));
|
||||
|
||||
ALTER TABLE `vn`.`zoneConfig`
|
||||
CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ;
|
||||
|
||||
INSERT INTO `vn`.`zoneConfig` (`scope`) VALUES ('1');
|
||||
|
||||
INSERT INTO `bs`.`nightTask` (`order`, `schema`, `procedure`) VALUES ('100', 'vn', 'zoneClosure_recalc');
|
|
@ -1,254 +0,0 @@
|
|||
DROP procedure IF EXISTS `vn`.`catalog_componentCalculate`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`catalog_componentCalculate`(
|
||||
vZoneFk INT,
|
||||
vAddressFk INT,
|
||||
vShipped DATE)
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Calcula los componentes de los articulos de tmp.ticketLot
|
||||
*
|
||||
* @param vZoneFk para calcular el transporte
|
||||
* @param vAgencyModeFk Id del modo de agencia
|
||||
* @param tmp.ticketLot (warehouseFk,available,itemFk,buyFk)
|
||||
*
|
||||
* @return tmp.ticketComponent(itemFk, warehouseFk, available, rate2, rate3, minPrice,
|
||||
* packing, grouping, groupingMode, buyFk, typeFk)
|
||||
* @return tmp.ticketComponentPrice (warehouseFk, itemFk, rate, grouping, price)
|
||||
*/
|
||||
DECLARE vClientFk INT;
|
||||
DECLARE vGeneralInflationCoefficient INT DEFAULT 1;
|
||||
DECLARE vMinimumDensityWeight INT DEFAULT 167;
|
||||
DECLARE vBoxFreightItem INT DEFAULT 71;
|
||||
DECLARE vBoxVolume BIGINT; -- DEFAULT 138000;
|
||||
DECLARE vSpecialPriceComponent INT DEFAULT 10;
|
||||
DECLARE vDeliveryComponent INT DEFAULT 15;
|
||||
DECLARE vRecoveryComponent INT DEFAULT 17;
|
||||
DECLARE vSellByPacketComponent INT DEFAULT 22;
|
||||
DECLARE vBuyValueComponent INT DEFAULT 28;
|
||||
DECLARE vMarginComponent INT DEFAULT 29;
|
||||
DECLARE vDiscountLastItemComponent INT DEFAULT 32;
|
||||
DECLARE vExtraBaggedComponent INT DEFAULT 38;
|
||||
DECLARE vManaAutoComponent INT DEFAULT 39;
|
||||
|
||||
SELECT volume INTO vBoxVolume
|
||||
FROM vn.packaging
|
||||
WHERE id = '94';
|
||||
|
||||
SELECT clientFk INTO vClientFK
|
||||
FROM address
|
||||
WHERE id = vAddressFk;
|
||||
|
||||
SET @rate2 := 0;
|
||||
SET @rate3 := 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCalculate;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentCalculate
|
||||
(PRIMARY KEY (itemFk, warehouseFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT
|
||||
tl.itemFk, tl.warehouseFk, tl.available,
|
||||
IF((@rate2 := IFNULL(pf.rate2, b.price2)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate2) * 1.0 rate2,
|
||||
IF((@rate3 := IFNULL(pf.rate3, b.price3)) < i.minPrice AND i.hasMinPrice, i.minPrice, @rate3) * 1.0 rate3,
|
||||
IFNULL(pf.rate3, 0) AS minPrice,
|
||||
IFNULL(pf.packing, b.packing) packing,
|
||||
IFNULL(pf.`grouping`, b.`grouping`) `grouping`,
|
||||
ABS(IFNULL(pf.box, b.groupingMode)) groupingMode,
|
||||
tl.buyFk,
|
||||
i.typeFk,
|
||||
IF(i.hasKgPrice, b.weight / b.packing, NULL) weightGrouping
|
||||
FROM tmp.ticketLot tl
|
||||
JOIN buy b ON b.id = tl.buyFk
|
||||
JOIN item i ON i.id = tl.itemFk
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
LEFT JOIN itemCategory ic ON ic.id = it.categoryFk
|
||||
LEFT JOIN specialPrice sp ON sp.itemFk = i.id AND sp.clientFk = vClientFk
|
||||
LEFT JOIN (
|
||||
SELECT * FROM (
|
||||
SELECT pf.itemFk, pf.`grouping`, pf.packing, pf.box, pf.rate2, pf.rate3, zw.warehouseFk
|
||||
FROM priceFixed pf
|
||||
JOIN zoneWarehouse zw ON zw.zoneFk = vZoneFk AND (zw.warehouseFk = pf.warehouseFk OR pf.warehouseFk = 0)
|
||||
WHERE vShipped BETWEEN pf.started AND pf.ended ORDER BY pf.itemFk, pf.warehouseFk DESC
|
||||
) tpf
|
||||
GROUP BY tpf.itemFk, tpf.warehouseFk
|
||||
) pf ON pf.itemFk = tl.itemFk AND pf.warehouseFk = tl.warehouseFk
|
||||
WHERE b.buyingValue + b.freightValue + b.packageValue + b.comissionValue > 0.01 AND ic.display <> 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponent (
|
||||
`warehouseFk` INT UNSIGNED NOT NULL,
|
||||
`itemFk` INT NOT NULL,
|
||||
`componentFk` INT UNSIGNED NOT NULL,
|
||||
`cost` DECIMAL(10,4) NOT NULL,
|
||||
INDEX `itemWarehouse` USING BTREE (`itemFk` ASC, `warehouseFk` ASC),
|
||||
UNIQUE INDEX `itemWarehouseComponent` (`itemFk` ASC, `warehouseFk` ASC, `componentFk` ASC));
|
||||
|
||||
INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost)
|
||||
SELECT
|
||||
tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
vBuyValueComponent,
|
||||
b.buyingValue + b.freightValue + b.packageValue + b.comissionValue
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN buy b ON b.id = tcc.buyFk;
|
||||
|
||||
INSERT INTO tmp.ticketComponent (warehouseFk, itemFk, componentFk, cost)
|
||||
SELECT
|
||||
tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
vMarginComponent,
|
||||
tcc.rate3 - b.buyingValue - b.freightValue - b.packageValue - b.comissionValue
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN buy b ON b.id = tcc.buyFk;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentBase;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentBase ENGINE = MEMORY
|
||||
SELECT tc.itemFk, ROUND(SUM(tc.cost), 4) AS base, tc.warehouseFk
|
||||
FROM tmp.ticketComponent tc
|
||||
GROUP BY tc.itemFk, warehouseFk;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcb.warehouseFk, tcb.itemFk, vRecoveryComponent, ROUND(tcb.base * LEAST(cr.priceIncreasing, 0.25), 3)
|
||||
FROM tmp.ticketComponentBase tcb
|
||||
JOIN claimRatio cr ON cr.clientFk = vClientFk
|
||||
WHERE cr.priceIncreasing > 0.009;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcb.warehouseFk, tcb.itemFk, vManaAutoComponent, ROUND(base * (0.01 + wm.pricesModifierRate), 3) as manaAuto
|
||||
FROM tmp.ticketComponentBase tcb
|
||||
JOIN `client` c on c.id = vClientFk
|
||||
JOIN workerMana wm ON c.salesPersonFk = wm.workerFk
|
||||
WHERE wm.isPricesModifierActivated
|
||||
HAVING manaAuto <> 0;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcb.warehouseFk,
|
||||
tcb.itemFk,
|
||||
c.id,
|
||||
GREATEST(IFNULL(ROUND(tcb.base * c.tax, 4), 0), tcc.minPrice - tcc.rate3)
|
||||
FROM tmp.ticketComponentBase tcb
|
||||
JOIN component c
|
||||
JOIN tmp.ticketComponentCalculate tcc ON tcc.itemFk = tcb.itemFk AND tcc.warehouseFk = tcb.warehouseFk
|
||||
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
|
||||
WHERE c.id = vDiscountLastItemComponent AND c.tax <> 0 AND tcc.minPrice < tcc.rate3 AND sp.value IS NULL;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcc.warehouseFk, tcc.itemFk, vSellByPacketComponent, tcc.rate2 - tcc.rate3
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN buy b ON b.id = tcc.buyFk
|
||||
LEFT JOIN specialPrice sp ON sp.clientFk = vClientFk AND sp.itemFk = tcc.itemFk
|
||||
WHERE sp.value IS NULL;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcc.warehouseFK,
|
||||
tcc.itemFk,
|
||||
vDeliveryComponent,
|
||||
vGeneralInflationCoefficient
|
||||
* ROUND((
|
||||
i.compression
|
||||
* ic.cm3
|
||||
* IF(am.deliveryMethodFk = 1, (GREATEST(i.density, vMinimumDensityWeight) / vMinimumDensityWeight), 1)
|
||||
* IFNULL((z.price - z.bonus)
|
||||
* 1/*amz.inflation*/ , 50)) / vBoxVolume, 4
|
||||
) cost
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN item i ON i.id = tcc.itemFk
|
||||
JOIN zone z ON z.id = vZoneFk
|
||||
JOIN agencyMode am ON am.id = z.agencyModeFk
|
||||
LEFT JOIN itemCost ic ON ic.warehouseFk = tcc.warehouseFk
|
||||
AND ic.itemFk = tcc.itemFk
|
||||
HAVING cost <> 0;
|
||||
|
||||
IF (SELECT COUNT(*) FROM vn.addressForPackaging WHERE addressFk = vAddressFk) THEN
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcc.warehouseFk, b.itemFk, vExtraBaggedComponent, ap.packagingValue cost
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN vn.addressForPackaging ap
|
||||
WHERE ap.addressFk = vAddressFk;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentCopy;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentCopy ENGINE = MEMORY
|
||||
SELECT * FROM tmp.ticketComponent;
|
||||
|
||||
INSERT INTO tmp.ticketComponent
|
||||
SELECT tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
vSpecialPriceComponent,
|
||||
sp.value - SUM(tcc.cost) sumCost
|
||||
FROM tmp.ticketComponentCopy tcc
|
||||
JOIN component c ON c.id = tcc.componentFk
|
||||
JOIN specialPrice sp ON sp.clientFk = vClientFK AND sp.itemFk = tcc.itemFk
|
||||
WHERE c.classRate IS NULL
|
||||
GROUP BY tcc.itemFk, tcc.warehouseFk
|
||||
HAVING ABS(sumCost) > 0.001;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentSum;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentSum
|
||||
(INDEX (itemFk, warehouseFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT SUM(cost) sumCost, tc.itemFk, tc.warehouseFk, c.classRate
|
||||
FROM tmp.ticketComponent tc
|
||||
JOIN component c ON c.id = tc.componentFk
|
||||
GROUP BY tc.itemFk, tc.warehouseFk, c.classRate;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentRate;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentRate ENGINE = MEMORY
|
||||
SELECT tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
1 rate,
|
||||
IF(tcc.groupingMode = 1, tcc.`grouping`, 1) `grouping`,
|
||||
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) price,
|
||||
CAST(SUM(tcs.sumCost) AS DECIMAL(10,2)) / weightGrouping priceKg
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
|
||||
AND tcs.warehouseFk = tcc.warehouseFk
|
||||
WHERE IFNULL(tcs.classRate, 1) = 1
|
||||
AND tcc.groupingMode < 2 AND (tcc.packing > tcc.`grouping` or tcc.groupingMode = 0)
|
||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||
|
||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||
SELECT
|
||||
tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
2 rate,
|
||||
tcc.packing `grouping`,
|
||||
SUM(tcs.sumCost) price,
|
||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
|
||||
AND tcs.warehouseFk = tcc.warehouseFk
|
||||
WHERE tcc.available IS NULL OR (IFNULL(tcs.classRate, 2) = 2
|
||||
AND tcc.packing > 0 AND tcc.available >= tcc.packing)
|
||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||
|
||||
INSERT INTO tmp.ticketComponentRate (warehouseFk, itemFk, rate, `grouping`, price, priceKg)
|
||||
SELECT
|
||||
tcc.warehouseFk,
|
||||
tcc.itemFk,
|
||||
3 rate,
|
||||
tcc.available `grouping`,
|
||||
SUM(tcs.sumCost) price,
|
||||
SUM(tcs.sumCost) / weightGrouping priceKg
|
||||
FROM tmp.ticketComponentCalculate tcc
|
||||
JOIN tmp.ticketComponentSum tcs ON tcs.itemFk = tcc.itemFk
|
||||
AND tcs.warehouseFk = tcc.warehouseFk
|
||||
WHERE IFNULL(tcs.classRate, 3) = 3
|
||||
GROUP BY tcs.warehouseFk, tcs.itemFk;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponentPrice;
|
||||
CREATE TEMPORARY TABLE tmp.ticketComponentPrice ENGINE = MEMORY
|
||||
SELECT * FROM (
|
||||
SELECT * FROM tmp.ticketComponentRate ORDER BY price
|
||||
) t
|
||||
GROUP BY itemFk, warehouseFk, `grouping`;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.ticketComponentCalculate,
|
||||
tmp.ticketComponentSum,
|
||||
tmp.ticketComponentBase,
|
||||
tmp.ticketComponentRate,
|
||||
tmp.ticketComponentCopy;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,5 +0,0 @@
|
|||
ALTER TABLE `vn`.`chatConfig`
|
||||
ADD COLUMN `host` VARCHAR(255) NOT NULL AFTER `id`,
|
||||
CHANGE COLUMN `uri` `api` VARCHAR(255) CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' NOT NULL ;
|
||||
|
||||
UPDATE `vn`.`chatConfig` SET `host` = 'https://chat.verdnatura.es' WHERE (`id` = '1');
|
|
@ -1,6 +0,0 @@
|
|||
CREATE TABLE `vn`.`greugeConfig` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`freightPickUpPrice` DECIMAL(10,2) NOT NULL,
|
||||
PRIMARY KEY (`id`));
|
||||
|
||||
INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11');
|
|
@ -1,70 +0,0 @@
|
|||
|
||||
DROP procedure IF EXISTS `vn`.`manaSpellersRequery`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`manaSpellersRequery`(vWorkerFk INTEGER)
|
||||
BEGIN
|
||||
|
||||
DECLARE vWorkerIsExcluded BOOLEAN;
|
||||
DECLARE vFromDated DATE;
|
||||
DECLARE vToDated DATE DEFAULT TIMESTAMPADD(DAY,1,CURDATE());
|
||||
DECLARE vMana INT;
|
||||
DECLARE vAutoMana INT;
|
||||
DECLARE vManaBank INT;
|
||||
DECLARE vManaGreugeType INT;
|
||||
|
||||
SELECT id INTO vMana
|
||||
FROM `component` WHERE code = 'mana';
|
||||
|
||||
SELECT id INTO vAutoMana
|
||||
FROM `component` WHERE code = 'autoMana';
|
||||
|
||||
SELECT id INTO vManaBank
|
||||
FROM `bank` WHERE code = 'mana';
|
||||
|
||||
SELECT id INTO vManaGreugeType
|
||||
FROM `greugeType` WHERE code = 'mana';
|
||||
|
||||
SELECT COUNT(*) INTO vWorkerIsExcluded
|
||||
FROM workerManaExcluded
|
||||
WHERE workerFk = vWorkerFk;
|
||||
|
||||
IF NOT vWorkerIsExcluded THEN
|
||||
|
||||
SELECT max(dated) INTO vFromDated
|
||||
FROM clientManaCache;
|
||||
|
||||
REPLACE workerMana (workerFk, amount)
|
||||
SELECT vWorkerFk, sum(mana) FROM
|
||||
(
|
||||
SELECT s.quantity * sc.value as mana
|
||||
FROM ticket t
|
||||
JOIN address a ON a.id = t.addressFk
|
||||
JOIN client c ON c.id = a.clientFk
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
WHERE c.salesPersonFk = vWorkerFk AND sc.componentFk IN (vMana, vAutoMana)
|
||||
AND t.shipped > vFromDated AND t.shipped < vToDated
|
||||
UNION ALL
|
||||
SELECT - r.amountPaid
|
||||
FROM receipt r
|
||||
JOIN client c ON c.id = r.clientFk
|
||||
WHERE c.salesPersonFk = vWorkerFk AND bankFk = vManaBank
|
||||
AND payed > vFromDated
|
||||
UNION ALL
|
||||
SELECT g.amount
|
||||
FROM greuge g
|
||||
JOIN client c ON c.id = g.clientFk
|
||||
WHERE c.salesPersonFk = vWorkerFk AND g.greugeTypeFk = vManaGreugeType
|
||||
AND g.shipped > vFromDated and g.shipped < CURDATE()
|
||||
UNION ALL
|
||||
SELECT cc.mana
|
||||
FROM clientManaCache cc
|
||||
JOIN client c ON c.id = cc.clientFk
|
||||
WHERE c.salesPersonFk = vWorkerFk AND cc.dated = vFromDated
|
||||
) sub;
|
||||
END IF;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `timeControl_calculate`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `timeControl_calculate`(vDatedFrom DATETIME, vDatedTo DATETIME)
|
||||
BEGIN
|
||||
SET @vIsOdd := TRUE;
|
||||
SET @vUser := NULL;
|
||||
SET @vDated := NULL;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.timeControlCalculate;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp.timeControlCalculate
|
||||
SELECT userFk,
|
||||
dated,
|
||||
IF( timeWork >= 18000, @timeWork:=timeWork + 1200, @timeWork:=timeWork) timeWorkSeconds,
|
||||
SEC_TO_TIME(@timeWork ) timeWorkSexagesimal,
|
||||
@timeWork / 3600 timeWorkDecimal
|
||||
FROM (SELECT SUM(timeWork) timeWork,
|
||||
userFk,
|
||||
dated
|
||||
FROM (SELECT IF(@vUser = wtc.userFk, @vUser :=@vUser, @vUser := wtc.userFk ),
|
||||
IF(@vIsOdd, @vIsOdd := FALSE, @vIsOdd := TRUE ),
|
||||
IF(direction='in', @vIsOdd := TRUE, @vIsOdd := @vIsOdd ),
|
||||
IF(@vIsOdd, @vLastTimed:=UNIX_TIMESTAMP(timed),@vLastTimed:=@vLastTimed),
|
||||
IF(@vIsOdd, 0, UNIX_TIMESTAMP(timed)-@vLastTimed) timeWork,
|
||||
IF(direction='in', @vDated := DATE(wtc.timed), @vDated :=@vDated) dated,
|
||||
wtc.userFk,
|
||||
wtc.timed timed,
|
||||
direction
|
||||
FROM (SELECT * FROM workerTimeControl ORDER BY userFk, timed ASC) wtc
|
||||
JOIN tmp.`user` w ON w.userFk = wtc.userFk
|
||||
WHERE wtc.timed BETWEEN vDatedFrom AND vDatedTo
|
||||
ORDER BY userFk, timed ASC
|
||||
) sub
|
||||
GROUP BY userFk, dated
|
||||
ORDER BY userFk, dated
|
||||
)sub2;
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Thermograph', '*', '*', 'ALLOW', 'ROLE', 'buyer');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('TravelThermograph', '*', '*', 'ALLOW', 'ROLE', 'buyer');
|
||||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('Entry', '*', '*', 'ALLOW', 'ROLE', 'buyer');
|
|
@ -1,81 +0,0 @@
|
|||
|
||||
DROP procedure IF EXISTS `vn`.`buy_afterUpsert`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`buy_afterUpsert`(vSelf INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Triggered actions when a buy is updated or inserted.
|
||||
*
|
||||
* @param vSelf The buy reference
|
||||
*/
|
||||
DECLARE vEntryFk INT;
|
||||
DECLARE vItemFk INT;
|
||||
DECLARE vStickers INT;
|
||||
DECLARE vPacking INT;
|
||||
DECLARE vWarehouse INT;
|
||||
DECLARE vWarehouseOut INT;
|
||||
DECLARE vIsMerchandise BOOL;
|
||||
DECLARE vIsFeedStock BOOL;
|
||||
DECLARE vLanded DATE;
|
||||
DECLARE vBuyerFk INT;
|
||||
DECLARE vItemName VARCHAR(50);
|
||||
|
||||
SELECT entryFk, itemFk, stickers, packing
|
||||
INTO vEntryFk, vItemFk, vStickers, vPacking
|
||||
FROM buy
|
||||
WHERE id = vSelf;
|
||||
|
||||
SELECT t.warehouseInFk, t.warehouseOutFk, t.landed
|
||||
INTO vWarehouse, vWarehouseOut, vLanded
|
||||
FROM entry e
|
||||
JOIN travel t ON t.id = e.travelFk
|
||||
WHERE e.id = vEntryFk;
|
||||
|
||||
SELECT k.merchandise, it.workerFk, i.longName
|
||||
INTO vIsMerchandise, vBuyerFk, vItemName
|
||||
FROM itemCategory k
|
||||
JOIN itemType it ON it.categoryFk = k.id
|
||||
JOIN item i ON i.typeFk = it.id
|
||||
WHERE i.id = vItemFk;
|
||||
|
||||
IF vIsMerchandise THEN
|
||||
REPLACE itemCost SET
|
||||
itemFk = vItemFk,
|
||||
warehouseFk = vWarehouse,
|
||||
cm3 = buy_getUnitVolume(vSelf);
|
||||
END IF;
|
||||
|
||||
SELECT isFeedStock INTO vIsFeedStock
|
||||
FROM warehouse WHERE id = vWarehouseOut AND id <> 13;
|
||||
|
||||
IF vIsFeedStock THEN
|
||||
INSERT IGNORE INTO producer(`name`)
|
||||
SELECT es.company_name
|
||||
FROM buy b
|
||||
JOIN edi.ekt be ON be.id = b.ektFk
|
||||
JOIN edi.supplier es ON es.supplier_id = be.pro
|
||||
WHERE b.id = vSelf;
|
||||
|
||||
IF buy_hasNotifyPassport(vSelf, vItemFk) THEN
|
||||
CALL vn.buy_notifyPassport(vSelf, vItemFk, vStickers, vPacking);
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
-- Aviso al comprador de modificacion de entrada en Barajas
|
||||
IF (SELECT isBuyerToBeEmailed FROM warehouse WHERE id = vWarehouse)
|
||||
AND vLanded = CURDATE()
|
||||
AND vBuyerFk != account.myUserGetId()
|
||||
THEN
|
||||
|
||||
CALL vn.mail_insert(CONCAT(account.userGetNameFromId(vBuyerFk),'@verdnatura.es'),
|
||||
CONCAT(account.myUserGetName(),'@verdnatura.es'),
|
||||
CONCAT('E ',vEntryFk,' Se ha modificado item ', vItemFk, ' ',vItemName),
|
||||
'Este email se ha generado automáticamente');
|
||||
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`clientRisk_update`(vClientId INT, vCompanyId INT, vAmount DECIMAL(10,2))
|
||||
BEGIN
|
||||
IF vAmount IS NOT NULL
|
||||
THEN
|
||||
INSERT INTO clientRisk
|
||||
SET
|
||||
clientFk = vClientId,
|
||||
companyFk = vCompanyId,
|
||||
amount = vAmount
|
||||
ON DUPLICATE KEY UPDATE
|
||||
amount = amount + VALUES(amount);
|
||||
END IF;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
ALTER TABLE `vn`.`componentType`
|
||||
CHANGE COLUMN `base` `isBase` TINYINT(4) NOT NULL DEFAULT '0' COMMENT 'Marca aquellas series que se utilizan para calcular el precio base de las ventas, a efectos estadisticos' ;
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
DROP procedure IF EXISTS `bi`.`customer_risk_update`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `bi`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `bi`.`customer_risk_update`(v_customer INT, v_company INT, v_amount DECIMAL(10,2))
|
||||
BEGIN
|
||||
CALL vn.clientRisk_update(v_customer, v_company, v_amount);
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
ALTER TABLE `vn`.`department`
|
||||
ADD COLUMN `chatName` VARCHAR(45) NULL AFTER `path`;
|
|
@ -1,155 +0,0 @@
|
|||
|
||||
|
||||
DROP procedure IF EXISTS `vn`.`ticketComponentUpdateSale`;
|
||||
|
||||
DELIMITER $$
|
||||
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticketComponentUpdateSale`(vOption INT)
|
||||
BEGIN
|
||||
/**
|
||||
* A partir de la tabla tmp.sale, crea los Movimientos_componentes
|
||||
* y modifica el campo Preu de la tabla Movimientos
|
||||
*
|
||||
* @param i_option integer tipo de actualizacion
|
||||
* @param table tmp.sale tabla memory con el campo saleFk, warehouseFk
|
||||
**/
|
||||
DECLARE vComponentFk INT;
|
||||
DECLARE vRenewComponents BOOLEAN;
|
||||
DECLARE vKeepPrices BOOLEAN;
|
||||
|
||||
CASE vOption
|
||||
WHEN 1 THEN
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = FALSE;
|
||||
WHEN 2 THEN
|
||||
SET vComponentFk = 17;
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
WHEN 3 THEN
|
||||
SET vComponentFk = 37;
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
WHEN 4 THEN
|
||||
SET vComponentFk = 34;
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
WHEN 5 THEN
|
||||
SET vComponentFk = 35;
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
WHEN 6 THEN
|
||||
SET vComponentFk = 36;
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
WHEN 7 THEN
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.8, 3)
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
AND sc.componentFk NOT IN (28, 29)
|
||||
GROUP BY s.id;
|
||||
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, 29, ROUND(((s.price * (100 - s.discount) / 100) - SUM(IFNULL(sc.value, 0))) * 0.2, 3)
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
AND sc.componentFk NOT IN (28, 29)
|
||||
GROUP BY s.id;
|
||||
|
||||
SET vRenewComponents = FALSE;
|
||||
SET vKeepPrices = FALSE;
|
||||
WHEN 8 THEN
|
||||
DELETE sc.*
|
||||
FROM tmp.sale tmps JOIN saleComponent sc ON sc.saleFk = tmps.saleFk;
|
||||
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, 28, ROUND(((s.price * (100 - s.discount) / 100)), 3)
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id;
|
||||
|
||||
SET vRenewComponents = FALSE;
|
||||
SET vKeepPrices = FALSE;
|
||||
WHEN 9 THEN
|
||||
SET vRenewComponents = TRUE;
|
||||
SET vKeepPrices = TRUE;
|
||||
END CASE;
|
||||
|
||||
IF vRenewComponents THEN
|
||||
DELETE sc.*
|
||||
FROM tmp.sale tmps
|
||||
JOIN saleComponent sc ON sc.saleFk = tmps.saleFk
|
||||
JOIN `component` c ON c.id = sc.componentFk
|
||||
WHERE c.isRenewable;
|
||||
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, tc.componentFk, tc.cost
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
JOIN tmp.ticketComponent tc ON tc.itemFk = s.itemFk AND tc.warehouseFk = tmps.warehouseFk
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
AND sc.componentFk = tc.componentFk
|
||||
LEFT JOIN `component` c ON c.id = tc.componentFk
|
||||
WHERE IF(sc.componentFk IS NULL AND NOT c.isRenewable, FALSE, TRUE);
|
||||
END IF;
|
||||
|
||||
IF vKeepPrices THEN
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, vComponentFk, ROUND((s.price * (100 - s.discount) / 100) - SUM(sc.value), 3) dif
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
WHERE sc.saleFk <> vComponentFk
|
||||
GROUP BY s.id
|
||||
HAVING dif <> 0;
|
||||
ELSE
|
||||
UPDATE sale s
|
||||
JOIN item i on i.id = s.itemFk
|
||||
JOIN itemType it on it.id = i.typeFk
|
||||
JOIN (SELECT SUM(sc.value) sumValue, sc.saleFk
|
||||
FROM saleComponent sc
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
|
||||
GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
|
||||
SET s.price = sumValue
|
||||
WHERE it.code != 'PRT' ;
|
||||
|
||||
REPLACE INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, 21, ROUND((s.price * (100 - s.discount) / 100) - SUM(value), 3) saleValue
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
LEFT JOIN saleComponent sc ON sc.saleFk = s.id
|
||||
WHERE sc.componentFk != 21
|
||||
GROUP BY s.id
|
||||
HAVING ROUND(saleValue, 4) <> 0;
|
||||
END IF;
|
||||
|
||||
UPDATE sale s
|
||||
JOIN (
|
||||
SELECT SUM(sc.value) sumValue, sc.saleFk
|
||||
FROM saleComponent sc
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
|
||||
JOIN `component` c ON c.id = sc.componentFk
|
||||
JOIN componentType ct on ct.id = c.typeFk AND ct.isBase
|
||||
GROUP BY sc.saleFk) sc ON sc.saleFk = s.id
|
||||
SET s.priceFixed = sumValue, s.isPriceFixed = 1;
|
||||
|
||||
DELETE sc.*
|
||||
FROM saleComponent sc
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = sc.saleFk
|
||||
JOIN sale s on s.id = sc.saleFk
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
WHERE it.code = 'PRT';
|
||||
|
||||
INSERT INTO saleComponent(saleFk, componentFk, value)
|
||||
SELECT s.id, 15, s.price
|
||||
FROM sale s
|
||||
JOIN tmp.sale tmps ON tmps.saleFk = s.id
|
||||
JOIN item i ON i.id = s.itemFK
|
||||
JOIN itemType it ON it.id = i.typeFk
|
||||
WHERE it.code = 'PRT' AND s.price > 0;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
ALTER TABLE `vn`.`travelThermograph`
|
||||
ADD COLUMN `id` INT NOT NULL AUTO_INCREMENT FIRST,
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
ALTER TABLE `vn`.`travelThermograph`
|
||||
ADD UNIQUE INDEX `thermograph_created` (`thermographFk` ASC, `created` ASC) VISIBLE;
|
|
@ -1,27 +0,0 @@
|
|||
DROP TRIGGER IF EXISTS `vn`.`invoiceOut_afterInsert`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_afterInsert` AFTER INSERT ON `vn`.`invoiceOut` FOR EACH ROW BEGIN
|
||||
CALL clientRisk_update(NEW.clientFk, NEW.companyFk, NEW.amount);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
DROP TRIGGER IF EXISTS `vn`.`invoiceOut_beforeUpdate`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_beforeUpdate` BEFORE UPDATE ON `vn`.`invoiceOut` FOR EACH ROW
|
||||
BEGIN
|
||||
CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
|
||||
CALL clientRisk_update (NEW.clientFk, NEW.companyFk, NEW.amount);
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
||||
|
||||
DROP TRIGGER IF EXISTS `vn`.`invoiceOut_beforeDelete`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`invoiceOut_beforeDelete` BEFORE DELETE ON `invoiceOut` FOR EACH ROW BEGIN
|
||||
CALL clientRisk_update (OLD.clientFk, OLD.companyFk, -OLD.amount);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,20 +0,0 @@
|
|||
DROP TRIGGER IF EXISTS `vn`.`receipt_afterInsert`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_afterInsert` AFTER INSERT ON `receipt` FOR EACH ROW
|
||||
CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid)$$
|
||||
DELIMITER ;
|
||||
DROP TRIGGER IF EXISTS `vn`.`receipt_beforeUpdate`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_beforeUpdate` BEFORE UPDATE ON `receipt` FOR EACH ROW BEGIN
|
||||
CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid);
|
||||
CALL clientRisk_update(NEW.clientFk, NEW.companyFk, -NEW.amountPaid);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
DROP TRIGGER IF EXISTS `vn`.`receipt_beforeDelete`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`receipt_beforeDelete` BEFORE DELETE ON `receipt` FOR EACH ROW
|
||||
CALL clientRisk_update(OLD.clientFk, OLD.companyFk, OLD.amountPaid)$$
|
||||
DELIMITER ;
|
|
@ -1,29 +0,0 @@
|
|||
USE `bs`;
|
||||
DROP procedure IF EXISTS `weekWaste_getDetail`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `bs`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `weekWaste_getDetail`()
|
||||
BEGIN
|
||||
DECLARE vLastWeek DATE;
|
||||
DECLARE vWeek INT;
|
||||
DECLARE vYear INT;
|
||||
|
||||
SET vLastWeek = TIMESTAMPADD(WEEK,-1,CURDATE());
|
||||
SET vYear = YEAR(vLastWeek);
|
||||
SET vWeek = WEEK(vLastWeek, 1);
|
||||
|
||||
SELECT *, 100 * dwindle / total AS percentage
|
||||
FROM (
|
||||
SELECT buyer,
|
||||
ws.family,
|
||||
sum(ws.saleTotal) AS total,
|
||||
sum(ws.saleWaste) AS dwindle
|
||||
FROM bs.waste ws
|
||||
WHERE year = vYear AND week = vWeek
|
||||
GROUP BY buyer, family
|
||||
) sub
|
||||
ORDER BY percentage DESC;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -1,32 +0,0 @@
|
|||
USE `vn`;
|
||||
DROP function IF EXISTS `worker_isWorking`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` FUNCTION `worker_isWorking`(vWorkerFk INT) RETURNS tinyint(1)
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Comprueba si el trabajador está trabajando en el momento de la consulta
|
||||
* @return Devuelve TRUE en caso de que este trabajando. Si se encuentra en un descanso devolverá FALSE
|
||||
*/
|
||||
DECLARE vLastIn DATETIME ;
|
||||
|
||||
SELECT MAX(timed) INTO vLastIn
|
||||
FROM vn.workerTimeControl
|
||||
WHERE userFk = vWorkerFk AND
|
||||
direction = 'in';
|
||||
|
||||
IF (SELECT MOD(COUNT(*),2)
|
||||
FROM vn.workerTimeControl
|
||||
WHERE userFk = vWorkerFk AND
|
||||
timed >= vLastIn
|
||||
) THEN
|
||||
RETURN TRUE;
|
||||
ELSE
|
||||
RETURN FALSE;
|
||||
END IF;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
|
||||
DROP procedure IF EXISTS `hedera`.`order_confirmWithUser`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`order_confirmWithUser`(IN `vOrder` INT, IN `vUserId` INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Confirms an order, creating each of its tickets on the corresponding
|
||||
* date, store and user.
|
||||
*
|
||||
* @param vOrder The order identifier
|
||||
* @param vUser The user identifier
|
||||
*/
|
||||
DECLARE vOk BOOL;
|
||||
DECLARE vDone BOOL DEFAULT FALSE;
|
||||
DECLARE vWarehouse INT;
|
||||
DECLARE vShipment DATETIME;
|
||||
DECLARE vTicket INT;
|
||||
DECLARE vNotes VARCHAR(255);
|
||||
DECLARE vItem INT;
|
||||
DECLARE vConcept VARCHAR(30);
|
||||
DECLARE vAmount INT;
|
||||
DECLARE vPrice DECIMAL(10,2);
|
||||
DECLARE vSale INT;
|
||||
DECLARE vRate INT;
|
||||
DECLARE vRowId INT;
|
||||
DECLARE vDelivery DATE;
|
||||
DECLARE vAddress INT;
|
||||
DECLARE vIsConfirmed BOOL;
|
||||
DECLARE vClientId INT;
|
||||
DECLARE vCompanyId INT;
|
||||
DECLARE vAgencyModeId INT;
|
||||
|
||||
DECLARE TICKET_FREE INT DEFAULT 2;
|
||||
|
||||
DECLARE cDates CURSOR FOR
|
||||
SELECT zgs.shipped, r.warehouse_id
|
||||
FROM `order` o
|
||||
JOIN order_row r ON r.order_id = o.id
|
||||
LEFT JOIN tmp.zoneGetShipped zgs ON zgs.warehouseFk = r.warehouse_id
|
||||
WHERE o.id = vOrder AND r.amount != 0
|
||||
GROUP BY r.warehouse_id;
|
||||
|
||||
DECLARE cRows CURSOR FOR
|
||||
SELECT r.id, r.item_id, i.name, r.amount, r.price, r.rate
|
||||
FROM order_row r
|
||||
JOIN vn.item i ON i.id = r.item_id
|
||||
WHERE r.amount != 0
|
||||
AND r.warehouse_id = vWarehouse
|
||||
AND r.order_id = vOrder
|
||||
ORDER BY r.rate DESC;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET vDone = TRUE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
-- Carga los datos del pedido
|
||||
|
||||
SELECT o.date_send, o.address_id, o.note,
|
||||
o.confirmed, a.clientFk, o.company_id, o.agency_id
|
||||
INTO vDelivery, vAddress, vNotes,
|
||||
vIsConfirmed, vClientId, vCompanyId, vAgencyModeId
|
||||
FROM hedera.`order` o
|
||||
JOIN vn.address a ON a.id = o.address_id
|
||||
WHERE o.id = vOrder;
|
||||
|
||||
-- Comprueba que el pedido no está confirmado
|
||||
|
||||
IF vIsConfirmed THEN
|
||||
CALL util.throw ('ORDER_ALREADY_CONFIRMED');
|
||||
END IF;
|
||||
|
||||
-- Comprueba que el pedido no está vacío
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vOk
|
||||
FROM order_row WHERE order_id = vOrder AND amount > 0;
|
||||
|
||||
IF !vOk THEN
|
||||
CALL util.throw ('ORDER_EMPTY');
|
||||
END IF;
|
||||
|
||||
-- Carga las fechas de salida de cada almacén
|
||||
|
||||
CALL vn.zone_getShippedWarehouse (vDelivery, vAddress, vAgencyModeId);
|
||||
|
||||
-- Trabajador que realiza la acción
|
||||
|
||||
IF vUserId IS NULL THEN
|
||||
SELECT employeeFk INTO vUserId FROM orderConfig;
|
||||
END IF;
|
||||
|
||||
-- Crea los tickets del pedido
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
OPEN cDates;
|
||||
|
||||
lDates:
|
||||
LOOP
|
||||
SET vTicket = NULL;
|
||||
SET vDone = FALSE;
|
||||
FETCH cDates INTO vShipment, vWarehouse;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE lDates;
|
||||
END IF;
|
||||
|
||||
-- Busca un ticket existente que coincida con los parametros
|
||||
|
||||
SELECT t.id INTO vTicket
|
||||
FROM vn.ticket t
|
||||
LEFT JOIN vn.ticketState tls on tls.ticket = t.id
|
||||
JOIN `order` o
|
||||
ON o.address_id = t.addressFk
|
||||
AND vWarehouse = t.warehouseFk
|
||||
AND o.agency_id = t.agencyModeFk
|
||||
AND o.date_send = t.landed
|
||||
AND vShipment = DATE(t.shipped)
|
||||
WHERE o.id = vOrder
|
||||
AND t.invoiceOutFk IS NULL
|
||||
AND IFNULL(tls.alertLevel,0) = 0
|
||||
AND t.clientFk <> 1118
|
||||
LIMIT 1;
|
||||
|
||||
-- Crea el ticket en el caso de no existir uno adecuado
|
||||
|
||||
IF vTicket IS NULL
|
||||
THEN
|
||||
CALL vn.ticketCreateWithUser(
|
||||
vClientId,
|
||||
IFNULL(vShipment, CURDATE()),
|
||||
vWarehouse,
|
||||
vCompanyId,
|
||||
vAddress,
|
||||
vAgencyModeId,
|
||||
NULL,
|
||||
vDelivery,
|
||||
vUserId,
|
||||
vTicket
|
||||
);
|
||||
ELSE
|
||||
INSERT INTO vncontrol.inter
|
||||
SET Id_Ticket = vTicket,
|
||||
Id_Trabajador = vUserId,
|
||||
state_id = TICKET_FREE;
|
||||
END IF;
|
||||
|
||||
INSERT IGNORE INTO vn.orderTicket
|
||||
SET orderFk = vOrder,
|
||||
ticketFk = vTicket;
|
||||
|
||||
-- Añade las notas
|
||||
|
||||
IF vNotes IS NOT NULL AND vNotes != ''
|
||||
THEN
|
||||
INSERT INTO vn.ticketObservation SET
|
||||
ticketFk = vTicket,
|
||||
observationTypeFk = 4 /* salesperson */ ,
|
||||
`description` = vNotes
|
||||
ON DUPLICATE KEY UPDATE
|
||||
`description` = CONCAT(VALUES(`description`),'. ', `description`);
|
||||
END IF;
|
||||
|
||||
-- Añade los movimientos y sus componentes
|
||||
|
||||
OPEN cRows;
|
||||
|
||||
lRows:
|
||||
LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH cRows INTO vRowId, vItem, vConcept, vAmount, vPrice, vRate;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE lRows;
|
||||
END IF;
|
||||
|
||||
INSERT INTO vn.sale
|
||||
SET
|
||||
itemFk = vItem,
|
||||
ticketFk = vTicket,
|
||||
concept = vConcept,
|
||||
quantity = vAmount,
|
||||
price = vPrice,
|
||||
priceFixed = 0,
|
||||
isPriceFixed = TRUE;
|
||||
|
||||
SET vSale = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO vn.saleComponent
|
||||
(saleFk, componentFk, `value`)
|
||||
SELECT vSale, cm.component_id, cm.price
|
||||
FROM order_component cm
|
||||
JOIN vn.component c ON c.id = cm.component_id
|
||||
WHERE cm.order_row_id = vRowId
|
||||
GROUP BY vSale, cm.component_id;
|
||||
|
||||
UPDATE order_row SET Id_Movimiento = vSale
|
||||
WHERE id = vRowId;
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE cRows;
|
||||
|
||||
-- Fija el coste
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tComponents;
|
||||
CREATE TEMPORARY TABLE tComponents
|
||||
(INDEX (saleFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT SUM(sc.`value`) valueSum, sc.saleFk
|
||||
FROM vn.saleComponent sc
|
||||
JOIN vn.component c ON c.id = sc.componentFk
|
||||
JOIN vn.componentType ct ON ct.id = c.typeFk AND ct.isBase
|
||||
JOIN vn.sale s ON s.id = sc.saleFk
|
||||
WHERE s.ticketFk = vTicket
|
||||
GROUP BY sc.saleFk;
|
||||
|
||||
UPDATE vn.sale s
|
||||
JOIN tComponents mc ON mc.saleFk = s.id
|
||||
SET s.priceFixed = valueSum;
|
||||
|
||||
DROP TEMPORARY TABLE tComponents;
|
||||
END LOOP;
|
||||
|
||||
CLOSE cDates;
|
||||
|
||||
DELETE FROM basketOrder WHERE orderFk = vOrder;
|
||||
UPDATE `order` SET confirmed = TRUE, confirm_date = NOW()
|
||||
WHERE id = vOrder;
|
||||
|
||||
COMMIT;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `bi`.`tarifa_componentes_series` AS
|
||||
SELECT
|
||||
`ct`.`id` AS `tarifa_componentes_series_id`,
|
||||
`ct`.`type` AS `Serie`,
|
||||
`ct`.`isBase` AS `base`,
|
||||
`ct`.`isMargin` AS `margen`
|
||||
FROM
|
||||
`vn`.`componentType` `ct`;
|
|
@ -0,0 +1,19 @@
|
|||
ALTER TABLE `vn`.`ticket`
|
||||
ADD COLUMN `zonePrice` DECIMAL(10,2) NULL DEFAULT NULL AFTER `collectionFk`,
|
||||
ADD COLUMN `zoneBonus` DECIMAL(10,2) NULL DEFAULT NULL AFTER `zonePrice`,
|
||||
ADD COLUMN `zoneClosure` TIME NULL AFTER `zoneBonus`;
|
||||
|
||||
CREATE TABLE `vn`.`zoneCalcTicket` (
|
||||
`zoneFk` int(11) NOT NULL PRIMARY KEY,
|
||||
CONSTRAINT `zoneCalcTicketfk_1` FOREIGN KEY (`zoneFk`) REFERENCES `vn`.`zone` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
DROP EVENT IF EXISTS vn.`zone_doCalc`;
|
||||
CREATE DEFINER=`root`@`%` EVENT vn.`zone_doCalc`
|
||||
ON SCHEDULE EVERY 15 SECOND STARTS '2020-01-31 11:32:30'
|
||||
ON COMPLETION PRESERVE ENABLE
|
||||
DO CALL util.procNoOverlap('vn.zone_doCalc');
|
||||
|
||||
DROP TABLE `vn`.`zoneConfig`;
|
||||
|
||||
DROP procedure IF EXISTS vn.`zoneClosure_recalc`;
|
|
@ -0,0 +1,56 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_doCalc`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_doCalc`()
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Updates ticket fields related with zone
|
||||
*/
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vShipped DATE;
|
||||
DECLARE vZoneFk INT;
|
||||
|
||||
DECLARE cCur CURSOR FOR
|
||||
SELECT t.id, t.shipped, t.zoneFk
|
||||
FROM zoneCalcTicket zct
|
||||
JOIN ticket t ON t.zoneFk = zct.zoneFk
|
||||
WHERE shipped >= CURDATE();
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET vDone = TRUE;
|
||||
|
||||
OPEN cCur;
|
||||
|
||||
myLoop: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH cCur INTO vTicketFk, vShipped, vZoneFk;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE myLoop;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
|
||||
CREATE TEMPORARY TABLE tmp.zone
|
||||
(INDEX (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT vZoneFk id;
|
||||
|
||||
CALL zone_getOptionsForShipment(vShipped, TRUE);
|
||||
|
||||
UPDATE ticket t
|
||||
LEFT JOIN tmp.zoneOption zo ON TRUE
|
||||
SET zonePrice = zo.price, zoneBonus = zo.bonus, zoneClosure = zo.`hour`
|
||||
WHERE t.id = vTicketFk;
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE cCur;
|
||||
|
||||
DELETE FROM zoneCalcTicket;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_doCalcInitialize`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_doCalcInitialize`()
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Initialize ticket
|
||||
*/
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vLanded DATE;
|
||||
DECLARE vZoneFk INT;
|
||||
|
||||
DECLARE cCur CURSOR FOR
|
||||
SELECT t.id, t.landed, t.zoneFk
|
||||
FROM ticket t
|
||||
WHERE (zonePrice IS NULL OR zoneBonus IS NULL OR zoneClosure IS NULL)
|
||||
AND landed >= '2019-01-01' AND shipped >= '2019-01-01'
|
||||
GROUP BY landed, zoneFk;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET vDone = TRUE;
|
||||
|
||||
OPEN cCur;
|
||||
|
||||
myLoop: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH cCur INTO vTicketFk, vLanded, vZoneFk;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE myLoop;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zone;
|
||||
CREATE TEMPORARY TABLE tmp.zone
|
||||
(INDEX (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT vZoneFk id;
|
||||
|
||||
CALL zone_getOptionsForLanding(vLanded, TRUE);
|
||||
|
||||
UPDATE ticket t
|
||||
LEFT JOIN tmp.zoneOption zo ON TRUE
|
||||
SET zonePrice = zo.price, zoneBonus = zo.bonus, zoneClosure = zo.`hour`
|
||||
WHERE t.zoneFk = vZoneFk AND landed = vLanded;
|
||||
|
||||
UPDATE ticket t
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
SET zonePrice = z.price, zoneBonus = z.bonus, zoneClosure = z.`hour`
|
||||
WHERE t.zonePrice IS NULL AND z.id = vZoneFk
|
||||
AND landed >= '2019-01-01' AND shipped >= '2019-01-01';
|
||||
|
||||
END LOOP;
|
||||
|
||||
CLOSE cCur;
|
||||
|
||||
DELETE FROM zoneCalcTicket;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -0,0 +1,30 @@
|
|||
USE `util`;
|
||||
DROP procedure IF EXISTS `procNoOverlap`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `util`$$
|
||||
CREATE PROCEDURE `procNoOverlap` (procName VARCHAR(255))
|
||||
SQL SECURITY INVOKER
|
||||
proc: BEGIN
|
||||
/**
|
||||
* call procedure without overlap
|
||||
*/
|
||||
DECLARE vIsChanged BOOL;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
DO RELEASE_LOCK(procName);
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
IF !GET_LOCK(procName, 0) THEN
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
CALL exec(CONCAT('CALL ', procName));
|
||||
|
||||
DO RELEASE_LOCK(procName);
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_getOptionsForLanding`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getOptionsForLanding`(vLanded DATE, vShowExpiredZones BOOLEAN)
|
||||
BEGIN
|
||||
/**
|
||||
* Gets computed options for the passed zones and delivery date.
|
||||
*
|
||||
* @table tmp.zones(id) The zones ids
|
||||
* @param vLanded The delivery date
|
||||
* @return tmp.zoneOption The computed options
|
||||
*/
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zoneOption;
|
||||
CREATE TEMPORARY TABLE tmp.zoneOption
|
||||
ENGINE = MEMORY
|
||||
SELECT
|
||||
zoneFk,
|
||||
`hour`,
|
||||
travelingDays,
|
||||
price,
|
||||
bonus,
|
||||
TIMESTAMPADD(DAY, -travelingDays, vLanded) shipped
|
||||
FROM (
|
||||
SELECT t.id zoneFk,
|
||||
TIME(IFNULL(e.`hour`, z.`hour`)) `hour`,
|
||||
IFNULL(e.travelingDays, z.travelingDays) travelingDays,
|
||||
IFNULL(e.price, z.price) price,
|
||||
IFNULL(e.bonus, z.bonus) bonus
|
||||
FROM tmp.zone t
|
||||
JOIN zone z ON z.id = t.id
|
||||
JOIN zoneEvent e ON e.zoneFk = t.id
|
||||
WHERE (
|
||||
e.`type` = 'day'
|
||||
AND e.dated = vLanded
|
||||
) OR (
|
||||
e.`type` != 'day'
|
||||
AND e.weekDays & (1 << WEEKDAY(vLanded))
|
||||
AND (e.`started` IS NULL OR vLanded >= e.`started`)
|
||||
AND (e.`ended` IS NULL OR vLanded <= e.`ended`)
|
||||
)
|
||||
ORDER BY
|
||||
zoneFk,
|
||||
CASE
|
||||
WHEN e.`type` = 'day'
|
||||
THEN 1
|
||||
WHEN e.`type` = 'range'
|
||||
THEN 2
|
||||
ELSE 3
|
||||
END
|
||||
) t
|
||||
GROUP BY zoneFk;
|
||||
|
||||
DELETE t FROM tmp.zoneOption t
|
||||
JOIN zoneExclusion e
|
||||
ON e.zoneFk = t.zoneFk AND e.`dated` = vLanded;
|
||||
|
||||
IF NOT vShowExpiredZones THEN
|
||||
DELETE FROM tmp.zoneOption
|
||||
WHERE shipped < CURDATE()
|
||||
OR (shipped = CURDATE() AND CURTIME() > `hour`);
|
||||
END IF;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -0,0 +1,171 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `rutasAnalyze`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `rutasAnalyze`(vYear INT, vMonth INT)
|
||||
BEGIN
|
||||
|
||||
/* Analiza los costes de las rutas de reparto y lo almacena en la tabla Rutas_Master
|
||||
*
|
||||
* PAK 15/4/2019
|
||||
*/
|
||||
|
||||
DELETE FROM bi.rutasBoard
|
||||
WHERE year = vYear AND month = vMonth;
|
||||
|
||||
-- Rellenamos la tabla con los datos de las rutas VOLUMETRICAS, especialmente con los bultos "virtuales"
|
||||
INSERT INTO bi.rutasBoard(year,
|
||||
month,
|
||||
warehouse_id,
|
||||
Id_Ruta,
|
||||
Id_Agencia,
|
||||
km,
|
||||
Dia,
|
||||
Fecha,
|
||||
Bultos,
|
||||
Matricula,
|
||||
Tipo,
|
||||
Terceros)
|
||||
SELECT YEAR(r.created),
|
||||
MONTH(r.created),
|
||||
GREATEST(1,a.warehouseFk),
|
||||
r.id,
|
||||
r.agencyModeFk,
|
||||
r.kmEnd - r.kmStart,
|
||||
DAYNAME(r.created),
|
||||
r.created,
|
||||
SUM(sv.volume / ebv.m3),
|
||||
v.numberPlate,
|
||||
IF(ISNULL(`r`.`cost`), 'P', 'A'),
|
||||
r.cost
|
||||
FROM vn.route r
|
||||
JOIN vn.ticket t ON t.routeFk = r.id
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN vn.agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN vn.vehicle v ON v.id = r.vehicleFk
|
||||
JOIN vn.saleVolume sv ON sv.ticketFk = t.id
|
||||
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = 71
|
||||
WHERE YEAR(r.created) = vYear AND MONTH(r.created) = vMonth
|
||||
AND z.isVolumetric
|
||||
GROUP BY r.id;
|
||||
|
||||
-- Rellenamos la tabla con los datos de las rutas NO VOLUMETRICAS, especialmente con los bultos "virtuales"
|
||||
INSERT INTO bi.rutasBoard(year,
|
||||
month,
|
||||
warehouse_id,
|
||||
Id_Ruta,
|
||||
Id_Agencia,
|
||||
km,
|
||||
Dia,
|
||||
Fecha,
|
||||
Bultos,
|
||||
Matricula,
|
||||
Tipo,
|
||||
Terceros)
|
||||
SELECT YEAR(r.created),
|
||||
MONTH(r.created),
|
||||
GREATEST(1,a.warehouseFk),
|
||||
r.id,
|
||||
r.agencyModeFk,
|
||||
r.kmEnd - r.kmStart,
|
||||
DAYNAME(r.created),
|
||||
r.created,
|
||||
SUM(t.packages),
|
||||
v.numberPlate,
|
||||
IF(ISNULL(`r`.`cost`), 'P', 'A'),
|
||||
r.cost
|
||||
FROM vn.route r
|
||||
JOIN vn.ticket t ON t.routeFk = r.id
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
LEFT JOIN vn.agencyMode am ON am.id = r.agencyModeFk
|
||||
LEFT JOIN vn.agency a ON a.id = am.agencyFk
|
||||
LEFT JOIN vn.vehicle v ON v.id = r.vehicleFk
|
||||
WHERE YEAR(r.created) = vYear AND MONTH(r.created) = vMonth
|
||||
AND z.isVolumetric = FALSE
|
||||
GROUP BY r.id
|
||||
ON DUPLICATE KEY UPDATE Bultos = Bultos + VALUES(Bultos);
|
||||
|
||||
-- Coste REAL de cada bulto "virtual", de acuerdo con el valor apuntado a mano en la ruta
|
||||
UPDATE bi.rutasBoard r
|
||||
INNER JOIN vn2008.Rutas_Master rm ON rm.año = r.year AND rm.mes = r.month AND rm.warehouse_id = r.warehouse_id
|
||||
SET r.coste_bulto = IF(r.Tipo ='A', r.Terceros, r.km * rm.coste_km ) / r.Bultos
|
||||
WHERE r.Bultos > 0
|
||||
AND rm.año = vYear
|
||||
AND rm.mes = vMonth;
|
||||
|
||||
-- Coste PRACTICO de cada bulto, de acuerdo con los componentes de tipo AGENCIA en cada linea de venta
|
||||
UPDATE bi.rutasBoard r
|
||||
JOIN (
|
||||
SELECT t.routeFk, sum(s.quantity * sc.value) practicoTotal
|
||||
FROM vn.route r
|
||||
JOIN vn.time tm ON tm.dated = r.created
|
||||
JOIN vn.ticket t ON t.routeFk = r.id
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.saleComponent sc ON sc.saleFk = s.id
|
||||
JOIN vn.`component` c ON c.id = sc.componentFk
|
||||
JOIN vn.componentType ct ON ct.id = c.typeFk
|
||||
WHERE ct.type = 'agencia'
|
||||
AND tm.year = vYear
|
||||
AND tm.month = vMonth
|
||||
GROUP BY r.id
|
||||
) sub ON sub.routeFk = r.Id_Ruta
|
||||
SET r.practico = sub.practicoTotal / r.Bultos;
|
||||
|
||||
-- Coste TEORICO de una caja "virtual" para cada ruta, teniendo en cuenta que hay carros, pallets, etc
|
||||
UPDATE bi.rutasBoard r
|
||||
JOIN (
|
||||
SELECT t.routeFk,
|
||||
SUM(t.zonePrice/ ebv.ratio)/ count(*) AS BultoTeoricoMedio
|
||||
FROM vn.ticket t
|
||||
JOIN vn.route r ON r.id = t.routeFk
|
||||
JOIN vn.time tm ON tm.dated = r.created
|
||||
JOIN vn.expedition e ON e.ticketFk = t.id
|
||||
JOIN vn.expeditionBoxVol ebv ON ebv.boxFk = e.isBox
|
||||
JOIN vn.address ad ON ad.id = t.addressFk
|
||||
JOIN vn.client c ON c.id = ad.clientFk
|
||||
LEFT JOIN vn.zone z ON z.id = t.zoneFk
|
||||
WHERE tm.year = vYear
|
||||
AND tm.month = vMonth
|
||||
AND z.isVolumetric = FALSE
|
||||
GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
|
||||
SET r.teorico = sub.BultoTeoricoMedio;
|
||||
|
||||
-- Coste VOLUMETRICO TEORICO de una caja "virtual" para cada ruta
|
||||
UPDATE bi.rutasBoard r
|
||||
JOIN (
|
||||
SELECT t.routeFk,
|
||||
SUM(freight) AS BultoTeoricoMedio
|
||||
FROM vn.ticket t
|
||||
JOIN vn.route r ON r.id = t.routeFk
|
||||
JOIN vn.time tm ON tm.dated = r.created
|
||||
JOIN vn.saleVolume sf ON sf.ticketFk = t.id
|
||||
JOIN vn.client c ON c.id = t.clientFk
|
||||
JOIN vn.zone z ON z.id = t.zoneFk
|
||||
WHERE tm.year = vYear
|
||||
AND tm.month = vMonth
|
||||
AND z.isVolumetric != FALSE
|
||||
GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
|
||||
SET r.teorico = sub.BultoTeoricoMedio / r.Bultos;
|
||||
|
||||
-- La diferencia entre el teorico y el practico se deberia de cobrar en greuges, cada noche
|
||||
UPDATE bi.rutasBoard r
|
||||
JOIN (
|
||||
SELECT t.routeFk,
|
||||
Sum(g.amount) AS greuge
|
||||
FROM vn.ticket t
|
||||
JOIN vn.route r ON r.id = t.routeFk
|
||||
JOIN vn.time tm ON tm.dated = r.created
|
||||
JOIN vn.greuge g ON g.ticketFk = t.id
|
||||
JOIN vn.greugeType gt ON gt.id = g.greugeTypeFk
|
||||
WHERE tm.year = vYear
|
||||
AND tm.month = vMonth
|
||||
AND gt.name = 'Diferencia portes'
|
||||
GROUP BY t.routeFk) sub ON r.Id_Ruta = sub.routeFk
|
||||
SET r.greuge = sub.greuge / r.Bultos;
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `saleVolume` AS
|
||||
SELECT
|
||||
`s`.`ticketFk` AS `ticketFk`,
|
||||
`s`.`id` AS `saleFk`,
|
||||
IFNULL(ROUND(((((`i`.`compression` * (GREATEST(`i`.`density`, 167) / 167)) * `ic`.`cm3`) * `s`.`quantity`) / 1000),
|
||||
2),
|
||||
0) AS `litros`,
|
||||
`t`.`routeFk` AS `routeFk`,
|
||||
`t`.`shipped` AS `shipped`,
|
||||
(((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) / 1000000) AS `volume`,
|
||||
((((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) * (GREATEST(`i`.`density`, 167) / 167)) / 1000000) AS `physicalWeight`,
|
||||
(((`s`.`quantity` * `ic`.`cm3`) * `i`.`density`) / 1000000) AS `weight`,
|
||||
(((`s`.`quantity` * `ic`.`cm3`) * `i`.`compression`) / 1000000) AS `physicalVolume`,
|
||||
((((`s`.`quantity` * `ic`.`cm3`) * `t`.`zonePrice`) * `i`.`compression`) / `cb`.`volume`) AS `freight`
|
||||
FROM
|
||||
((((`sale` `s`
|
||||
JOIN `item` `i` ON ((`i`.`id` = `s`.`itemFk`)))
|
||||
JOIN `ticket` `t` ON ((`t`.`id` = `s`.`ticketFk`)))
|
||||
JOIN `packaging` `cb` ON ((`cb`.`id` = '94')))
|
||||
JOIN `itemCost` `ic` ON (((`ic`.`itemFk` = `s`.`itemFk`)
|
||||
AND (`ic`.`warehouseFk` = `t`.`warehouseFk`))));
|
|
@ -0,0 +1,24 @@
|
|||
DROP VIEW IF EXISTS `vn`.`saleFreight` ;
|
||||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `saleFreight__` AS
|
||||
SELECT
|
||||
`s`.`ticketFk` AS `ticketFk`,
|
||||
`t`.`clientFk` AS `clientFk`,
|
||||
`t`.`routeFk` AS `routeFk`,
|
||||
`s`.`id` AS `saleFk`,
|
||||
`t`.`zoneFk` AS `zoneFk`,
|
||||
`t`.`companyFk` AS `companyFk`,
|
||||
`t`.`shipped` AS `shipped`,
|
||||
`t`.`zonePrice` AS `price`,
|
||||
((((`s`.`quantity` * `r`.`cm3`) * `t`.`zonePrice`) * `i`.`compression`) / `cb`.`volume`) AS `freight`
|
||||
FROM
|
||||
((((`vn`.`sale` `s`
|
||||
JOIN `vn`.`item` `i` ON ((`i`.`id` = `s`.`itemFk`)))
|
||||
JOIN `vn`.`ticket` `t` ON ((`t`.`id` = `s`.`ticketFk`)))
|
||||
JOIN `vn`.`packaging` `cb` ON ((`cb`.`id` = '94')))
|
||||
JOIN `bi`.`rotacion` `r` ON (((`r`.`Id_Article` = `s`.`itemFk`)
|
||||
AND (`r`.`warehouse_id` = `t`.`warehouseFk`))));
|
|
@ -0,0 +1,41 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_getShippedWarehouse`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getShippedWarehouse`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve la mÃnima fecha de envÃo para cada warehouse
|
||||
*
|
||||
* @param vLanded La fecha de recepcion
|
||||
* @param vAddressFk Id del consignatario
|
||||
* @param vAgencyModeFk Id de la agencia
|
||||
* @return tmp.zoneGetShipped
|
||||
*/
|
||||
|
||||
CALL zone_getFromGeo(address_getGeo(vAddressFk));
|
||||
CALL zone_getOptionsForLanding(vLanded,TRUE);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetShipped;
|
||||
CREATE TEMPORARY TABLE tmp.zoneGetShipped
|
||||
ENGINE = MEMORY
|
||||
SELECT * FROM (
|
||||
SELECT zo.zoneFk,
|
||||
TIMESTAMPADD(DAY,-zo.travelingDays, vLanded) shipped,
|
||||
zo.`hour`,
|
||||
zw.warehouseFk,
|
||||
z.agencyModeFk
|
||||
FROM tmp.zoneOption zo
|
||||
JOIN zoneWarehouse zw ON zw.zoneFk = zo.zoneFk
|
||||
JOIN zone z ON z.id = zo.zoneFk
|
||||
WHERE z.agencyModeFk = vAgencyModeFk
|
||||
ORDER BY shipped) t
|
||||
GROUP BY warehouseFk;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.zone,
|
||||
tmp.zoneOption;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -0,0 +1,42 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_getAgency`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getAgency`(vAddress INT, vLanded DATE)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el listado de agencias disponibles para la fecha
|
||||
* y dirección pasadas.
|
||||
*
|
||||
* @param vAddress Id de dirección de envío, %NULL si es recogida
|
||||
* @param vLanded Fecha de recogida
|
||||
* @select Listado de agencias disponibles
|
||||
*/
|
||||
|
||||
CALL zone_getFromGeo(address_getGeo(vAddress));
|
||||
CALL zone_getOptionsForLanding(vLanded, FALSE);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetAgency;
|
||||
CREATE TEMPORARY TABLE tmp.zoneGetAgency
|
||||
(INDEX (agencyModeFk)) ENGINE = MEMORY
|
||||
SELECT am.name agencyMode,
|
||||
am.description,
|
||||
z.agencyModeFk,
|
||||
am.deliveryMethodFk,
|
||||
TIMESTAMPADD(DAY,-zo.travelingDays, vLanded) shipped,
|
||||
TRUE isIncluded,
|
||||
zo.zoneFk
|
||||
FROM tmp.zoneOption zo
|
||||
JOIN zone z ON z.id = zo.zoneFk
|
||||
JOIN agencyMode am ON am.id = z.agencyModeFk
|
||||
GROUP BY agencyModeFk;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.zone,
|
||||
tmp.zoneOption;
|
||||
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_getAvailable`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getAvailable`(vAddress INT, vLanded DATE)
|
||||
BEGIN
|
||||
CALL zone_getFromGeo(address_getGeo(vAddress));
|
||||
CALL zone_getOptionsForLanding(vLanded, FALSE);
|
||||
|
||||
SELECT * FROM tmp.zoneOption;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.zone,
|
||||
tmp.zoneOption;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -0,0 +1,41 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `zone_getWarehouse`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `zone_getWarehouse`(vAddress INT, vLanded DATE, vWarehouse INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve el listado de agencias disponibles para la fecha,
|
||||
* dirección y almacén pasados.
|
||||
*
|
||||
* @param vAddress
|
||||
* @param vWarehouse warehouse
|
||||
* @param vLanded Fecha de recogida
|
||||
* @select Listado de agencias disponibles
|
||||
*/
|
||||
|
||||
CALL zone_getFromGeo(address_getGeo(vAddress));
|
||||
CALL zone_getOptionsForLanding(vLanded, FALSE);
|
||||
|
||||
SELECT am.id agencyModeFk,
|
||||
am.name agencyMode,
|
||||
am.description,
|
||||
am.deliveryMethodFk,
|
||||
TIMESTAMPADD(DAY, -zo.travelingDays, vLanded) shipped,
|
||||
zw.warehouseFk,
|
||||
z.id zoneFk
|
||||
FROM tmp.zoneOption zo
|
||||
JOIN zone z ON z.id = zo.zoneFk
|
||||
JOIN agencyMode am ON am.id = z.agencyModeFk
|
||||
JOIN zoneWarehouse zw ON zw.zoneFk = zo.zoneFk
|
||||
WHERE zw.warehouseFk
|
||||
GROUP BY z.agencyModeFk
|
||||
ORDER BY agencyMode;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.zone,
|
||||
tmp.zoneOption;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE `vn`.`ticketUpdateAction`
|
||||
ADD COLUMN `code` VARCHAR(45) NOT NULL AFTER `description`;
|
||||
|
||||
UPDATE `vn`.`ticketUpdateAction` SET `code`='changePrice' WHERE `id`='1';
|
||||
UPDATE `vn`.`ticketUpdateAction` SET `code`='turnInMana' WHERE `id`='3';
|
|
@ -0,0 +1,2 @@
|
|||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||
VALUES ('Intrastat', '*', '*', 'ALLOW', 'ROLE', 'buyer');
|
File diff suppressed because one or more lines are too long
|
@ -35,7 +35,7 @@ INSERT INTO `vn`.`packagingConfig`(`upperGap`)
|
|||
UPDATE `account`.`role` SET id = 100 WHERE id = 0;
|
||||
|
||||
INSERT INTO `account`.`user`(`id`,`name`, `nickname`, `password`,`role`,`active`,`email`, `lang`)
|
||||
SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@mydomain.com'), 'es'
|
||||
SELECT id, name, CONCAT(name, 'Nick'),MD5('nightmare'), id, 1, CONCAT(name, '@mydomain.com'), 'EN'
|
||||
FROM `account`.`role` WHERE id <> 20
|
||||
ORDER BY id;
|
||||
|
||||
|
@ -55,18 +55,18 @@ INSERT INTO `hedera`.`tpvConfig`(`id`, `currency`, `terminal`, `transactionType`
|
|||
|
||||
INSERT INTO `account`.`user`(`id`,`name`,`nickname`, `password`,`role`,`active`,`email`,`lang`)
|
||||
VALUES
|
||||
(101, 'BruceWayne', 'Bruce Wayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'es'),
|
||||
(102, 'PetterParker', 'Petter Parker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'en'),
|
||||
(103, 'ClarkKent', 'Clark Kent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'fr'),
|
||||
(104, 'TonyStark', 'Tony Stark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'es'),
|
||||
(105, 'MaxEisenhardt', 'Max Eisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'pt'),
|
||||
(106, 'DavidCharlesHaller', 'David Charles Haller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'DavidCharlesHaller@mydomain.com', 'es'),
|
||||
(107, 'HankPym', 'Hank Pym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'HankPym@mydomain.com', 'es'),
|
||||
(108, 'CharlesXavier', 'Charles Xavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'es'),
|
||||
(109, 'BruceBanner', 'Bruce Banner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'BruceBanner@mydomain.com', 'es'),
|
||||
(110, 'JessicaJones', 'Jessica Jones', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'JessicaJones@mydomain.com', 'es'),
|
||||
(111, 'Missing', 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es'),
|
||||
(112, 'Trash', 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'es');
|
||||
(101, 'BruceWayne', 'Bruce Wayne', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'BruceWayne@mydomain.com', 'ES'),
|
||||
(102, 'PetterParker', 'Petter Parker', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'PetterParker@mydomain.com', 'EN'),
|
||||
(103, 'ClarkKent', 'Clark Kent', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'ClarkKent@mydomain.com', 'FR'),
|
||||
(104, 'TonyStark', 'Tony Stark', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'TonyStark@mydomain.com', 'ES'),
|
||||
(105, 'MaxEisenhardt', 'Max Eisenhardt', 'ac754a330530832ba1bf7687f577da91', 2, 1, 'MaxEisenhardt@mydomain.com', 'PT'),
|
||||
(106, 'DavidCharlesHaller', 'David Charles Haller', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'DavidCharlesHaller@mydomain.com', 'EN'),
|
||||
(107, 'HankPym', 'Hank Pym', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'HankPym@mydomain.com', 'EN'),
|
||||
(108, 'CharlesXavier', 'Charles Xavier', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'CharlesXavier@mydomain.com', 'EN'),
|
||||
(109, 'BruceBanner', 'Bruce Banner', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'BruceBanner@mydomain.com', 'EN'),
|
||||
(110, 'JessicaJones', 'Jessica Jones', 'ac754a330530832ba1bf7687f577da91', 1, 1, 'JessicaJones@mydomain.com', 'EN'),
|
||||
(111, 'Missing', 'Missing', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'EN'),
|
||||
(112, 'Trash', 'Trash', 'ac754a330530832ba1bf7687f577da91', 2, 0, NULL, 'EN');
|
||||
|
||||
INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`, `userFk`,`bossFk`, `phone`)
|
||||
VALUES
|
||||
|
@ -684,8 +684,14 @@ INSERT INTO `vn`.`taxCode`(`id`, `dated`, `code`, `taxTypeFk`, `rate`, `equaliza
|
|||
|
||||
INSERT INTO `vn`.`taxClass`(`id`, `description`, `code`)
|
||||
VALUES
|
||||
(1, 'Reduced VAT','R'),
|
||||
(1, 'Reduced VAT', 'R'),
|
||||
(2, 'General VAT', 'G');
|
||||
|
||||
INSERT INTO `vn`.`taxClassCode`(`taxClassFk`, `effectived`, `taxCodeFk`)
|
||||
VALUES
|
||||
(1, CURDATE(), 1),
|
||||
(1, CURDATE(), 21),
|
||||
(2, CURDATE(), 2);
|
||||
|
||||
INSERT INTO `vn`.`intrastat`(`id`, `description`, `taxClassFk`, `taxCodeFk`)
|
||||
VALUES
|
||||
|
@ -753,7 +759,7 @@ INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `pric
|
|||
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, CURDATE()),
|
||||
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 1.79, 0, 0, 0, CURDATE()),
|
||||
(9, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()),
|
||||
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, CURDATE()),
|
||||
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, CURDATE()),
|
||||
(11, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, CURDATE()),
|
||||
(12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 1.71, 0, 0, 0, CURDATE()),
|
||||
(13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, CURDATE()),
|
||||
|
@ -814,25 +820,25 @@ INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
|||
(8, 28, 1.25),
|
||||
(8, 29, 0.42),
|
||||
(8, 39, 0.017),
|
||||
|
||||
(9, 15, 3.0949),
|
||||
(9, 21, 0.001),
|
||||
(9, 28, 50),
|
||||
(9, 29, 49.4),
|
||||
(9, 28, 53),
|
||||
(9, 29, 46.4),
|
||||
(9, 39, 0.994),
|
||||
(10, 15, 0.0111),
|
||||
(10, 21, -0.001),
|
||||
(10, 28, 5),
|
||||
(10, 29, 2),
|
||||
(10, 15, 0.0199),
|
||||
(10, 28, 7),
|
||||
(10, 29, 0),
|
||||
(10, 39, 0.07),
|
||||
(11, 15, 3.0949),
|
||||
(11, 21, 0.001),
|
||||
(11, 28, 50),
|
||||
(11, 29, 49.4),
|
||||
(11, 28, 53),
|
||||
(11, 29, 46.4),
|
||||
(11, 39, 0.994),
|
||||
(12, 15, 0.0199),
|
||||
(12, 21, 0.003),
|
||||
(12, 28, 1.25),
|
||||
(12, 29, 0.42),
|
||||
(12, 28, 2.25),
|
||||
(12, 29, -0.58),
|
||||
(12, 39, 0.017),
|
||||
(13, 15, 0.114),
|
||||
(13, 28, 5),
|
||||
|
@ -1123,17 +1129,19 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
|
|||
(4, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 50.00, 500, 'fourth travel', 0),
|
||||
(5, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 2, 1, 50.00, 500, 'fifth travel', 1),
|
||||
(6, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 4, 2, 1, 50.00, 500, 'sixth travel', 1),
|
||||
(7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 1);
|
||||
(7, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'seventh travel', 1),
|
||||
(8, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 2, 1, 50.00, 500, 'eight travel', 1);
|
||||
|
||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`, `ref`, `notes`, `evaNotes`)
|
||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `companyFk`, `ref`,`isInventory`, `isRaid`, `notes`, `evaNotes`)
|
||||
VALUES
|
||||
(1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 442, 'Movement 1', 'this is the note one', 'observation one'),
|
||||
(2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 442, 'Movement 2', 'this is the note two', 'observation two'),
|
||||
(3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 442, 'Movement 3', 'this is the note three', 'observation three'),
|
||||
(4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 69, 'Movement 4', 'this is the note four', 'observation four'),
|
||||
(5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 442, 'Movement 5', 'this is the note five', 'observation five'),
|
||||
(6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 442, 'Movement 6', 'this is the note six', 'observation six'),
|
||||
(7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 7', 'this is the note seven', 'observation seven');
|
||||
(1, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 1, 442, 'Movement 1', 0, 0, '', ''),
|
||||
(2, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
|
||||
(3, 1, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 3, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
|
||||
(4, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 2, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
|
||||
(5, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 5, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
|
||||
(6, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 6, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
|
||||
(7, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
|
||||
(8, 2, DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 7, 442, 'Movement 8', 1, 1, '', '');
|
||||
|
||||
INSERT INTO `vn`.`claimRatio`(`clientFk`, `yearSale`, `claimAmount`, `claimingRate`, `priceIncreasing`, `packingRate`)
|
||||
VALUES
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,62 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||
|
||||
describe('ticket_recalcComponents()', () => {
|
||||
it('should recalculate the components in a ticket and check it', async() => {
|
||||
let stmts = [];
|
||||
let stmt;
|
||||
const ticketId = 11;
|
||||
|
||||
stmts.push('START TRANSACTION');
|
||||
|
||||
let sales = await app.models.Sale.find({where: {ticketFk: ticketId}});
|
||||
|
||||
stmt = new ParameterizedSQL('UPDATE vn.sale SET price=100 WHERE id IN(?,?)', [
|
||||
sales[0].id,
|
||||
sales[1].id
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
stmt = new ParameterizedSQL('SELECT * FROM vn.sale WHERE ticketFk = ?', [
|
||||
ticketId
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
let modifiedSales = stmts.push(stmt) - 1;
|
||||
|
||||
stmt = new ParameterizedSQL('CALL vn.ticket_recalcComponents(?)', [
|
||||
ticketId,
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
stmt = new ParameterizedSQL('SELECT * FROM vn.sale WHERE ticketFk = ?', [
|
||||
ticketId
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
let expectedSales = stmts.push(stmt) - 1;
|
||||
|
||||
stmts.push('ROLLBACK');
|
||||
|
||||
let sql = ParameterizedSQL.join(stmts, ';');
|
||||
let result = await app.models.Ticket.rawStmt(sql);
|
||||
|
||||
// original data
|
||||
const firstPrice = sales[0].price;
|
||||
const secondPrice = sales[1].price;
|
||||
|
||||
// alteratons for test purposes
|
||||
const modifiedFirstPrice = result[modifiedSales][0].price;
|
||||
const modifiedSecondPrice = result[modifiedSales][1].price;
|
||||
|
||||
// expected data after recalc
|
||||
const expectedSalesFirstPrice = result[expectedSales][0].price;
|
||||
const expectedSalesSecondPrice = result[expectedSales][1].price;
|
||||
|
||||
expect(firstPrice).not.toEqual(modifiedFirstPrice);
|
||||
expect(secondPrice).not.toEqual(modifiedSecondPrice);
|
||||
|
||||
expect(firstPrice).toEqual(expectedSalesFirstPrice);
|
||||
expect(secondPrice).toEqual(expectedSalesSecondPrice);
|
||||
});
|
||||
});
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -1,4 +1,3 @@
|
|||
/* eslint no-invalid-this: "off" */
|
||||
import {url as defaultURL} from './config';
|
||||
|
||||
let actions = {
|
||||
|
@ -13,8 +12,16 @@ let actions = {
|
|||
return exists;
|
||||
},
|
||||
|
||||
parsedUrl: async function() {
|
||||
return new URL(await this.url());
|
||||
expectURL: async function(expectedHash) {
|
||||
try {
|
||||
await this.waitForFunction(expectedHash => {
|
||||
return document.location.hash.includes(expectedHash);
|
||||
}, {}, expectedHash);
|
||||
} catch (error) {
|
||||
throw new Error(`failed to reach URL containing: ${expectedHash}`);
|
||||
}
|
||||
await this.waitForContentLoaded();
|
||||
return true;
|
||||
},
|
||||
|
||||
waitUntilNotPresent: async function(selector) {
|
||||
|
@ -23,32 +30,18 @@ let actions = {
|
|||
}, selector);
|
||||
},
|
||||
|
||||
changeLanguageToEnglish: async function() {
|
||||
let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]';
|
||||
|
||||
await this.waitToClick('#user');
|
||||
await this.wait(langSelector);
|
||||
let lang = await this.waitToGetProperty(`${langSelector} input`, 'value');
|
||||
|
||||
if (lang !== 'English')
|
||||
await this.autocompleteSearch(langSelector, 'English');
|
||||
|
||||
await this.keyboard.press('Escape');
|
||||
await this.waitForSelector(langSelector, {hidden: true});
|
||||
},
|
||||
|
||||
doLogin: async function(userName, password = 'nightmare') {
|
||||
await this.wait(`vn-login [ng-model="$ctrl.user"]`);
|
||||
await this.clearInput(`vn-login [ng-model="$ctrl.user"]`);
|
||||
await this.write(`vn-login [ng-model="$ctrl.user"]`, userName);
|
||||
await this.clearInput(`vn-login [ng-model="$ctrl.password"]`);
|
||||
await this.write(`vn-login [ng-model="$ctrl.password"]`, password);
|
||||
await this.click('vn-login button[type=submit]');
|
||||
await this.waitForSelector(`vn-login vn-textfield[ng-model="$ctrl.user"]`, {visible: true});
|
||||
await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.user"]`);
|
||||
await this.write(`vn-login vn-textfield[ng-model="$ctrl.user"]`, userName);
|
||||
await this.clearInput(`vn-login vn-textfield[ng-model="$ctrl.password"]`);
|
||||
await this.write(`vn-login vn-textfield[ng-model="$ctrl.password"]`, password);
|
||||
await this.waitToClick('vn-login button[type=submit]');
|
||||
},
|
||||
|
||||
login: async function(userName) {
|
||||
try {
|
||||
await this.waitForURL('#!/login');
|
||||
await this.expectURL('#!/login');
|
||||
} catch (e) {
|
||||
await this.goto(`${defaultURL}/#!/login`);
|
||||
let dialog = await this.evaluate(() => {
|
||||
|
@ -59,10 +52,9 @@ let actions = {
|
|||
}
|
||||
|
||||
await this.doLogin(userName);
|
||||
await this.wait(() => {
|
||||
await this.waitForFunction(() => {
|
||||
return document.location.hash === '#!/';
|
||||
}, {});
|
||||
await this.changeLanguageToEnglish();
|
||||
},
|
||||
|
||||
selectModule: async function(moduleName) {
|
||||
|
@ -72,7 +64,7 @@ let actions = {
|
|||
|
||||
let selector = `vn-home a[ui-sref="${moduleName}.index"]`;
|
||||
await this.waitToClick(selector);
|
||||
await this.waitForURL(snakeName);
|
||||
await this.expectURL(snakeName);
|
||||
},
|
||||
|
||||
loginAndModule: async function(userName, moduleName) {
|
||||
|
@ -104,14 +96,14 @@ let actions = {
|
|||
},
|
||||
|
||||
clearTextarea: async function(selector) {
|
||||
await this.wait(selector);
|
||||
await this.waitForSelector(selector, {visible: true});
|
||||
await this.evaluate(inputSelector => {
|
||||
return document.querySelector(inputSelector).value = '';
|
||||
return document.querySelector(`${inputSelector} textarea`).value = '';
|
||||
}, selector);
|
||||
},
|
||||
|
||||
clearInput: async function(selector) {
|
||||
await this.wait(selector);
|
||||
await this.waitForSelector(selector, {visible: true});
|
||||
let field = await this.evaluate(selector => {
|
||||
return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field;
|
||||
}, selector);
|
||||
|
@ -136,43 +128,55 @@ let actions = {
|
|||
},
|
||||
|
||||
waitPropertyLength: async function(selector, property, minLength) {
|
||||
await this.wait((selector, property, minLength) => {
|
||||
await this.waitForFunction((selector, property, minLength) => {
|
||||
const element = document.querySelector(selector);
|
||||
return element && element[property] != null && element[property] !== '' && element[property].length >= minLength;
|
||||
}, {}, selector, property, minLength);
|
||||
return await this.getProperty(selector, property);
|
||||
},
|
||||
|
||||
waitPropertyValue: async function(selector, property, status) {
|
||||
await this.waitForSelector(selector);
|
||||
return await this.waitForFunction((selector, property, status) => {
|
||||
const element = document.querySelector(selector);
|
||||
return element[property] === status;
|
||||
}, {}, selector, property, status);
|
||||
expectPropertyValue: async function(selector, property, value) {
|
||||
let builtSelector = selector;
|
||||
if (property != 'innerText')
|
||||
builtSelector = await this.selectorFormater(selector);
|
||||
|
||||
try {
|
||||
return await this.waitForFunction((selector, property, value) => {
|
||||
const element = document.querySelector(selector);
|
||||
return element[property] == value;
|
||||
}, {}, builtSelector, property, value);
|
||||
} catch (error) {
|
||||
throw new Error(`${value} wasn't the value of ${builtSelector}, ${error}`);
|
||||
}
|
||||
},
|
||||
|
||||
waitToGetProperty: async function(selector, property) {
|
||||
let builtSelector = selector;
|
||||
if (selector.includes('vn-input-file') || property != 'innerText')
|
||||
builtSelector = await this.selectorFormater(selector);
|
||||
|
||||
try {
|
||||
await this.waitForFunction((selector, property) => {
|
||||
const element = document.querySelector(selector);
|
||||
|
||||
return element && element[property] != null && element[property] !== '';
|
||||
}, {}, selector, property);
|
||||
return await this.getProperty(selector, property);
|
||||
}, {}, builtSelector, property);
|
||||
return await this.getProperty(builtSelector, property);
|
||||
} catch (error) {
|
||||
throw new Error(`couldn't get property: ${property} of ${selector}`);
|
||||
throw new Error(`couldn't get property: ${property} of ${builtSelector}, ${error}`);
|
||||
}
|
||||
},
|
||||
|
||||
write: async function(selector, text) {
|
||||
let builtSelector = await this.selectorFormater(selector);
|
||||
await this.waitForSelector(selector, {});
|
||||
await this.type(`${selector} input`, text);
|
||||
await this.waitForTextInInput(selector, text);
|
||||
await this.type(builtSelector, text);
|
||||
await this.waitForTextInField(selector, text);
|
||||
},
|
||||
|
||||
waitToClick: async function(selector) {
|
||||
await this.waitForSelector(selector, {});
|
||||
await this.click(selector, {waitUntil: 'domcontentloaded'});
|
||||
await this.click(selector);
|
||||
},
|
||||
|
||||
focusElement: async function(selector) {
|
||||
|
@ -253,7 +257,7 @@ let actions = {
|
|||
|
||||
waitForNumberOfElements: async function(selector, count) {
|
||||
return await this.waitForFunction((selector, count) => {
|
||||
return document.querySelectorAll(selector).length === count;
|
||||
return document.querySelectorAll(selector).length == count;
|
||||
}, {}, selector, count);
|
||||
},
|
||||
|
||||
|
@ -274,17 +278,36 @@ let actions = {
|
|||
},
|
||||
|
||||
waitForTextInElement: async function(selector, text) {
|
||||
await this.wait(selector);
|
||||
return await this.wait((selector, text) => {
|
||||
await this.waitForSelector(selector);
|
||||
return await this.waitForFunction((selector, text) => {
|
||||
return document.querySelector(selector).innerText.toLowerCase().includes(text.toLowerCase());
|
||||
}, {}, selector, text);
|
||||
},
|
||||
|
||||
waitForTextInInput: async function(selector, text) {
|
||||
await this.wait(selector);
|
||||
return await this.wait((selector, text) => {
|
||||
return document.querySelector(`${selector} input`).value.toLowerCase().includes(text.toLowerCase());
|
||||
}, {}, selector, text);
|
||||
selectorFormater: async function(selector) {
|
||||
let builtSelector = `${selector} input`;
|
||||
|
||||
if (selector.includes('vn-autocomplete'))
|
||||
return builtSelector = `${selector} input`;
|
||||
|
||||
if (selector.includes('vn-textarea'))
|
||||
return builtSelector = `${selector} textarea`;
|
||||
|
||||
if (selector.includes('vn-textfield'))
|
||||
return builtSelector = `${selector} input`;
|
||||
|
||||
if (selector.includes('vn-input-file'))
|
||||
return builtSelector = `${selector} section`;
|
||||
|
||||
return builtSelector;
|
||||
},
|
||||
|
||||
waitForTextInField: async function(selector, text) {
|
||||
let builtSelector = await this.selectorFormater(selector);
|
||||
await this.waitForSelector(builtSelector);
|
||||
return await this.waitForFunction((selector, text) => {
|
||||
return document.querySelector(selector).value.toLowerCase().includes(text.toLowerCase());
|
||||
}, {}, builtSelector, text);
|
||||
},
|
||||
|
||||
waitForInnerText: async function(selector) {
|
||||
|
@ -304,12 +327,6 @@ let actions = {
|
|||
}, selector);
|
||||
},
|
||||
|
||||
waitForURL: async function(hashURL) {
|
||||
await this.waitForFunction(expectedHash => {
|
||||
return document.location.hash.includes(expectedHash);
|
||||
}, {}, hashURL);
|
||||
},
|
||||
|
||||
hideSnackbar: async function() {
|
||||
await this.waitToClick('#shapes .shown button');
|
||||
},
|
||||
|
@ -326,7 +343,7 @@ let actions = {
|
|||
},
|
||||
|
||||
waitForLastSnackbar: async function() {
|
||||
await this.wait(2000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed
|
||||
await this.waitFor(1000); // this needs a refactor to be somehow dynamic ie: page.waitForResponse(urlOrPredicate[, options]) or something to fire waitForLastShape once the request is completed
|
||||
await this.waitForSpinnerLoad();
|
||||
return await this.waitForLastShape('vn-snackbar .shown .text');
|
||||
},
|
||||
|
@ -336,14 +353,15 @@ let actions = {
|
|||
await this.write('vn-searchbar', searchValue);
|
||||
await this.waitToClick('vn-searchbar vn-icon[icon="search"]');
|
||||
await this.waitForNumberOfElements('.search-result', 1);
|
||||
await this.waitFor(1000);
|
||||
await this.waitForContentLoaded();
|
||||
await this.evaluate(() => {
|
||||
return document.querySelector('.search-result').click();
|
||||
});
|
||||
await this.waitForContentLoaded();
|
||||
},
|
||||
|
||||
accessToSection: async function(sectionRoute) {
|
||||
await this.waitForSelector(`vn-left-menu`, {visible: true});
|
||||
await this.waitForSelector('vn-left-menu');
|
||||
let nested = await this.evaluate(sectionRoute => {
|
||||
return document.querySelector(`vn-left-menu li li > a[ui-sref="${sectionRoute}"]`) != null;
|
||||
}, sectionRoute);
|
||||
|
@ -359,18 +377,23 @@ let actions = {
|
|||
return navButton.click();
|
||||
}, sectionRoute);
|
||||
await this.waitForNavigation({waitUntil: ['networkidle0']});
|
||||
await this.waitForContentLoaded();
|
||||
},
|
||||
|
||||
autocompleteSearch: async function(selector, searchValue) {
|
||||
try {
|
||||
await this.waitToClick(`${selector} input`);
|
||||
await this.waitForSelector(selector => {
|
||||
document
|
||||
.querySelector(`${selector} vn-drop-down`).$ctrl.content
|
||||
.querySelectorAll('li');
|
||||
}, selector);
|
||||
let builtSelector = await this.selectorFormater(selector);
|
||||
|
||||
await this.write(`.vn-drop-down.shown`, searchValue);
|
||||
await this.waitForContentLoaded();
|
||||
await this.waitToClick(selector);
|
||||
await this.waitForSelector(selector => {
|
||||
document
|
||||
.querySelector(`${selector} vn-drop-down`).$ctrl.content
|
||||
.querySelectorAll('li');
|
||||
}, selector);
|
||||
|
||||
await this.write('.vn-drop-down.vn-popover.vn-popup.shown vn-textfield', searchValue);
|
||||
|
||||
try {
|
||||
await this.waitForFunction((selector, searchValue) => {
|
||||
let element = document
|
||||
.querySelector(`${selector} vn-drop-down`).$ctrl.content
|
||||
|
@ -378,20 +401,24 @@ let actions = {
|
|||
if (element)
|
||||
return element.innerText.toLowerCase().includes(searchValue.toLowerCase());
|
||||
}, {}, selector, searchValue);
|
||||
|
||||
await this.keyboard.press('Enter');
|
||||
await this.waitForFunction((selector, searchValue) => {
|
||||
return document.querySelector(`${selector} input`).value.toLowerCase()
|
||||
.includes(searchValue.toLowerCase());
|
||||
}, {}, selector, searchValue);
|
||||
} catch (error) {
|
||||
throw new Error(`${selector} failed to autocomplete ${searchValue}! ${error}`);
|
||||
let inputValue = await this.evaluate(() => {
|
||||
return document.querySelector('.vn-drop-down.vn-popover.vn-popup.shown vn-textfield input').value;
|
||||
});
|
||||
throw new Error(`${builtSelector} value is ${inputValue}! ${error}`);
|
||||
}
|
||||
await this.keyboard.press('Enter');
|
||||
await this.waitForFunction((selector, searchValue) => {
|
||||
return document.querySelector(selector).value.toLowerCase()
|
||||
.includes(searchValue.toLowerCase());
|
||||
}, {}, builtSelector, searchValue);
|
||||
|
||||
await this.waitForMutation(`.vn-drop-down`, 'childList');
|
||||
await this.waitForContentLoaded();
|
||||
},
|
||||
|
||||
reloadSection: async function(sectionRoute) {
|
||||
await this.waitFor(1000);
|
||||
await this.waitForContentLoaded();
|
||||
await Promise.all([
|
||||
this.waitForNavigation({waitUntil: 'networkidle0'}),
|
||||
this.click('vn-icon[icon="desktop_windows"]', {}),
|
||||
|
@ -401,6 +428,7 @@ let actions = {
|
|||
this.waitForNavigation({waitUntil: 'networkidle0'}),
|
||||
this.click(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`, {}),
|
||||
]);
|
||||
await this.waitForContentLoaded();
|
||||
},
|
||||
|
||||
forceReloadSection: async function(sectionRoute) {
|
||||
|
@ -426,7 +454,7 @@ let actions = {
|
|||
},
|
||||
|
||||
isDisabled: async function(selector) {
|
||||
await this.wait(selector);
|
||||
await this.waitForSelector(selector);
|
||||
return await this.evaluate(selector => {
|
||||
let element = document.querySelector(selector);
|
||||
return element.$ctrl.disabled;
|
||||
|
@ -490,6 +518,13 @@ let actions = {
|
|||
}, selector);
|
||||
},
|
||||
|
||||
closePopup: async function(selector) {
|
||||
await Promise.all([
|
||||
this.keyboard.press('Escape'),
|
||||
this.waitForSelector('.vn-popup', {hidden: true}),
|
||||
]);
|
||||
},
|
||||
|
||||
waitForContentLoaded: async function() {
|
||||
await this.waitFor(1000);
|
||||
// to be implemented in base of a directive loaded once al modules are done loading, further investigation required.
|
||||
|
|
|
@ -4,16 +4,29 @@ import {extendPage} from './extensions';
|
|||
import {url as defaultURL} from './config';
|
||||
|
||||
export async function getBrowser() {
|
||||
let headless = !process.env.E2E_SHOW;
|
||||
const browser = await Puppeteer.launch({
|
||||
args: [
|
||||
'--no-sandbox',
|
||||
`--window-size=${ 1920 },${ 1080 }`
|
||||
],
|
||||
defaultViewport: null,
|
||||
headless: false,
|
||||
headless: headless,
|
||||
slowMo: 0, // slow down by ms
|
||||
});
|
||||
let page = (await browser.pages())[0];
|
||||
await page.evaluateOnNewDocument(() => {
|
||||
Object.defineProperty(navigator, 'language', {
|
||||
get: function() {
|
||||
return 'en';
|
||||
}
|
||||
});
|
||||
Object.defineProperty(navigator, 'languages', {
|
||||
get: function() {
|
||||
return ['en'];
|
||||
}
|
||||
});
|
||||
});
|
||||
page = extendPage(page);
|
||||
page.setDefaultTimeout(5000);
|
||||
await page.goto(defaultURL, {waitUntil: 'networkidle0'});
|
||||
|
|
|
@ -21,25 +21,36 @@ export default {
|
|||
acceptButton: '.vn-confirm.shown button[response=accept]'
|
||||
},
|
||||
clientsIndex: {
|
||||
searchClientInput: 'vn-topbar',
|
||||
topbarSearch: 'vn-topbar',
|
||||
searchButton: 'vn-searchbar vn-icon[icon="search"]',
|
||||
searchResult: 'vn-client-index .vn-item',
|
||||
createClientButton: `vn-float-button`,
|
||||
othersButton: 'vn-left-menu li[name="Others"] > a'
|
||||
},
|
||||
clientSummary: {
|
||||
header: 'vn-client-summary > vn-card > h5',
|
||||
email: 'vn-client-summary vn-label-value[label="Email"]',
|
||||
street: 'vn-client-summary vn-label-value[label="Street"]',
|
||||
verifiedData: 'vn-client-summary > vn-card > vn-horizontal vn-check[ng-model="$ctrl.summary.isTaxDataChecked"]',
|
||||
payMethod: 'vn-client-summary vn-label-value[label="Pay method"]',
|
||||
defaultAdressName: 'vn-client-summary vn-label-value[label="Name"]',
|
||||
userName: 'vn-client-summary vn-label-value[label="User"]',
|
||||
rate: 'vn-client-summary vn-label-value[label="Rate"]',
|
||||
credit: 'vn-client-summary vn-label-value[label="Credit"]',
|
||||
},
|
||||
createClientView: {
|
||||
name: `vn-client-create [ng-model="$ctrl.client.name"]`,
|
||||
taxNumber: 'vn-client-create [ng-model="$ctrl.client.fi"]',
|
||||
socialName: 'vn-client-create [ng-model="$ctrl.client.socialName"]',
|
||||
street: 'vn-client-create [ng-model="$ctrl.client.street"]',
|
||||
postcode: 'vn-client-create [ng-model="$ctrl.client.postcode"]',
|
||||
city: 'vn-client-create [ng-model="$ctrl.client.city"]',
|
||||
province: `vn-autocomplete[ng-model="$ctrl.client.provinceFk"]`,
|
||||
country: `vn-autocomplete[ng-model="$ctrl.client.countryFk"]`,
|
||||
userName: 'vn-client-create [ng-model="$ctrl.client.userName"]',
|
||||
email: 'vn-client-create [ng-model="$ctrl.client.email"]',
|
||||
salesPersonAutocomplete: `vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]`,
|
||||
createButton: `button[type=submit]`,
|
||||
name: 'vn-client-create vn-textfield[ng-model="$ctrl.client.name"]',
|
||||
taxNumber: 'vn-client-create vn-textfield[ng-model="$ctrl.client.fi"]',
|
||||
socialName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.socialName"]',
|
||||
street: 'vn-client-create vn-textfield[ng-model="$ctrl.client.street"]',
|
||||
postcode: 'vn-client-create vn-textfield[ng-model="$ctrl.client.postcode"]',
|
||||
city: 'vn-client-create vn-textfield[ng-model="$ctrl.client.city"]',
|
||||
province: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
|
||||
country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||
userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
|
||||
email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
|
||||
salesPerson: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
createButton: 'vn-client-create button[type=submit]',
|
||||
cancelButton: 'vn-button[href="#!/client/index"]'
|
||||
},
|
||||
clientDescriptor: {
|
||||
|
@ -48,77 +59,78 @@ export default {
|
|||
},
|
||||
clientBasicData: {
|
||||
basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]',
|
||||
nameInput: 'vn-client-basic-data [ng-model="$ctrl.client.name"]',
|
||||
contactInput: 'vn-client-basic-data [ng-model="$ctrl.client.contact"]',
|
||||
phoneInput: 'vn-client-basic-data [ng-model="$ctrl.client.phone"]',
|
||||
mobileInput: 'vn-client-basic-data [ng-model="$ctrl.client.mobile"]',
|
||||
emailInput: 'vn-client-basic-data [ng-model="$ctrl.client.email"]',
|
||||
salesPersonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
channelAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
||||
saveButton: `button[type=submit]`
|
||||
name: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.name"]',
|
||||
contact: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.contact"]',
|
||||
email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
|
||||
phone: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.phone"]',
|
||||
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
|
||||
salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
||||
saveButton: 'vn-client-basic-data button[type=submit]'
|
||||
},
|
||||
clientFiscalData: {
|
||||
fiscalDataButton: 'vn-left-menu a[ui-sref="client.card.fiscalData"]',
|
||||
socialNameInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.socialName"]',
|
||||
fiscalIdInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.fi"]',
|
||||
equalizationTaxCheckbox: 'vn-check[ng-model="$ctrl.client.isEqualizated"]',
|
||||
socialName: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.socialName"]',
|
||||
fiscalId: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.fi"]',
|
||||
equalizationTaxCheckbox: 'vn-client-fiscal-data vn-check[ng-model="$ctrl.client.isEqualizated"]',
|
||||
acceptPropagationButton: '.vn-confirm.shown button[response=accept]',
|
||||
addressInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.street"]',
|
||||
postcodeInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.postcode"]',
|
||||
cityInput: 'vn-client-fiscal-data [ng-model="$ctrl.client.city"]',
|
||||
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
|
||||
countryAutocomplete: 'vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||
activeCheckbox: 'vn-check[label="Active"]',
|
||||
frozenCheckbox: 'vn-check[label="Frozen"]',
|
||||
invoiceByAddressCheckbox: 'vn-check[label="Invoice by address"]',
|
||||
verifiedDataCheckbox: 'vn-check[label="Verified data"]',
|
||||
hasToInvoiceCheckbox: 'vn-check[label="Has to invoice"]',
|
||||
invoiceByMailCheckbox: 'vn-check[label="Invoice by mail"]',
|
||||
viesCheckbox: 'vn-check[label="Vies"]',
|
||||
saveButton: `button[type=submit]`,
|
||||
address: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.street"]',
|
||||
postcode: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.postcode"]',
|
||||
city: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.city"]',
|
||||
province: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.provinceFk"]',
|
||||
country: 'vn-client-fiscal-data vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||
activeCheckbox: 'vn-client-fiscal-data vn-check[label="Active"]',
|
||||
frozenCheckbox: 'vn-client-fiscal-data vn-check[label="Frozen"]',
|
||||
invoiceByAddressCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by address"]',
|
||||
verifiedDataCheckbox: 'vn-client-fiscal-data vn-check[label="Verified data"]',
|
||||
hasToInvoiceCheckbox: 'vn-client-fiscal-data vn-check[label="Has to invoice"]',
|
||||
invoiceByMailCheckbox: 'vn-client-fiscal-data vn-check[label="Invoice by mail"]',
|
||||
viesCheckbox: 'vn-client-fiscal-data vn-check[label="Vies"]',
|
||||
saveButton: 'button[type=submit]',
|
||||
acceptDuplicationButton: '.vn-confirm.shown button[response=accept]',
|
||||
watcher: 'vn-client-fiscal-data vn-watcher'
|
||||
},
|
||||
clientBillingData: {
|
||||
payMethodAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
|
||||
IBANInput: 'vn-client-billing-data [ng-model="$ctrl.client.iban"]',
|
||||
dueDayInput: 'vn-client-billing-data [ng-model="$ctrl.client.dueDay"]',
|
||||
payMethod: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.payMethodFk"]',
|
||||
IBAN: 'vn-client-billing-data vn-textfield[ng-model="$ctrl.client.iban"]',
|
||||
dueDay: 'vn-client-billing-data vn-input-number[ng-model="$ctrl.client.dueDay"]',
|
||||
receivedCoreLCRCheckbox: 'vn-client-billing-data vn-check[label="Received LCR"]',
|
||||
receivedCoreVNLCheckbox: 'vn-client-billing-data vn-check[label="Received core VNL"]',
|
||||
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
|
||||
swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
||||
swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
||||
clearswiftBicButton: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"] .icons > vn-icon[icon=clear]',
|
||||
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
||||
newBankEntityName: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.name"]',
|
||||
newBankEntityBIC: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.bic"]',
|
||||
newBankEntityCode: '.vn-dialog.shown [ng-model="$ctrl.newBankEntity.id"]',
|
||||
newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.name"]',
|
||||
newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.bic"]',
|
||||
newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.id"]',
|
||||
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
|
||||
saveButton: `button[type=submit]`,
|
||||
saveButton: 'vn-client-billing-data button[type=submit]',
|
||||
watcher: 'vn-client-billing-data vn-watcher'
|
||||
},
|
||||
clientAddresses: {
|
||||
addressesButton: 'vn-left-menu a[ui-sref="client.card.address.index"]',
|
||||
createAddress: `vn-client-address-index vn-float-button`,
|
||||
defaultCheckboxInput: 'vn-check[label="Default"]',
|
||||
consigneeInput: '[ng-model="$ctrl.address.nickname"]',
|
||||
streetAddressInput: '[ng-model="$ctrl.address.street"]',
|
||||
postcodeInput: '[ng-model="$ctrl.address.postalCode"]',
|
||||
cityInput: '[ng-model="$ctrl.address.city"]',
|
||||
provinceAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]',
|
||||
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]',
|
||||
phoneInput: '[ng-model="$ctrl.address.phone"]',
|
||||
mobileInput: '[ng-model="$ctrl.address.mobile"]',
|
||||
createAddress: 'vn-client-address-index vn-float-button',
|
||||
defaultCheckbox: 'vn-check[label="Default"]',
|
||||
consignee: 'vn-textfield[ng-model="$ctrl.address.nickname"]',
|
||||
streetAddress: 'vn-textfield[ng-model="$ctrl.address.street"]',
|
||||
postcode: 'vn-textfield[ng-model="$ctrl.address.postalCode"]',
|
||||
city: 'vn-textfield[ng-model="$ctrl.address.city"]',
|
||||
province: 'vn-autocomplete[ng-model="$ctrl.address.provinceId"]',
|
||||
agency: 'vn-autocomplete[ng-model="$ctrl.address.agencyModeId"]',
|
||||
phone: 'vn-textfield[ng-model="$ctrl.address.phone"]',
|
||||
mobileInput: 'vn-textfield[ng-model="$ctrl.address.mobile"]',
|
||||
defaultAddress: 'vn-client-address-index div:nth-child(1) div[name="street"]',
|
||||
incotermsAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]',
|
||||
customsAgentAutocomplete: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]',
|
||||
incoterms: 'vn-autocomplete[ng-model="$ctrl.address.incotermsId"]',
|
||||
customsAgent: 'vn-autocomplete[ng-model="$ctrl.address.customsAgentId"]',
|
||||
secondMakeDefaultStar: 'vn-client-address-index vn-card div:nth-child(2) vn-icon-button[icon="star_border"]',
|
||||
firstEditAddress: 'vn-client-address-index div:nth-child(1) > a',
|
||||
secondEditAddress: 'vn-client-address-index div:nth-child(2) > a',
|
||||
activeCheckbox: 'vn-check[label="Enabled"]',
|
||||
equalizationTaxCheckbox: 'vn-client-address-edit vn-check[label="Is equalizated"]',
|
||||
firstObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.observationTypeFk"]',
|
||||
firstObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) [ng-model="observation.description"]',
|
||||
secondObservationTypeAutocomplete: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.observationTypeFk"]',
|
||||
secondObservationDescriptionInput: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) [ng-model="observation.description"]',
|
||||
firstObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-autocomplete[ng-model="observation.observationTypeFk"]',
|
||||
firstObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(1) vn-textfield[ng-model="observation.description"]',
|
||||
secondObservationType: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-autocomplete[ng-model="observation.observationTypeFk"]',
|
||||
secondObservationDescription: 'vn-client-address-edit [name=observations] vn-horizontal:nth-child(2) vn-textfield[ng-model="observation.description"]',
|
||||
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
|
||||
saveButton: 'button[type=submit]',
|
||||
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
|
||||
|
@ -128,26 +140,26 @@ export default {
|
|||
clientWebAccess: {
|
||||
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
|
||||
enableWebAccessCheckbox: 'vn-check[label="Enable web access"]',
|
||||
userNameInput: 'vn-client-web-access [ng-model="$ctrl.account.name"]',
|
||||
userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]',
|
||||
saveButton: 'button[type=submit]'
|
||||
},
|
||||
clientNotes: {
|
||||
addNoteFloatButton: 'vn-float-button',
|
||||
noteInput: '[ng-model="$ctrl.note.text"]',
|
||||
note: 'vn-textarea[ng-model="$ctrl.note.text"]',
|
||||
saveButton: 'button[type=submit]',
|
||||
firstNoteText: 'vn-client-note .text'
|
||||
},
|
||||
clientCredit: {
|
||||
addCreditFloatButton: 'vn-float-button',
|
||||
creditInput: 'vn-client-credit-create [ng-model="$ctrl.client.credit"]',
|
||||
saveButton: 'button[type=submit]',
|
||||
firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr'
|
||||
credit: 'vn-client-credit-create vn-input-number[ng-model="$ctrl.client.credit"]',
|
||||
firstCreditText: 'vn-client-credit-index vn-card vn-table vn-tbody > vn-tr',
|
||||
saveButton: 'button[type=submit]'
|
||||
},
|
||||
clientGreuge: {
|
||||
addGreugeFloatButton: 'vn-float-button',
|
||||
amountInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.amount"]',
|
||||
descriptionInput: 'vn-client-greuge-create [ng-model="$ctrl.greuge.description"]',
|
||||
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
|
||||
amount: 'vn-client-greuge-create vn-input-number[ng-model="$ctrl.greuge.amount"]',
|
||||
description: 'vn-client-greuge-create vn-textfield[ng-model="$ctrl.greuge.description"]',
|
||||
type: 'vn-autocomplete[ng-model="$ctrl.greuge.greugeTypeFk"]',
|
||||
saveButton: 'button[type=submit]',
|
||||
firstGreugeText: 'vn-client-greuge-index vn-card vn-table vn-tbody > vn-tr'
|
||||
},
|
||||
|
@ -166,10 +178,10 @@ export default {
|
|||
},
|
||||
clientBalance: {
|
||||
balanceButton: 'vn-left-menu a[ui-sref="client.card.balance.index"]',
|
||||
companyAutocomplete: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
|
||||
company: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]',
|
||||
newPaymentButton: `vn-float-button`,
|
||||
newPaymentBank: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.receipt.bankFk"]',
|
||||
newPaymentAmountInput: '.vn-dialog.shown [ng-model="$ctrl.receipt.amountPaid"]',
|
||||
newPaymentAmount: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.receipt.amountPaid"]',
|
||||
saveButton: '.vn-dialog.shown vn-button[label="Save"]',
|
||||
firstBalanceLine: 'vn-client-balance-index vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(8)'
|
||||
|
||||
|
@ -184,6 +196,13 @@ export default {
|
|||
firstDocWorkerDescriptor: '.vn-popover.shown vn-worker-descriptor',
|
||||
acceptDeleteButton: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
clientContacts: {
|
||||
addContactButton: 'vn-client-contact vn-icon[icon="add_circle"]',
|
||||
name: 'vn-client-contact vn-textfield[ng-model="contact.name"]',
|
||||
phone: 'vn-client-contact vn-textfield[ng-model="contact.phone"]',
|
||||
deleteFirstPhone: 'vn-client-contact vn-icon[icon="delete"]',
|
||||
saveButton: 'button[type=submit]'
|
||||
},
|
||||
itemsIndex: {
|
||||
searchIcon: 'vn-searchbar vn-icon[icon="search"]',
|
||||
createItemButton: `vn-float-button`,
|
||||
|
@ -191,7 +210,7 @@ export default {
|
|||
searchResultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]',
|
||||
searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]',
|
||||
acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]',
|
||||
searchItemInput: 'vn-searchbar',
|
||||
topbarSearch: 'vn-topbar',
|
||||
searchButton: 'vn-searchbar vn-icon[icon="search"]',
|
||||
closeItemSummaryPreview: '.vn-popup.shown',
|
||||
fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="menu"]',
|
||||
|
@ -213,10 +232,10 @@ export default {
|
|||
saveFieldsButton: '.vn-dialog.shown vn-horizontal:nth-child(16) > vn-button > button'
|
||||
},
|
||||
itemCreateView: {
|
||||
temporalName: 'vn-item-create [ng-model="$ctrl.item.provisionalName"]',
|
||||
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
|
||||
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
|
||||
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
|
||||
temporalName: 'vn-item-create vn-textfield[ng-model="$ctrl.item.provisionalName"]',
|
||||
type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
|
||||
intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
|
||||
origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
|
||||
createButton: 'button[type=submit]',
|
||||
cancelButton: 'vn-button[ui-sref="item.index"]'
|
||||
},
|
||||
|
@ -224,8 +243,8 @@ export default {
|
|||
goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]',
|
||||
moreMenu: 'vn-item-descriptor vn-icon-menu[icon=more_vert]',
|
||||
moreMenuRegularizeButton: '.vn-drop-down.shown li[name="Regularize stock"]',
|
||||
regularizeQuantityInput: '.vn-dialog.shown [ng-model="$ctrl.quantity"]',
|
||||
regularizeWarehouseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
|
||||
regularizeQuantity: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.quantity"]',
|
||||
regularizeWarehouse: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
|
||||
editButton: 'vn-item-descriptor vn-float-button[icon="edit"]',
|
||||
regularizeSaveButton: '.vn-dialog.shown tpl-buttons > button',
|
||||
inactiveIcon: 'vn-item-descriptor vn-icon[icon="icon-unavailable"]',
|
||||
|
@ -234,64 +253,68 @@ export default {
|
|||
itemBasicData: {
|
||||
basicDataButton: 'vn-left-menu a[ui-sref="item.card.basicData"]',
|
||||
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
|
||||
typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
|
||||
intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
|
||||
nameInput: 'vn-item-basic-data [ng-model="$ctrl.item.name"]',
|
||||
relevancyInput: 'vn-item-basic-data [ng-model="$ctrl.item.relevancy"]',
|
||||
originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
|
||||
expenseAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]',
|
||||
longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"]',
|
||||
type: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]',
|
||||
intrastat: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]',
|
||||
name: 'vn-item-basic-data vn-textfield[ng-model="$ctrl.item.name"]',
|
||||
relevancy: 'vn-item-basic-data vn-input-number[ng-model="$ctrl.item.relevancy"]',
|
||||
origin: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]',
|
||||
expense: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]',
|
||||
longName: 'vn-textfield[ng-model="$ctrl.item.longName"]',
|
||||
isActiveCheckbox: 'vn-check[label="Active"]',
|
||||
priceInKgCheckbox: 'vn-check[label="Price in kg"]',
|
||||
newIntrastatButton: 'vn-item-basic-data vn-icon-button[vn-tooltip="New intrastat"] > button',
|
||||
newIntrastatId: '.vn-dialog.shown vn-input-number[ng-model="$ctrl.newIntrastat.intrastatId"]',
|
||||
newIntrastatDescription: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newIntrastat.description"]',
|
||||
acceptIntrastatButton: '.vn-dialog.shown button[response="accept"]',
|
||||
submitBasicDataButton: `button[type=submit]`
|
||||
},
|
||||
itemTags: {
|
||||
goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]',
|
||||
tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]',
|
||||
fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.value"]',
|
||||
fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]',
|
||||
fourthTag: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
fourthValue: 'vn-item-tags vn-horizontal:nth-child(4) vn-textfield[ng-model="itemTag.value"]',
|
||||
fourthRelevancy: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]',
|
||||
fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]',
|
||||
fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.value"]',
|
||||
fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.priority"]',
|
||||
sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.value"]',
|
||||
sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.priority"]',
|
||||
seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.value"]',
|
||||
seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.priority"]',
|
||||
fifthTag: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
fifthValue: 'vn-item-tags vn-horizontal:nth-child(5) vn-textfield[ng-model="itemTag.value"]',
|
||||
fifthRelevancy: 'vn-item-tags vn-horizontal:nth-child(5) vn-input-number[ng-model="itemTag.priority"]',
|
||||
sixthTag: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
sixthValue: 'vn-item-tags vn-horizontal:nth-child(6) vn-textfield[ng-model="itemTag.value"]',
|
||||
sixthRelevancy: 'vn-item-tags vn-horizontal:nth-child(6) vn-input-number[ng-model="itemTag.priority"]',
|
||||
seventhTag: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]',
|
||||
seventhValue: 'vn-item-tags vn-horizontal:nth-child(7) vn-textfield[ng-model="itemTag.value"]',
|
||||
seventhRelevancy: 'vn-item-tags vn-horizontal:nth-child(7) vn-input-number[ng-model="itemTag.priority"]',
|
||||
addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]',
|
||||
submitItemTagsButton: 'vn-item-tags button[type=submit]'
|
||||
},
|
||||
itemTax: {
|
||||
undoChangesButton: 'vn-item-tax vn-button-bar > vn-button[label="Undo changes"]',
|
||||
firstClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
secondClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
thirdClassAutocomplete: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
firstClass: 'vn-item-tax vn-horizontal:nth-child(1) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
secondClass: 'vn-item-tax vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
thirdClass: 'vn-item-tax vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="tax.taxClassFk"]',
|
||||
submitTaxButton: 'vn-item-tax button[type=submit]'
|
||||
},
|
||||
itemBarcodes: {
|
||||
addBarcodeButton: 'vn-item-barcode vn-icon[icon="add_circle"]',
|
||||
thirdCodeInput: 'vn-item-barcode vn-horizontal:nth-child(3) [ng-model="barcode.code"]',
|
||||
thirdCode: 'vn-item-barcode vn-horizontal:nth-child(3) vn-textfield[ng-model="barcode.code"]',
|
||||
submitBarcodesButton: 'vn-item-barcode button[type=submit]',
|
||||
firstCodeRemoveButton: 'vn-item-barcode vn-horizontal vn-none vn-icon[icon="delete"]'
|
||||
},
|
||||
itemNiches: {
|
||||
addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]',
|
||||
firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) [ng-model="niche.code"]',
|
||||
secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) [ng-model="niche.code"]',
|
||||
firstWarehouse: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
firstCode: 'vn-item-niche vn-horizontal:nth-child(1) vn-textfield[ng-model="niche.code"]',
|
||||
secondWarehouse: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
secondCode: 'vn-item-niche vn-horizontal:nth-child(2) vn-textfield[ng-model="niche.code"]',
|
||||
secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]',
|
||||
thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) [ng-model="niche.code"]',
|
||||
thirdWarehouse: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
|
||||
thirdCode: 'vn-item-niche vn-horizontal:nth-child(3) vn-textfield[ng-model="niche.code"]',
|
||||
submitNichesButton: 'vn-item-niche button[type=submit]'
|
||||
},
|
||||
itemBotanical: {
|
||||
botanicalInput: 'vn-item-botanical vn-horizontal:nth-child(1) [ng-model="$ctrl.botanical.botanical"]',
|
||||
genusAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
|
||||
speciesAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
|
||||
botanical: 'vn-item-botanical vn-horizontal:nth-child(1) vn-textfield[ng-model="$ctrl.botanical.botanical"]',
|
||||
genus: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
|
||||
species: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
|
||||
submitBotanicalButton: `vn-item-botanical button[type=submit]`
|
||||
},
|
||||
itemSummary: {
|
||||
|
@ -306,7 +329,7 @@ export default {
|
|||
secondTicketId: 'vn-item-diary vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(2) > span',
|
||||
firstBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(1) > vn-td.balance',
|
||||
fourthBalance: 'vn-item-diary vn-tbody > vn-tr:nth-child(4) > vn-td.balance',
|
||||
warehouseAutocomplete: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
|
||||
warehouse: 'vn-item-diary vn-autocomplete[ng-model="$ctrl.warehouseFk"]',
|
||||
},
|
||||
itemLog: {
|
||||
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
|
||||
|
@ -315,7 +338,7 @@ export default {
|
|||
ticketSummary: {
|
||||
header: 'vn-ticket-summary > vn-card > h5',
|
||||
state: 'vn-ticket-summary vn-label-value[label="State"] > section > span',
|
||||
route: 'vn-ticket-summary vn-label-value[label="Route"] > section > span > a',
|
||||
route: 'vn-ticket-summary vn-label-value[label="Route"] > section > span > span',
|
||||
total: 'vn-ticket-summary vn-one.taxes > p:nth-child(3) > strong',
|
||||
sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr',
|
||||
firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span',
|
||||
|
@ -330,29 +353,27 @@ export default {
|
|||
},
|
||||
ticketsIndex: {
|
||||
openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]',
|
||||
advancedSearchInvoiceOut: 'vn-ticket-search-panel [ng-model="filter.refFk"]',
|
||||
advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"]',
|
||||
newTicketButton: 'vn-ticket-index > a',
|
||||
searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
|
||||
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
|
||||
searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)',
|
||||
searchTicketInput: 'vn-searchbar',
|
||||
searchWeeklyClearInput: 'vn-searchbar vn-icon[icon=clear]',
|
||||
topbarSearch: 'vn-searchbar',
|
||||
advancedSearchButton: 'vn-ticket-search-panel button[type=submit]',
|
||||
searchButton: 'vn-searchbar vn-icon[icon="search"]',
|
||||
searchWeeklyButton: 'vn-searchbar vn-icon[icon="search"]',
|
||||
moreMenu: 'vn-ticket-index vn-icon-menu[icon=more_vert]',
|
||||
menuWeeklyTickets: 'vn-left-menu [ui-sref="ticket.weekly.index"]',
|
||||
sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)',
|
||||
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
|
||||
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
|
||||
acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
createTicketView: {
|
||||
clientAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]',
|
||||
addressAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]',
|
||||
deliveryDateInput: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
|
||||
warehouseAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]',
|
||||
agencyAutocomplete: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
|
||||
client: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.clientId"]',
|
||||
address: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.addressId"]',
|
||||
deliveryDate: 'vn-ticket-create vn-date-picker[ng-model="$ctrl.landed"]',
|
||||
warehouse: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.warehouseId"]',
|
||||
agency: 'vn-ticket-create vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
|
||||
createButton: `button[type=submit]`
|
||||
},
|
||||
ticketDescriptor: {
|
||||
|
@ -367,7 +388,7 @@ export default {
|
|||
moreMenuMakeInvoice: '.vn-drop-down.shown li[name="Make invoice"]',
|
||||
moreMenuChangeShippedHour: '.vn-drop-down.shown li[name="Change shipped hour"]',
|
||||
changeShippedHourDialog: '.vn-dialog.shown',
|
||||
changeShippedHourInput: '.vn-dialog.shown [ng-model="$ctrl.newShipped"]',
|
||||
changeShippedHour: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newShipped"]',
|
||||
addStowawayDialogFirstTicket: '.vn-dialog.shown vn-table vn-tbody vn-tr',
|
||||
shipButton: 'vn-ticket-descriptor vn-icon[icon="icon-stowaway"]',
|
||||
thursdayButton: '.vn-popup.shown vn-tool-bar > vn-button:nth-child(4)',
|
||||
|
@ -381,8 +402,8 @@ export default {
|
|||
ticketNotes: {
|
||||
firstNoteRemoveButton: 'vn-icon[icon="delete"]',
|
||||
addNoteButton: 'vn-icon[icon="add_circle"]',
|
||||
firstNoteTypeAutocomplete: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
|
||||
firstDescriptionInput: 'vn-ticket-observation [ng-model="observation.description"]',
|
||||
firstNoteType: 'vn-autocomplete[ng-model="observation.observationTypeFk"]',
|
||||
firstDescription: 'vn-ticket-observation vn-textfield[ng-model="observation.description"]',
|
||||
submitNotesButton: 'button[type=submit]'
|
||||
},
|
||||
ticketExpedition: {
|
||||
|
@ -393,8 +414,8 @@ export default {
|
|||
},
|
||||
ticketPackages: {
|
||||
packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]',
|
||||
firstPackageAutocomplete: 'vn-autocomplete[label="Package"]',
|
||||
firstQuantityInput: 'vn-ticket-package vn-horizontal:nth-child(1) [ng-model="package.quantity"]',
|
||||
firstPackage: 'vn-autocomplete[label="Package"]',
|
||||
firstQuantity: 'vn-ticket-package vn-horizontal:nth-child(1) vn-input-number[ng-model="package.quantity"]',
|
||||
firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]',
|
||||
addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]',
|
||||
clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]',
|
||||
|
@ -461,21 +482,18 @@ export default {
|
|||
},
|
||||
ticketTracking: {
|
||||
trackingButton: 'vn-left-menu a[ui-sref="ticket.card.tracking.index"]',
|
||||
createStateButton: `vn-float-button`,
|
||||
stateAutocomplete: 'vn-ticket-tracking-edit vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
||||
saveButton: `button[type=submit]`,
|
||||
createStateButton: 'vn-float-button',
|
||||
saveButton: 'button[type=submit]',
|
||||
cancelButton: 'vn-ticket-tracking-edit vn-button[ui-sref="ticket.card.tracking.index"]'
|
||||
},
|
||||
ticketBasicData: {
|
||||
basicDataButton: 'vn-left-menu a[ui-sref="ticket.card.basicData.stepOne"]',
|
||||
clientAutocomplete: 'vn-autocomplete[ng-model="$ctrl.clientFk"]',
|
||||
addressAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.addressFk"]',
|
||||
agencyAutocomplete: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
|
||||
zoneAutocomplete: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
|
||||
agency: 'vn-autocomplete[ng-model="$ctrl.agencyModeId"]',
|
||||
zone: 'vn-autocomplete[ng-model="$ctrl.zoneId"]',
|
||||
nextStepButton: 'vn-step-control .buttons > section:last-child vn-button',
|
||||
finalizeButton: 'vn-step-control .buttons > section:last-child button[type=submit]',
|
||||
stepTwoTotalPriceDif: 'vn-ticket-basic-data-step-two vn-tfoot > vn-tr > :nth-child(6)',
|
||||
chargesReasonAutocomplete: 'vn-autocomplete[ng-model="$ctrl.ticket.option"]',
|
||||
chargesReason: 'vn-ticket-basic-data-step-two div:nth-child(3) > vn-radio',
|
||||
},
|
||||
ticketComponents: {
|
||||
base: 'vn-ticket-components [name="base-sum"]'
|
||||
|
@ -484,9 +502,9 @@ export default {
|
|||
addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button',
|
||||
request: 'vn-ticket-request-index vn-table vn-tr',
|
||||
descriptionInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.description"]',
|
||||
atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]',
|
||||
quantityInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.quantity"]',
|
||||
priceInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.price"]',
|
||||
atender: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]',
|
||||
quantity: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.quantity"]',
|
||||
price: 'vn-ticket-request-create vn-input-number[ng-model="$ctrl.ticketRequest.price"]',
|
||||
firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)',
|
||||
saveButton: 'vn-ticket-request-create button[type=submit]',
|
||||
firstDescription: 'vn-ticket-request-index vn-table vn-tr:nth-child(1) > vn-td:nth-child(2) vn-textfield',
|
||||
|
@ -501,20 +519,20 @@ export default {
|
|||
ticketService: {
|
||||
addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button',
|
||||
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
|
||||
firstServiceTypeAutocomplete: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
|
||||
firstQuantityInput: 'vn-ticket-service [ng-model="service.quantity"]',
|
||||
firstPriceInput: 'vn-ticket-service [ng-model="service.price"]',
|
||||
firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
|
||||
firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
|
||||
firstQuantity: 'vn-ticket-service vn-input-number[ng-model="service.quantity"]',
|
||||
firstPrice: 'vn-ticket-service vn-input-number[ng-model="service.price"]',
|
||||
firstVatType: 'vn-ticket-service vn-autocomplete[label="Tax class"]',
|
||||
fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]',
|
||||
newServiceTypeNameInput: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
|
||||
newServiceTypeExpenseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
|
||||
newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]',
|
||||
newServiceTypeExpense: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]',
|
||||
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
||||
saveServiceButton: `button[type=submit]`,
|
||||
saveServiceButton: 'button[type=submit]',
|
||||
saveServiceTypeButton: '.vn-dialog.shown tpl-buttons > button'
|
||||
},
|
||||
createStateView: {
|
||||
stateAutocomplete: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
||||
workerAutocomplete: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
|
||||
state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
||||
worker: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
|
||||
clearStateInputButton: 'vn-autocomplete[ng-model="$ctrl.stateFk"] .icons > vn-icon[icon=clear]',
|
||||
saveStateButton: `button[type=submit]`
|
||||
},
|
||||
|
@ -531,7 +549,7 @@ export default {
|
|||
claimSummary: {
|
||||
header: 'vn-claim-summary > vn-card > h5',
|
||||
state: 'vn-claim-summary vn-label-value[label="State"] > section > span',
|
||||
observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"] textarea',
|
||||
observation: 'vn-claim-summary vn-textarea[ng-model="$ctrl.summary.claim.observation"]',
|
||||
firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span',
|
||||
firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img',
|
||||
itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor',
|
||||
|
@ -542,14 +560,14 @@ export default {
|
|||
firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor'
|
||||
},
|
||||
claimBasicData: {
|
||||
claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
|
||||
claimState: 'vn-claim-basic-data vn-autocomplete[ng-model="$ctrl.claim.claimStateFk"]',
|
||||
responsabilityInputRange: 'vn-range',
|
||||
observationInput: 'vn-textarea[ng-model="$ctrl.claim.observation"] textarea',
|
||||
observation: 'vn-textarea[ng-model="$ctrl.claim.observation"]',
|
||||
saveButton: `button[type=submit]`
|
||||
},
|
||||
claimDetail: {
|
||||
secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span',
|
||||
discountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]',
|
||||
discount: '.vn-popover.shown vn-input-number[ng-model="$ctrl.newDiscount"]',
|
||||
discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5',
|
||||
addItemButton: 'vn-claim-detail a vn-float-button',
|
||||
firstClaimableSaleFromTicket: '.vn-dialog.shown vn-tbody > vn-tr',
|
||||
|
@ -560,16 +578,16 @@ export default {
|
|||
claimDevelopment: {
|
||||
addDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > vn-one > vn-icon-button > button > vn-icon',
|
||||
firstDeleteDevelopmentButton: 'vn-claim-development > vn-vertical > vn-card > vn-vertical > form > vn-horizontal:nth-child(2) > vn-icon-button > button > vn-icon',
|
||||
firstClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
firstClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
firstClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
firstClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
firstClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
secondClaimReasonAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
secondClaimResultAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
secondClaimResponsibleAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
secondClaimWorkerAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
secondClaimRedeliveryAutocomplete: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
saveDevelopmentButton: 'button[type=submit]'
|
||||
},
|
||||
claimAction: {
|
||||
|
@ -593,31 +611,29 @@ export default {
|
|||
acceptNavigationButton: '.vn-confirm.shown button[response=accept]'
|
||||
},
|
||||
createOrderView: {
|
||||
clientAutocomplete: 'vn-autocomplete[label="Client"]',
|
||||
addressAutocomplete: 'vn-autocomplete[label="Address"]',
|
||||
agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
|
||||
client: 'vn-autocomplete[label="Client"]',
|
||||
agency: 'vn-autocomplete[label="Agency"]',
|
||||
landedDatePicker: 'vn-date-picker[label="Landed"]',
|
||||
createButton: 'button[type=submit]',
|
||||
cancelButton: 'vn-button[href="#!/client/index"]'
|
||||
},
|
||||
orderCatalog: {
|
||||
orderByAutocomplete: 'vn-autocomplete[label="Order by"]',
|
||||
plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]',
|
||||
typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]',
|
||||
itemIdInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.itemId"]',
|
||||
itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-textfield[ng-model="$ctrl.value"]',
|
||||
openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append i',
|
||||
tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
|
||||
tagValueInput: 'vn-order-catalog-search-panel [ng-model="filter.value"]',
|
||||
type: 'vn-autocomplete[data="$ctrl.itemTypes"]',
|
||||
itemId: 'vn-order-catalog > vn-side-menu vn-textfield[vn-id="itemId"]',
|
||||
itemTagValue: 'vn-order-catalog > vn-side-menu vn-datalist[vn-id="search"]',
|
||||
openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-vertical > vn-datalist[vn-id="search"] .append i',
|
||||
tag: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]',
|
||||
tagValue: 'vn-order-catalog-search-panel vn-textfield[ng-model="filter.value"]',
|
||||
searchTagButton: 'vn-order-catalog-search-panel button[type=submit]',
|
||||
thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(3) vn-icon[icon=cancel]',
|
||||
fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu .chips > vn-chip:nth-child(4) vn-icon[icon=cancel]',
|
||||
},
|
||||
orderBasicData: {
|
||||
clientAutocomplete: 'vn-autocomplete[label="Client"]',
|
||||
addressAutocomplete: 'vn-autocomplete[label="Address"]',
|
||||
agencyAutocomplete: 'vn-autocomplete[label="Agency"]',
|
||||
observationInput: 'vn-textarea[label="Observation"] textarea',
|
||||
client: 'vn-autocomplete[label="Client"]',
|
||||
address: 'vn-autocomplete[label="Address"]',
|
||||
agency: 'vn-autocomplete[label="Agency"]',
|
||||
observation: 'vn-textarea[label="Observation"]',
|
||||
saveButton: `button[type=submit]`,
|
||||
acceptButton: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
|
@ -631,28 +647,33 @@ export default {
|
|||
addNewRouteButton: 'vn-route-index > a[ui-sref="route.create"]'
|
||||
},
|
||||
createRouteView: {
|
||||
workerAutocomplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
|
||||
vehicleAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||
agencyAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
||||
descriptionInput: 'vn-route-create [ng-model="$ctrl.route.description"]',
|
||||
vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||
agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
||||
description: 'vn-route-create [ng-model="$ctrl.route.description"]',
|
||||
submitButton: 'vn-route-create button[type=submit]'
|
||||
},
|
||||
routeDescriptor: {
|
||||
volume: 'vn-route-descriptor vn-label-value[label="Volume"] > section > span'
|
||||
},
|
||||
routeSummary: {
|
||||
routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span'
|
||||
header: 'vn-route-summary > vn-card > h5',
|
||||
routeId: 'vn-route-summary > vn-card > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span',
|
||||
cost: 'vn-route-summary vn-label-value[label="Cost"]',
|
||||
firstTicketID: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span',
|
||||
firstTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor',
|
||||
firstAlias: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(3) > span',
|
||||
firstClientDescriptor: '.vn-popover.shown vn-client-descriptor',
|
||||
},
|
||||
routeBasicData: {
|
||||
workerAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||
agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
||||
kmStartInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmStart"]',
|
||||
kmEndInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmEnd"]',
|
||||
createdDateInput: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
|
||||
startedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.started"]',
|
||||
finishedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.finished"]',
|
||||
worker: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
vehicle: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||
kmStart: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmStart"]',
|
||||
kmEnd: 'vn-route-basic-data vn-input-number[ng-model="$ctrl.route.kmEnd"]',
|
||||
createdDate: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]',
|
||||
startedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.started"]',
|
||||
finishedHour: 'vn-route-basic-data vn-input-time[ng-model="$ctrl.route.finished"]',
|
||||
saveButton: 'vn-route-basic-data button[type=submit]'
|
||||
},
|
||||
routeTickets: {
|
||||
|
@ -666,12 +687,18 @@ export default {
|
|||
firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]',
|
||||
confirmButton: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
workerBasicData: {
|
||||
name: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.firstName"]',
|
||||
surname: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.lastName"]',
|
||||
phone: 'vn-worker-basic-data vn-textfield[ng-model="$ctrl.worker.phone"]',
|
||||
saveButton: 'vn-worker-basic-data button[type=submit]'
|
||||
},
|
||||
workerPbx: {
|
||||
extensionInput: 'vn-worker-pbx [ng-model="$ctrl.worker.sip.extension"]',
|
||||
extension: 'vn-worker-pbx vn-textfield[ng-model="$ctrl.worker.sip.extension"]',
|
||||
saveButton: 'vn-worker-pbx button[type=submit]'
|
||||
},
|
||||
workerTimeControl: {
|
||||
timeDialogInput: '.vn-dialog.shown [ng-model="$ctrl.newTime"]',
|
||||
timeDialog: '.vn-dialog.shown vn-input-time[ng-model="$ctrl.newTime"]',
|
||||
mondayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button',
|
||||
tuesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(2) > vn-icon-button',
|
||||
wednesdayAddTimeButton: 'vn-worker-time-control vn-table > div > vn-tfoot > vn-tr:nth-child(2) > vn-td:nth-child(3) > vn-icon-button',
|
||||
|
@ -723,7 +750,7 @@ export default {
|
|||
acceptDeleteDialog: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
invoiceOutIndex: {
|
||||
searchInvoiceOutInput: 'vn-searchbar',
|
||||
topbarSearch: 'vn-searchbar',
|
||||
searchButton: 'vn-searchbar vn-icon[icon="search"]',
|
||||
searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr',
|
||||
},
|
||||
|
@ -736,6 +763,30 @@ export default {
|
|||
acceptBookingButton: '.vn-confirm.shown button[response="accept"]'
|
||||
},
|
||||
invoiceOutSummary: {
|
||||
bookedLabel: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-one > vn-label-value:nth-child(4) > section > span'
|
||||
bookedLabel: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-one > vn-label-value:nth-child(4) > section > span',
|
||||
company: 'vn-invoice-out-summary vn-label-value[label="Company"]',
|
||||
taxOne: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-two > vn-table > div > vn-tbody > vn-tr:nth-child(1)',
|
||||
taxTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-two > vn-table > div > vn-tbody > vn-tr:nth-child(2)',
|
||||
ticketOne: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(1)',
|
||||
ticketTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(2)'
|
||||
},
|
||||
travelThermograph: {
|
||||
add: 'vn-travel-thermograph-index vn-float-button[icon="add"]',
|
||||
thermographID: 'vn-travel-thermograph-create vn-autocomplete[ng-model="$ctrl.dms.thermographId"]',
|
||||
uploadIcon: 'vn-travel-thermograph-create vn-icon[icon="cloud_upload"]',
|
||||
createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr',
|
||||
upload: 'vn-travel-thermograph-create button[type=submit]'
|
||||
},
|
||||
agencyBasicData: {
|
||||
name: 'vn-zone-basic-data vn-textfield[ng-model="$ctrl.zone.name"]',
|
||||
agency: 'vn-zone-basic-data vn-autocomplete[ng-model="$ctrl.zone.agencyModeFk"]',
|
||||
maxVolume: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.m3Max"]',
|
||||
travelingDays: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.travelingDays"]',
|
||||
closing: 'vn-zone-basic-data vn-input-time[ng-model="$ctrl.zone.hour"]',
|
||||
price: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.price"]',
|
||||
bonus: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.bonus"]',
|
||||
inflation: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.inflation"]',
|
||||
volumetric: 'vn-zone-basic-data vn-check[ng-model="$ctrl.zone.isVolumetric"]',
|
||||
saveButton: 'vn-zone-basic-data vn-submit > button',
|
||||
}
|
||||
};
|
||||
|
|
|
@ -36,8 +36,8 @@ describe('Login path', async() => {
|
|||
it('should log in', async() => {
|
||||
await page.doLogin('employee', 'nightmare');
|
||||
await page.waitForNavigation();
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/');
|
||||
|
||||
expect(url.hash).toEqual('#!/');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ describe('Client create path', async() => {
|
|||
});
|
||||
|
||||
it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => {
|
||||
await page.write(selectors.clientsIndex.searchClientInput, 'Carol Danvers');
|
||||
await page.write(selectors.clientsIndex.topbarSearch, 'Carol Danvers');
|
||||
await page.waitToClick(selectors.clientsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 0);
|
||||
const result = await page.countElement(selectors.clientsIndex.searchResult);
|
||||
|
@ -26,9 +26,9 @@ describe('Client create path', async() => {
|
|||
it('should now access to the create client view by clicking the create-client floating button', async() => {
|
||||
await page.waitToClick(selectors.clientsIndex.createClientButton);
|
||||
await page.wait(selectors.createClientView.createButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/client/create');
|
||||
|
||||
expect(url.hash).toEqual('#!/client/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should receive an error when clicking the create button having all the form fields empty', async() => {
|
||||
|
@ -42,7 +42,7 @@ describe('Client create path', async() => {
|
|||
await page.write(selectors.createClientView.taxNumber, '74451390E');
|
||||
await page.write(selectors.createClientView.userName, 'CaptainMarvel');
|
||||
await page.write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es');
|
||||
await page.autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'replenisher');
|
||||
await page.autocompleteSearch(selectors.createClientView.salesPerson, 'replenisher');
|
||||
await page.waitToClick(selectors.createClientView.createButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -53,7 +53,6 @@ describe('Client create path', async() => {
|
|||
await page.write(selectors.createClientView.name, 'Carol Danvers');
|
||||
await page.write(selectors.createClientView.socialName, 'AVG tax');
|
||||
await page.write(selectors.createClientView.street, 'Many places');
|
||||
await page.waitForContentLoaded();
|
||||
await page.autocompleteSearch(selectors.createClientView.country, 'España');
|
||||
await page.autocompleteSearch(selectors.createClientView.province, 'Province one');
|
||||
await page.write(selectors.createClientView.city, 'Valencia');
|
||||
|
@ -79,13 +78,13 @@ describe('Client create path', async() => {
|
|||
|
||||
it(`should check for autocompleted city, province and country`, async() => {
|
||||
const clientCity = await page
|
||||
.waitToGetProperty(`${selectors.createClientView.city} input`, 'value');
|
||||
.waitToGetProperty(selectors.createClientView.city, 'value');
|
||||
|
||||
const clientProvince = await page
|
||||
.waitToGetProperty(`${selectors.createClientView.province} input`, 'value');
|
||||
.waitToGetProperty(selectors.createClientView.province, 'value');
|
||||
|
||||
const clientCountry = await page
|
||||
.waitToGetProperty(`${selectors.createClientView.country} input`, 'value');
|
||||
.waitToGetProperty(selectors.createClientView.country, 'value');
|
||||
|
||||
expect(clientCity).toEqual('Valencia');
|
||||
expect(clientProvince).toEqual('Province one');
|
||||
|
@ -107,17 +106,15 @@ describe('Client create path', async() => {
|
|||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||
await page.wait(selectors.clientsIndex.createClientButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/client/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should search for the user Carol Danvers to confirm it exists`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.accessToSearchResult('Carol Danvers');
|
||||
await page.waitForURL('#!/client/114/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/client/114/summary');
|
||||
|
||||
expect(url.hash).toEqual('#!/client/114/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
});
|
|
@ -18,22 +18,22 @@ describe('Client Edit basicData path', () => {
|
|||
|
||||
describe('as employee', () => {
|
||||
it('should not be able to change the salesPerson', async() => {
|
||||
await page.wait(selectors.clientBasicData.nameInput);
|
||||
await page.wait(selectors.clientBasicData.name);
|
||||
const result = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.clientBasicData.salesPersonAutocomplete} input`);
|
||||
}, `${selectors.clientBasicData.salesPerson} input`);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should edit the client basic data but leave salesPerson untainted', async() => {
|
||||
await page.clearInput(selectors.clientBasicData.nameInput);
|
||||
await page.write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace');
|
||||
await page.clearInput(selectors.clientBasicData.contactInput);
|
||||
await page.write(selectors.clientBasicData.contactInput, 'David Haller');
|
||||
await page.clearInput(selectors.clientBasicData.emailInput);
|
||||
await page.write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets');
|
||||
await page.clearInput(selectors.clientBasicData.name);
|
||||
await page.write(selectors.clientBasicData.name, 'Ptonomy Wallace');
|
||||
await page.clearInput(selectors.clientBasicData.contact);
|
||||
await page.write(selectors.clientBasicData.contact, 'David Haller');
|
||||
await page.clearInput(selectors.clientBasicData.email);
|
||||
await page.write(selectors.clientBasicData.email, 'PWallace@verdnatura.es');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.channel, 'Rumors on the streets');
|
||||
await page.waitToClick(selectors.clientBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -42,58 +42,62 @@ describe('Client Edit basicData path', () => {
|
|||
|
||||
it('should confirm the name have been edited', async() => {
|
||||
await page.reloadSection('client.card.basicData');
|
||||
const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Ptonomy Wallace');
|
||||
});
|
||||
|
||||
it('should confirm the contact name have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.contact, 'value');
|
||||
|
||||
expect(result).toEqual('David Haller');
|
||||
});
|
||||
|
||||
it('should confirm the email have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.email, 'value');
|
||||
|
||||
expect(result).toEqual('PWallace@verdnatura.es');
|
||||
});
|
||||
|
||||
it('should confirm the channel have been selected', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.channel, 'value');
|
||||
|
||||
expect(result).toEqual('Rumors on the streets');
|
||||
});
|
||||
});
|
||||
|
||||
describe('as salesAssistant', () => {
|
||||
beforeAll(async() => {
|
||||
it('should navigate to a client basic data', async() => {
|
||||
await page.loginAndModule('salesASsistant', 'client');
|
||||
await page.accessToSearchResult('Ptonomy Wallace');
|
||||
await page.accessToSection('client.card.basicData');
|
||||
});
|
||||
|
||||
it('should be able to change the salesPerson', async() => {
|
||||
await page.wait(selectors.clientBasicData.nameInput);
|
||||
await page.waitForSelector(selectors.clientBasicData.name);
|
||||
const result = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.clientBasicData.salesPersonAutocomplete} input`);
|
||||
}, `${selectors.clientBasicData.salesPerson} input`);
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should edit the client basic data including salesPerson', async() => {
|
||||
await page.clearInput(selectors.clientBasicData.nameInput);
|
||||
await page.write(selectors.clientBasicData.nameInput, 'Ororo Munroe');
|
||||
await page.clearInput(selectors.clientBasicData.contactInput);
|
||||
await page.write(selectors.clientBasicData.contactInput, 'Black Panther');
|
||||
await page.clearInput(selectors.clientBasicData.emailInput);
|
||||
await page.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'replenisherNick');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper');
|
||||
await page.clearInput(selectors.clientBasicData.name);
|
||||
await page.write(selectors.clientBasicData.name, 'Ororo Munroe');
|
||||
await page.clearInput(selectors.clientBasicData.contact);
|
||||
await page.write(selectors.clientBasicData.contact, 'Black Panther');
|
||||
await page.clearInput(selectors.clientBasicData.email);
|
||||
await page.write(selectors.clientBasicData.email, 'Storm@verdnatura.es');
|
||||
await page.clearInput(selectors.clientBasicData.phone);
|
||||
await page.write(selectors.clientBasicData.phone, '333333333');
|
||||
await page.clearInput(selectors.clientBasicData.mobile);
|
||||
await page.write(selectors.clientBasicData.mobile, '444444444');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.salesPerson, 'replenisherNick');
|
||||
await page.autocompleteSearch(selectors.clientBasicData.channel, 'Metropolis newspaper');
|
||||
await page.waitToClick(selectors.clientBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -102,35 +106,49 @@ describe('Client Edit basicData path', () => {
|
|||
|
||||
it('should now confirm the name have been edited', async() => {
|
||||
await page.reloadSection('client.card.basicData');
|
||||
const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Ororo Munroe');
|
||||
});
|
||||
|
||||
it('should now confirm the contact name have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.contact, 'value');
|
||||
|
||||
expect(result).toEqual('Black Panther');
|
||||
});
|
||||
|
||||
it('should now confirm the email have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.email, 'value');
|
||||
|
||||
expect(result).toEqual('Storm@verdnatura.es');
|
||||
});
|
||||
|
||||
it('should now confirm the phone have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.clientBasicData.phone, 'value');
|
||||
|
||||
expect(result).toEqual('333333333');
|
||||
});
|
||||
|
||||
it('should now confirm the mobile have been edited', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.clientBasicData.mobile, 'value');
|
||||
|
||||
expect(result).toEqual('444444444');
|
||||
});
|
||||
|
||||
it('should confirm the sales person have been selected', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.salesPerson, 'value');
|
||||
|
||||
expect(result).toEqual('replenisherNick');
|
||||
});
|
||||
|
||||
it('should now confirm the channel have been selected', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBasicData.channel, 'value');
|
||||
|
||||
expect(result).toEqual('Metropolis newspaper');
|
||||
});
|
|
@ -36,10 +36,9 @@ describe('Client Edit fiscalData path', () => {
|
|||
|
||||
it(`should click on the fiscal data button`, async() => {
|
||||
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
|
||||
await page.waitForURL('fiscal-data');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('fiscal-data');
|
||||
|
||||
expect(url.hash).toContain('fiscal-data');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should not be able to edit the verified data checkbox', async() => {
|
||||
|
@ -58,19 +57,19 @@ describe('Client Edit fiscalData path', () => {
|
|||
});
|
||||
|
||||
it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialNameInput);
|
||||
await page.clearInput(selectors.clientFiscalData.socialNameInput);
|
||||
await page.write(selectors.clientFiscalData.socialNameInput, 'SMASH');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
|
||||
await page.write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!');
|
||||
await page.clearInput(selectors.clientFiscalData.addressInput);
|
||||
await page.write(selectors.clientFiscalData.addressInput, 'Somewhere edited');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'España');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province one');
|
||||
await page.clearInput(selectors.clientFiscalData.cityInput);
|
||||
await page.write(selectors.clientFiscalData.cityInput, 'Valencia');
|
||||
await page.clearInput(selectors.clientFiscalData.postcodeInput);
|
||||
await page.write(selectors.clientFiscalData.postcodeInput, '46000');
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'SMASH');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalId);
|
||||
await page.write(selectors.clientFiscalData.fiscalId, 'INVALID!');
|
||||
await page.clearInput(selectors.clientFiscalData.address);
|
||||
await page.write(selectors.clientFiscalData.address, 'Somewhere edited');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.country, 'España');
|
||||
await page.autocompleteSearch(selectors.clientFiscalData.province, 'Province one');
|
||||
await page.clearInput(selectors.clientFiscalData.city);
|
||||
await page.write(selectors.clientFiscalData.city, 'Valencia');
|
||||
await page.clearInput(selectors.clientFiscalData.postcode);
|
||||
await page.write(selectors.clientFiscalData.postcode, '46000');
|
||||
await page.waitToClick(selectors.clientFiscalData.activeCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.frozenCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox);
|
||||
|
@ -80,15 +79,17 @@ describe('Client Edit fiscalData path', () => {
|
|||
await page.waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Invalid Tax number');
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
it(`should edit the fiscal this time with a valid fiscal id`, async() => {
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
|
||||
await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalId);
|
||||
await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
|
@ -103,8 +104,8 @@ describe('Client Edit fiscalData path', () => {
|
|||
|
||||
it('should receive an error if the fiscal id contains A or B at the beginning', async() => {
|
||||
await page.waitToClick(selectors.clientFiscalData.viesCheckbox);
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
|
||||
await page.write(selectors.clientFiscalData.fiscalIdInput, 'A94980061C');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalId);
|
||||
await page.write(selectors.clientFiscalData.fiscalId, 'A94980061C');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -112,8 +113,8 @@ describe('Client Edit fiscalData path', () => {
|
|||
});
|
||||
|
||||
it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => {
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalIdInput);
|
||||
await page.write(selectors.clientFiscalData.fiscalIdInput, '94980061C');
|
||||
await page.clearInput(selectors.clientFiscalData.fiscalId);
|
||||
await page.write(selectors.clientFiscalData.fiscalId, '94980061C');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -123,10 +124,9 @@ describe('Client Edit fiscalData path', () => {
|
|||
// confirm all addresses have now EQtax checked step 1
|
||||
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
||||
await page.waitForURL('/address/index');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/address/index');
|
||||
|
||||
expect(url.hash).toContain('/address/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
// confirm all addresses have now EQtax checked step 2
|
||||
|
@ -151,6 +151,7 @@ describe('Client Edit fiscalData path', () => {
|
|||
it('should navigate back to fiscal data and uncheck EQtax then check VIES', async() => {
|
||||
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
|
||||
await page.waitToClick(selectors.clientFiscalData.viesCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.invoiceByAddressCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
@ -167,44 +168,44 @@ describe('Client Edit fiscalData path', () => {
|
|||
|
||||
it('should confirm its name have been edited', async() => {
|
||||
await page.waitToClick(selectors.clientFiscalData.fiscalDataButton);
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
|
||||
|
||||
expect(result).toEqual('SMASH');
|
||||
});
|
||||
|
||||
it('should confirm the fiscal id have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.fiscalIdInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.fiscalId, 'value');
|
||||
|
||||
expect(result).toEqual('94980061C');
|
||||
});
|
||||
|
||||
it('should confirm the address have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.addressInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.address, 'value');
|
||||
|
||||
expect(result).toEqual('Somewhere edited');
|
||||
});
|
||||
|
||||
it('should confirm the postcode have been edited', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.postcodeInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.postcode, 'value');
|
||||
|
||||
expect(result).toContain('46000');
|
||||
});
|
||||
|
||||
it('should confirm the city have been autocompleted', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.cityInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.city, 'value');
|
||||
|
||||
expect(result).toEqual('Valencia');
|
||||
});
|
||||
|
||||
|
||||
it(`should confirm the province have been autocompleted`, async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.province, 'value');
|
||||
|
||||
expect(result).toEqual('Province one');
|
||||
});
|
||||
|
||||
it('should confirm the country have been autocompleted', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.country, 'value');
|
||||
|
||||
expect(result).toEqual('España');
|
||||
});
|
||||
|
@ -239,10 +240,10 @@ describe('Client Edit fiscalData path', () => {
|
|||
expect(result).toBe('unchecked');
|
||||
});
|
||||
|
||||
it('should confirm invoice by address checkbox is unchecked', async() => {
|
||||
it('should confirm invoice by address checkbox is checked', async() => {
|
||||
const result = await page.checkboxState(selectors.clientFiscalData.invoiceByAddressCheckbox);
|
||||
|
||||
expect(result).toBe('unchecked');
|
||||
expect(result).toBe('checked');
|
||||
});
|
||||
|
||||
it('should confirm Equalization tax checkbox is unchecked', async() => {
|
||||
|
@ -260,16 +261,15 @@ describe('Client Edit fiscalData path', () => {
|
|||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1
|
||||
it(`should click on the addresses button to access to the client's addresses`, async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.addressesButton);
|
||||
await page.waitForURL('/address/index');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/address/index');
|
||||
|
||||
expect(url.hash).toContain('/address/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
// confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2
|
||||
it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
||||
await page.waitForTextInInput(selectors.clientAddresses.cityInput, 'Silla');
|
||||
await page.waitForTextInField(selectors.clientAddresses.city, 'Silla');
|
||||
await page.waitToClick(selectors.clientAddresses.equalizationTaxCheckbox);
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
|
@ -17,11 +17,11 @@ describe('Client Edit billing data path', () => {
|
|||
});
|
||||
|
||||
it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
|
||||
await page.autocompleteSearch(selectors.clientBillingData.payMethodAutocomplete, 'PayMethod with IBAN');
|
||||
await page.autocompleteSearch(selectors.clientBillingData.swiftBicAutocomplete, 'BBKKESMMMMM');
|
||||
await page.clearInput(selectors.clientBillingData.dueDayInput);
|
||||
await page.write(selectors.clientBillingData.dueDayInput, '60');
|
||||
await page.waitForTextInInput(selectors.clientBillingData.dueDayInput, '60');
|
||||
await page.autocompleteSearch(selectors.clientBillingData.payMethod, 'PayMethod with IBAN');
|
||||
await page.autocompleteSearch(selectors.clientBillingData.swiftBic, 'BBKKESMMMMM');
|
||||
await page.clearInput(selectors.clientBillingData.dueDay);
|
||||
await page.write(selectors.clientBillingData.dueDay, '60');
|
||||
await page.waitForTextInField(selectors.clientBillingData.dueDay, '60');
|
||||
await page.waitToClick(selectors.clientBillingData.receivedCoreLCRCheckbox);
|
||||
await page.waitToClick(selectors.clientBillingData.receivedCoreVNLCheckbox);
|
||||
await page.waitToClick(selectors.clientBillingData.receivedB2BVNLCheckbox);
|
||||
|
@ -37,30 +37,30 @@ describe('Client Edit billing data path', () => {
|
|||
await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
|
||||
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
|
||||
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
|
||||
await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'Gotham City Bank');
|
||||
let newcode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
|
||||
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
|
||||
let newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
|
||||
expect(newcode).toEqual('GTHMCT Gotham City Bank');
|
||||
});
|
||||
|
||||
it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
|
||||
let payMethod = await page.waitToGetProperty(`${selectors.clientBillingData.payMethodAutocomplete} input`, 'value');
|
||||
let payMethod = await page.waitToGetProperty(selectors.clientBillingData.payMethod, 'value');
|
||||
|
||||
expect(payMethod).toEqual('PayMethod with IBAN');
|
||||
});
|
||||
|
||||
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
|
||||
await page.write(selectors.clientBillingData.IBANInput, 'ES9121000418450200051332');
|
||||
await page.write(selectors.clientBillingData.IBAN, 'ES9121000418450200051332');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.keyboard.press('Tab');
|
||||
await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'caixesbb');
|
||||
let automaticCode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
|
||||
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'caixesbb');
|
||||
let automaticCode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
|
||||
expect(automaticCode).toEqual('CAIXESBB Caixa Bank');
|
||||
});
|
||||
|
||||
it(`should save the form with all its new data`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitFor(3000);
|
||||
await page.waitForWatcherData(selectors.clientBillingData.watcher);
|
||||
await page.waitToClick(selectors.clientBillingData.saveButton);
|
||||
let snackbarMessage = await page.waitForLastSnackbar();
|
||||
|
@ -69,19 +69,19 @@ describe('Client Edit billing data path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the due day have been edited', async() => {
|
||||
let dueDate = await page.waitToGetProperty(`${selectors.clientBillingData.dueDayInput} input`, 'value');
|
||||
let dueDate = await page.waitToGetProperty(selectors.clientBillingData.dueDay, 'value');
|
||||
|
||||
expect(dueDate).toEqual('60');
|
||||
});
|
||||
|
||||
it('should confirm the IBAN was saved', async() => {
|
||||
let IBAN = await page.waitToGetProperty(`${selectors.clientBillingData.IBANInput} input`, 'value');
|
||||
let IBAN = await page.waitToGetProperty(selectors.clientBillingData.IBAN, 'value');
|
||||
|
||||
expect(IBAN).toEqual('ES9121000418450200051332');
|
||||
});
|
||||
|
||||
it('should confirm the swift / BIC code was saved', async() => {
|
||||
let code = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value');
|
||||
let code = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||
|
||||
expect(code).toEqual('CAIXESBB Caixa Bank');
|
||||
});
|
|
@ -18,19 +18,18 @@ describe('Client Add address path', () => {
|
|||
|
||||
it(`should click on the add new address button to access to the new address form`, async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.createAddress);
|
||||
await page.waitForURL('address/create');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('address/create');
|
||||
|
||||
expect(url.hash).toContain('address/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.defaultCheckboxInput);
|
||||
await page.autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province five');
|
||||
await page.write(selectors.clientAddresses.cityInput, 'Valencia');
|
||||
await page.write(selectors.clientAddresses.postcodeInput, '46000');
|
||||
await page.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement');
|
||||
await page.write(selectors.clientAddresses.phoneInput, '999887744');
|
||||
await page.waitToClick(selectors.clientAddresses.defaultCheckbox);
|
||||
await page.autocompleteSearch(selectors.clientAddresses.province, 'Province five');
|
||||
await page.write(selectors.clientAddresses.city, 'Valencia');
|
||||
await page.write(selectors.clientAddresses.postcode, '46000');
|
||||
await page.autocompleteSearch(selectors.clientAddresses.agency, 'Entanglement');
|
||||
await page.write(selectors.clientAddresses.phone, '999887744');
|
||||
await page.write(selectors.clientAddresses.mobileInput, '999887744');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
@ -40,8 +39,8 @@ describe('Client Add address path', () => {
|
|||
|
||||
|
||||
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
|
||||
await page.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner');
|
||||
await page.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York');
|
||||
await page.write(selectors.clientAddresses.consignee, 'Bruce Bunner');
|
||||
await page.write(selectors.clientAddresses.streetAddress, '320 Park Avenue New York');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -49,7 +48,7 @@ describe('Client Add address path', () => {
|
|||
});
|
||||
|
||||
it(`should receive an error after clicking save button as consignee, incoterms and customsAgent are empty`, async() => {
|
||||
await page.autocompleteSearch(selectors.clientAddresses.incotermsAutocomplete, 'Free Alongside Ship');
|
||||
await page.autocompleteSearch(selectors.clientAddresses.incoterms, 'Free Alongside Ship');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -57,7 +56,7 @@ describe('Client Add address path', () => {
|
|||
});
|
||||
|
||||
it(`should create a new address with all it's data`, async() => {
|
||||
await page.autocompleteSearch(selectors.clientAddresses.customsAgentAutocomplete, 'Agent one');
|
||||
await page.autocompleteSearch(selectors.clientAddresses.customsAgent, 'Agent one');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -87,10 +86,9 @@ describe('Client Add address path', () => {
|
|||
it(`should click on the edit icon of the default address`, async() => {
|
||||
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand');
|
||||
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
||||
await page.waitForURL('/edit');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/edit');
|
||||
|
||||
expect(url.hash).toContain('/edit');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => {
|
||||
|
@ -105,9 +103,8 @@ describe('Client Add address path', () => {
|
|||
it(`should go back to the addreses section by clicking the cancel button`, async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.cancelEditAddressButton);
|
||||
await page.waitToClick('.vn-confirm.shown button[response="accept"]');
|
||||
await page.waitForURL('address/index');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('address/index');
|
||||
|
||||
expect(url.hash).toContain('address/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
});
|
|
@ -19,15 +19,14 @@ describe('Client add address notes path', () => {
|
|||
it(`should click on the edit icon of the default address`, async() => {
|
||||
await page.waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street');
|
||||
await page.waitToClick(selectors.clientAddresses.firstEditAddress);
|
||||
await page.waitForURL('/edit');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/edit');
|
||||
|
||||
expect(url.hash).toContain('/edit');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should not save a description without observation type', async() => {
|
||||
await page.waitToClick(selectors.clientAddresses.addObservationButton);
|
||||
await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description');
|
||||
await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -35,8 +34,8 @@ describe('Client add address notes path', () => {
|
|||
});
|
||||
|
||||
it('should not save an observation type without description', async() => {
|
||||
await page.clearInput(selectors.clientAddresses.firstObservationDescriptionInput);
|
||||
await page.autocompleteSearch(selectors.clientAddresses.firstObservationTypeAutocomplete, 'comercial');
|
||||
await page.clearInput(selectors.clientAddresses.firstObservationDescription);
|
||||
await page.autocompleteSearch(selectors.clientAddresses.firstObservationType, 'comercial');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -44,10 +43,10 @@ describe('Client add address notes path', () => {
|
|||
});
|
||||
|
||||
it('should create two new observations', async() => {
|
||||
await page.write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description');
|
||||
await page.write(selectors.clientAddresses.firstObservationDescription, 'first description');
|
||||
await page.waitToClick(selectors.clientAddresses.addObservationButton);
|
||||
await page.autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one');
|
||||
await page.write(selectors.clientAddresses.secondObservationDescriptionInput, 'second description');
|
||||
await page.autocompleteSearch(selectors.clientAddresses.secondObservationType, 'observation one');
|
||||
await page.write(selectors.clientAddresses.secondObservationDescription, 'second description');
|
||||
await page.waitToClick(selectors.clientAddresses.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
|
@ -18,8 +18,8 @@ describe('Client Edit web access path', () => {
|
|||
|
||||
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
|
||||
await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox);
|
||||
await page.clearInput(selectors.clientWebAccess.userNameInput);
|
||||
await page.write(selectors.clientWebAccess.userNameInput, 'Hulk');
|
||||
await page.clearInput(selectors.clientWebAccess.userName);
|
||||
await page.write(selectors.clientWebAccess.userName, 'Hulk');
|
||||
await page.waitToClick(selectors.clientWebAccess.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -28,7 +28,7 @@ describe('Client Edit web access path', () => {
|
|||
|
||||
it('should confirm web access is now unchecked', async() => {
|
||||
await page.waitToClick(selectors.clientBasicData.basicDataButton);
|
||||
await page.wait(selectors.clientBasicData.nameInput);
|
||||
await page.wait(selectors.clientBasicData.name);
|
||||
await page.waitToClick(selectors.clientsIndex.othersButton);
|
||||
await page.waitToClick(selectors.clientWebAccess.webAccessButton);
|
||||
const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox);
|
||||
|
@ -37,7 +37,7 @@ describe('Client Edit web access path', () => {
|
|||
});
|
||||
|
||||
it('should confirm web access name have been updated', async() => {
|
||||
const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientWebAccess.userName, 'value');
|
||||
|
||||
expect(result).toEqual('Hulk');
|
||||
});
|
|
@ -18,15 +18,14 @@ describe('Client Add notes path', () => {
|
|||
|
||||
it(`should click on the add note button`, async() => {
|
||||
await page.waitToClick(selectors.clientNotes.addNoteFloatButton);
|
||||
await page.waitForURL('/note/create');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/note/create');
|
||||
|
||||
expect(url.hash).toContain('/note/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should create a note`, async() => {
|
||||
await page.waitFor(selectors.clientNotes.noteInput);
|
||||
await page.type(`${selectors.clientNotes.noteInput} textarea`, 'Meeting with Black Widow 21st 9am');
|
||||
await page.waitFor(selectors.clientNotes.note);
|
||||
await page.type(`${selectors.clientNotes.note} textarea`, 'Meeting with Black Widow 21st 9am');
|
||||
await page.waitToClick(selectors.clientNotes.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
|
@ -18,16 +18,14 @@ describe('Client Add credit path', () => {
|
|||
|
||||
it(`should click on the add credit button`, async() => {
|
||||
await page.waitToClick(selectors.clientCredit.addCreditFloatButton);
|
||||
await page.waitForURL('/credit/create');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/credit/create');
|
||||
|
||||
expect(url.hash).toContain('/credit/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should edit the credit`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.clearInput(selectors.clientCredit.creditInput);
|
||||
await page.write(selectors.clientCredit.creditInput, '999');
|
||||
await page.clearInput(selectors.clientCredit.credit);
|
||||
await page.write(selectors.clientCredit.credit, '999');
|
||||
await page.waitToClick(selectors.clientCredit.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -35,7 +33,6 @@ describe('Client Add credit path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the credit was updated', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
const result = await page.waitToGetProperty(selectors.clientCredit.firstCreditText, 'innerText');
|
||||
|
||||
expect(result).toContain(999);
|
|
@ -18,14 +18,13 @@ describe('Client Add greuge path', () => {
|
|||
|
||||
it(`should click on the add greuge button`, async() => {
|
||||
await page.waitToClick(selectors.clientGreuge.addGreugeFloatButton);
|
||||
await page.waitForURL('greuge/create');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('greuge/create');
|
||||
|
||||
expect(url.hash).toContain('greuge/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should receive an error if all fields are empty but date and type on submit`, async() => {
|
||||
await page.autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff');
|
||||
await page.autocompleteSearch(selectors.clientGreuge.type, 'Diff');
|
||||
await page.waitToClick(selectors.clientGreuge.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -33,9 +32,9 @@ describe('Client Add greuge path', () => {
|
|||
});
|
||||
|
||||
it(`should create a new greuge with all its data`, async() => {
|
||||
await page.write(selectors.clientGreuge.amountInput, '999');
|
||||
await page.waitForTextInInput(selectors.clientGreuge.amountInput, '999');
|
||||
await page.write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!');
|
||||
await page.write(selectors.clientGreuge.amount, '999');
|
||||
await page.waitForTextInField(selectors.clientGreuge.amount, '999');
|
||||
await page.write(selectors.clientGreuge.description, 'new armor for Batman!');
|
||||
await page.waitToClick(selectors.clientGreuge.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
|
@ -26,9 +26,9 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should edit the social name', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialNameInput);
|
||||
await page.clearInput(selectors.clientFiscalData.socialNameInput);
|
||||
await page.write(selectors.clientFiscalData.socialNameInput, 'Captain America Civil War');
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'Captain America Civil War');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -37,7 +37,7 @@ describe('Client lock verified data path', () => {
|
|||
|
||||
it('should confirm the social name have been edited', async() => {
|
||||
await page.reloadSection('client.card.fiscalData');
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
|
||||
|
||||
expect(result).toEqual('Captain America Civil War');
|
||||
});
|
||||
|
@ -59,6 +59,7 @@ describe('Client lock verified data path', () => {
|
|||
it('should check the Verified data checkbox', async() => {
|
||||
await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
|
@ -72,9 +73,9 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should again edit the social name', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialNameInput);
|
||||
await page.clearInput(selectors.clientFiscalData.socialNameInput);
|
||||
await page.write(selectors.clientFiscalData.socialNameInput, 'Ant man and the Wasp');
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'Ant man and the Wasp');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -83,7 +84,7 @@ describe('Client lock verified data path', () => {
|
|||
|
||||
it('should again confirm the social name have been edited', async() => {
|
||||
await page.reloadSection('client.card.fiscalData');
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
|
||||
|
||||
expect(result).toEqual('Ant man and the Wasp');
|
||||
});
|
||||
|
@ -103,8 +104,8 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should not be able to save change throwing a verified data error', async() => {
|
||||
await page.clearInput(selectors.clientFiscalData.socialNameInput);
|
||||
await page.write(selectors.clientFiscalData.socialNameInput, 'This wont happen');
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'This wont happen');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -113,12 +114,12 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
describe('as salesAssistant', () => {
|
||||
beforeAll(async() => {
|
||||
it('should log in as salesAssistant then get to the client fiscal data', async() => {
|
||||
await page.forceReloadSection('client.card.fiscalData');
|
||||
await page.loginAndModule('salesAssistant', 'client');
|
||||
await page.accessToSearchResult('Hank Pym');
|
||||
await page.accessToSection('client.card.fiscalData');
|
||||
});
|
||||
}, 20000);
|
||||
|
||||
it('should confirm verified data button is enabled for salesAssistant', async() => {
|
||||
const isDisabled = await page.isDisabled(selectors.clientFiscalData.verifiedDataCheckbox);
|
||||
|
@ -127,8 +128,8 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should now edit the social name', async() => {
|
||||
await page.clearInput(selectors.clientFiscalData.socialNameInput);
|
||||
await page.write(selectors.clientFiscalData.socialNameInput, 'new social name edition');
|
||||
await page.clearInput(selectors.clientFiscalData.socialName);
|
||||
await page.write(selectors.clientFiscalData.socialName, 'new social name edition');
|
||||
await page.waitToClick(selectors.clientFiscalData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -137,7 +138,7 @@ describe('Client lock verified data path', () => {
|
|||
|
||||
it('should now confirm the social name have been edited once and for all', async() => {
|
||||
await page.reloadSection('client.card.fiscalData');
|
||||
const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.clientFiscalData.socialName, 'value');
|
||||
|
||||
expect(result).toEqual('new social name edition');
|
||||
});
|
||||
|
@ -158,7 +159,7 @@ describe('Client lock verified data path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the form is enabled for salesPerson', async() => {
|
||||
await page.wait(selectors.clientFiscalData.socialNameInput);
|
||||
await page.wait(selectors.clientFiscalData.socialName);
|
||||
const result = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, 'vn-textfield[ng-model="$ctrl.client.socialName"] > div');
|
|
@ -17,8 +17,8 @@ describe('Client log path', () => {
|
|||
});
|
||||
|
||||
it('should update the clients name', async() => {
|
||||
await page.clearInput(selectors.clientBasicData.nameInput);
|
||||
await page.write(selectors.clientBasicData.nameInput, 'this is a test');
|
||||
await page.clearInput(selectors.clientBasicData.name);
|
||||
await page.write(selectors.clientBasicData.name, 'this is a test');
|
||||
await page.waitToClick(selectors.clientBasicData.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -27,10 +27,9 @@ describe('Client log path', () => {
|
|||
|
||||
it('should navigate to the log section', async() => {
|
||||
await page.waitToClick(selectors.clientLog.logButton);
|
||||
await page.waitForURL('log');
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('log');
|
||||
|
||||
expect(url.hash).toContain('log');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should check the previous value of the last logged change', async() => {
|
|
@ -9,7 +9,7 @@ describe('Client balance path', () => {
|
|||
page = browser.page;
|
||||
await page.loginAndModule('administrative', 'client');
|
||||
await page.accessToSearchResult('Petter Parker');
|
||||
}, 30000);
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
|
@ -25,7 +25,7 @@ describe('Client balance path', () => {
|
|||
|
||||
it('should access to the balance section to check the data shown matches the local settings', async() => {
|
||||
await page.accessToSection('client.card.balance.index');
|
||||
let result = await page.waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value');
|
||||
let result = await page.waitToGetProperty(selectors.clientBalance.company, 'value');
|
||||
|
||||
expect(result).toEqual('CCs');
|
||||
});
|
||||
|
@ -39,20 +39,15 @@ describe('Client balance path', () => {
|
|||
});
|
||||
|
||||
it('should click the new payment button', async() => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.closePopup();
|
||||
await page.reloadSection('client.card.balance.index');
|
||||
await page.waitForURL('/balance');
|
||||
let url = await page.expectURL('/balance');
|
||||
|
||||
let url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('/balance');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should create a new payment that clears the debt', async() => {
|
||||
await Promise.all([
|
||||
page.waitToClick(selectors.clientBalance.newPaymentButton),
|
||||
page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true})
|
||||
]);
|
||||
await page.waitToClick(selectors.clientBalance.newPaymentButton);
|
||||
await page.autocompleteSearch(selectors.clientBalance.newPaymentBank, 'Pay on receipt');
|
||||
await page.waitToClick(selectors.clientBalance.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
@ -63,7 +58,7 @@ describe('Client balance path', () => {
|
|||
it('should check balance is now 0 and the company is now VNL becouse the user local settings were removed', async() => {
|
||||
await page.waitForSpinnerLoad();
|
||||
let company = await page
|
||||
.waitToGetProperty(`${selectors.clientBalance.companyAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.clientBalance.company, 'value');
|
||||
|
||||
let firstBalanceLine = await page
|
||||
.waitToGetProperty(selectors.clientBalance.firstBalanceLine, 'innerText');
|
||||
|
@ -76,8 +71,8 @@ describe('Client balance path', () => {
|
|||
it('should create a new payment that sets the balance to positive value', async() => {
|
||||
await page.waitToClick(selectors.clientBalance.newPaymentButton);
|
||||
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
|
||||
await page.clearInput(selectors.clientBalance.newPaymentAmountInput);
|
||||
await page.write(selectors.clientBalance.newPaymentAmountInput, '100');
|
||||
await page.clearInput(selectors.clientBalance.newPaymentAmount);
|
||||
await page.write(selectors.clientBalance.newPaymentAmount, '100');
|
||||
await page.waitToClick(selectors.clientBalance.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -95,8 +90,8 @@ describe('Client balance path', () => {
|
|||
await page.waitToClick(selectors.clientBalance.newPaymentButton);
|
||||
await page.waitFor(3000); // didn't manage to make this dynamic to allow clearInput to find the icon clear... :(
|
||||
await page.waitForSelector('.vn-dialog.vn-popup.shown', {visible: true});
|
||||
await page.clearInput(selectors.clientBalance.newPaymentAmountInput);
|
||||
await page.write(selectors.clientBalance.newPaymentAmountInput, '-150');
|
||||
await page.clearInput(selectors.clientBalance.newPaymentAmount);
|
||||
await page.write(selectors.clientBalance.newPaymentAmount, '-150');
|
||||
await page.waitToClick(selectors.clientBalance.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -116,13 +111,13 @@ describe('Client balance path', () => {
|
|||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.clientsButton);
|
||||
await page.wait(selectors.clientsIndex.createClientButton);
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/client/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/client/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should now search for the user Petter Parker', async() => {
|
||||
await page.write(selectors.clientsIndex.searchClientInput, 'Petter Parker');
|
||||
await page.write(selectors.clientsIndex.topbarSearch, 'Petter Parker');
|
||||
await page.waitToClick(selectors.clientsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1);
|
||||
let resultCount = await page.countElement(selectors.clientsIndex.searchResult);
|
||||
|
@ -135,10 +130,9 @@ describe('Client balance path', () => {
|
|||
await page.waitToClick(selectors.clientsIndex.searchResult);
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.clientBalance.balanceButton);
|
||||
await page.waitForURL('/balance');
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/balance');
|
||||
|
||||
expect(url.hash).toContain('/balance');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should not be able to click the new payment button as it isnt present', async() => {
|
|
@ -16,30 +16,32 @@ describe('User config', () => {
|
|||
describe('as salesPerson', () => {
|
||||
it('should login', async() => {
|
||||
await page.login('salesPerson');
|
||||
await page.waitForContentLoaded();
|
||||
});
|
||||
|
||||
it('should now open the user config form to check the settings', async() => {
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
await page.waitForContentLoaded();
|
||||
|
||||
let userLocalWarehouse = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
|
||||
let expectedLocalWarehouse = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
|
||||
|
||||
|
||||
let userLocalBank = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
|
||||
let expectedLocalBank = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
|
||||
|
||||
let userLocalCompany = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
|
||||
let expectedLocalCompany = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
|
||||
|
||||
let userWarehouse = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
|
||||
|
||||
let userCompany = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userCompany, 'value');
|
||||
|
||||
expect(userLocalWarehouse).toEqual('');
|
||||
expect(userLocalBank).toEqual('');
|
||||
expect(userLocalCompany).toEqual('');
|
||||
expect(expectedLocalWarehouse).toBeTruthy();
|
||||
expect(expectedLocalBank).toBeTruthy();
|
||||
expect(expectedLocalCompany).toBeTruthy();
|
||||
expect(userWarehouse).toEqual('Warehouse Three');
|
||||
expect(userCompany).toEqual('VNH');
|
||||
});
|
||||
|
@ -48,28 +50,31 @@ describe('User config', () => {
|
|||
describe('as employee', () => {
|
||||
it('should log in', async() => {
|
||||
await page.login('employee');
|
||||
await page.waitForContentLoaded();
|
||||
});
|
||||
|
||||
it('should open the user config form to check the settings', async() => {
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
let userLocalWarehouse = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
|
||||
await page.waitFor(1000);
|
||||
let expectedLocalWarehouse = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');
|
||||
|
||||
let userLocalBank = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
|
||||
|
||||
let userLocalCompany = await page
|
||||
.getProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
|
||||
let expectedLocalBank = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalBank, 'value', '');
|
||||
|
||||
let expectedLocalCompany = await page
|
||||
.expectPropertyValue(selectors.globalItems.userLocalCompany, 'value', '');
|
||||
|
||||
let userWarehouse = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
|
||||
|
||||
let userCompany = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userCompany, 'value');
|
||||
|
||||
expect(userLocalWarehouse).toEqual('');
|
||||
expect(userLocalBank).toEqual('');
|
||||
expect(userLocalCompany).toEqual('');
|
||||
expect(expectedLocalWarehouse).toBeTruthy();
|
||||
expect(expectedLocalBank).toBeTruthy();
|
||||
expect(expectedLocalCompany).toBeTruthy();
|
||||
expect(userWarehouse).toEqual('Warehouse Two');
|
||||
expect(userCompany).toEqual('CCs');
|
||||
});
|
||||
|
@ -87,24 +92,25 @@ describe('User config', () => {
|
|||
describe('as salesPerson 2nd run', () => {
|
||||
it('should log in once more', async() => {
|
||||
await page.login('salesPerson');
|
||||
await page.waitForContentLoaded();
|
||||
});
|
||||
|
||||
it('should again open the user config form to check the local settings', async() => {
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
let userLocalWarehouse = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
|
||||
|
||||
let userLocalBank = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userLocalBank} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userLocalBank, 'value');
|
||||
|
||||
let userLocalCompany = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userLocalCompany} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userLocalCompany, 'value');
|
||||
|
||||
let userWarehouse = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userWarehouse} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userWarehouse, 'value');
|
||||
|
||||
let userCompany = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userCompany} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userCompany, 'value');
|
||||
|
||||
expect(userLocalWarehouse).toContain('Warehouse Four');
|
||||
expect(userLocalBank).toContain('Pay on receipt');
|
|
@ -27,7 +27,7 @@ describe('Client DMS', () => {
|
|||
|
||||
it(`should click on the first document line worker name making the descriptor visible`, async() => {
|
||||
await page.waitToClick(selectors.dms.firstDocWorker);
|
||||
await page.wait(selectors.dms.firstDocWorkerDescriptor);
|
||||
await page.waitForSelector(selectors.dms.firstDocWorkerDescriptor);
|
||||
const visible = await page.isVisible(selectors.dms.firstDocWorkerDescriptor);
|
||||
|
||||
expect(visible).toBeTruthy();
|
|
@ -0,0 +1,37 @@
|
|||
import selectors from '../../helpers/selectors';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Client contacts', () => {
|
||||
let browser;
|
||||
let page;
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('employee', 'client');
|
||||
await page.accessToSearchResult('Clark Kent');
|
||||
await page.accessToSection('client.card.contact');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should add a contact', async() => {
|
||||
await page.waitToClick(selectors.clientContacts.addContactButton);
|
||||
await page.clearInput(selectors.clientContacts.name);
|
||||
await page.write(selectors.clientContacts.name, 'Ansible');
|
||||
await page.write(selectors.clientContacts.phone, 'FTL comms');
|
||||
await page.waitToClick(selectors.clientContacts.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it('should delete de contact', async() => {
|
||||
await page.waitToClick(selectors.clientContacts.deleteFirstPhone);
|
||||
await page.waitToClick(selectors.clientContacts.saveButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,80 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Client summary path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('employee', 'client');
|
||||
await page.accessToSearchResult('Petter Parker');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should reach the first route summary section', async() => {
|
||||
let url = await page.expectURL('#!/client/102/summary');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should display details from the client on the header', async() => {
|
||||
await page.waitForTextInElement(selectors.clientSummary.header, 'Petter Parker');
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.header, 'innerText');
|
||||
|
||||
expect(result).toContain('Petter Parker');
|
||||
});
|
||||
|
||||
it('should display some basic data', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.email, 'innerText');
|
||||
|
||||
expect(result).toContain('PetterParker@mydomain.com');
|
||||
});
|
||||
|
||||
it('should display fiscal address details', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.street, 'innerText');
|
||||
|
||||
expect(result).toContain('20 Ingram Street');
|
||||
});
|
||||
|
||||
it('should display some fiscal data', async() => {
|
||||
await page.waitForClassPresent(selectors.clientSummary.verifiedData, 'checked');
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.verifiedData, 'innerText');
|
||||
|
||||
expect(result).toContain('Verified data');
|
||||
});
|
||||
|
||||
it('should display pay method details', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.payMethod, 'innerText');
|
||||
|
||||
expect(result).toContain('PayMethod five');
|
||||
});
|
||||
|
||||
it('should display default address details', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.defaultAdressName, 'innerText');
|
||||
|
||||
expect(result).toContain('Petter Parker');
|
||||
});
|
||||
|
||||
it('should display web access details', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.userName, 'innerText');
|
||||
|
||||
expect(result).toContain('PetterParker');
|
||||
});
|
||||
|
||||
it('should display business data', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.rate, 'innerText');
|
||||
|
||||
expect(result).toContain('%');
|
||||
});
|
||||
|
||||
it('should display financial information', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.clientSummary.credit, 'innerText');
|
||||
|
||||
expect(result).toContain('€300.00');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,50 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Worker basic data path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('hr', 'worker');
|
||||
await page.accessToSearchResult('David Charles Haller');
|
||||
await page.accessToSection('worker.card.basicData');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should edit the form', async() => {
|
||||
await page.clearInput(selectors.workerBasicData.name);
|
||||
await page.write(selectors.workerBasicData.name, 'David C.');
|
||||
await page.clearInput(selectors.workerBasicData.surname);
|
||||
await page.write(selectors.workerBasicData.surname, 'H.');
|
||||
await page.clearInput(selectors.workerBasicData.phone);
|
||||
await page.write(selectors.workerBasicData.phone, '444332211');
|
||||
await page.waitToClick(selectors.workerBasicData.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it('should reload the section then check the name was edited', async() => {
|
||||
await page.reloadSection('worker.card.basicData');
|
||||
const result = await page.waitToGetProperty(selectors.workerBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('David C.');
|
||||
});
|
||||
|
||||
it('should the surname was edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.workerBasicData.surname, 'value');
|
||||
|
||||
expect(result).toEqual('H.');
|
||||
});
|
||||
|
||||
it('should the phone was edited', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.workerBasicData.phone, 'value');
|
||||
|
||||
expect(result).toEqual('444332211');
|
||||
});
|
||||
});
|
|
@ -1,8 +1,7 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
// #2047 WorkerTimeControl no suma horas
|
||||
xdescribe('Worker time control path', () => {
|
||||
describe('Worker time control path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
beforeAll(async() => {
|
||||
|
@ -23,7 +22,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '07:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfMonday, 'innerText');
|
||||
|
||||
|
@ -34,7 +33,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfMonday, 'innerText');
|
||||
|
||||
|
@ -45,7 +44,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '18:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
|
||||
|
||||
|
@ -67,7 +66,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '14:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText');
|
||||
|
||||
|
@ -78,7 +77,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:20';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.mondayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfMonday, 'innerText');
|
||||
|
||||
|
@ -108,7 +107,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '08:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfTuesday, 'innerText');
|
||||
|
||||
|
@ -119,7 +118,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfTuesday, 'innerText');
|
||||
|
||||
|
@ -130,7 +129,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:20';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfTuesday, 'innerText');
|
||||
|
||||
|
@ -141,7 +140,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '16:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfTuesday, 'innerText');
|
||||
|
||||
|
@ -161,7 +160,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '09:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText');
|
||||
|
||||
|
@ -172,7 +171,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfWednesday, 'innerText');
|
||||
|
||||
|
@ -183,7 +182,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '10:20';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfWednesday, 'innerText');
|
||||
|
||||
|
@ -194,7 +193,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '17:00';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfWednesday, 'innerText');
|
||||
|
||||
|
@ -214,7 +213,7 @@ xdescribe('Worker time control path', () => {
|
|||
const scanTime = '09:59';
|
||||
|
||||
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfThursday, 'innerText');
|
||||
|
||||
|
@ -224,7 +223,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should joyfully scan out Hank Pym for break`, async() => {
|
||||
const scanTime = '10:00';
|
||||
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfThursday, 'innerText');
|
||||
|
||||
|
@ -234,7 +233,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should joyfully scan in Hank Pym from the break`, async() => {
|
||||
const scanTime = '10:20';
|
||||
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfThursday, 'innerText');
|
||||
|
||||
|
@ -244,7 +243,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should joyfully scan out Hank Pym for the day`, async() => {
|
||||
const scanTime = '17:59';
|
||||
await page.waitToClick(selectors.workerTimeControl.thursdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfThursday, 'innerText');
|
||||
|
||||
|
@ -263,7 +262,7 @@ xdescribe('Worker time control path', () => {
|
|||
it('should smilingly scan in Hank Pym', async() => {
|
||||
const scanTime = '07:30';
|
||||
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfFriday, 'innerText');
|
||||
|
||||
|
@ -273,7 +272,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should smilingly scan out Hank Pym for break`, async() => {
|
||||
const scanTime = '10:00';
|
||||
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfFriday, 'innerText');
|
||||
|
||||
|
@ -283,7 +282,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should smilingly scan in Hank Pym from the break`, async() => {
|
||||
const scanTime = '10:20';
|
||||
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.thirdEntryOfFriday, 'innerText');
|
||||
|
||||
|
@ -293,7 +292,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should smilingly scan out Hank Pym for the day`, async() => {
|
||||
const scanTime = '15:30';
|
||||
await page.waitToClick(selectors.workerTimeControl.fridayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.fourthEntryOfFriday, 'innerText');
|
||||
|
||||
|
@ -324,7 +323,7 @@ xdescribe('Worker time control path', () => {
|
|||
it('should lovingly scan in Hank Pym', async() => {
|
||||
const scanTime = '06:00';
|
||||
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSaturday, 'innerText');
|
||||
|
||||
|
@ -334,7 +333,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should lovingly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
|
||||
const scanTime = '13:40';
|
||||
await page.waitToClick(selectors.workerTimeControl.saturdayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSaturday, 'innerText');
|
||||
|
||||
|
@ -353,7 +352,7 @@ xdescribe('Worker time control path', () => {
|
|||
it('should gladly scan in Hank Pym', async() => {
|
||||
const scanTime = '05:00';
|
||||
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.firstEntryOfSunday, 'innerText');
|
||||
|
||||
|
@ -363,7 +362,7 @@ xdescribe('Worker time control path', () => {
|
|||
it(`should gladly scan out Hank Pym for the day with no break to leave a bit early`, async() => {
|
||||
const scanTime = '12:40';
|
||||
await page.waitToClick(selectors.workerTimeControl.sundayAddTimeButton);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialogInput, scanTime);
|
||||
await page.pickTime(selectors.workerTimeControl.timeDialog, scanTime);
|
||||
await page.waitToClick(selectors.workerTimeControl.confirmButton);
|
||||
const result = await page.waitToGetProperty(selectors.workerTimeControl.secondEntryOfSunday, 'innerText');
|
||||
|
|
@ -17,8 +17,7 @@ describe('Worker pbx path', () => {
|
|||
});
|
||||
|
||||
it('should receive an error when the extension exceeds 4 characters', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.write(selectors.workerPbx.extensionInput, '55555');
|
||||
await page.write(selectors.workerPbx.extension, '55555');
|
||||
await page.waitToClick(selectors.workerPbx.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -26,8 +25,8 @@ describe('Worker pbx path', () => {
|
|||
});
|
||||
|
||||
it('should sucessfully save the changes', async() => {
|
||||
await page.clearInput(selectors.workerPbx.extensionInput);
|
||||
await page.write(selectors.workerPbx.extensionInput, '4444');
|
||||
await page.clearInput(selectors.workerPbx.extension);
|
||||
await page.write(selectors.workerPbx.extension, '4444');
|
||||
await page.waitToClick(selectors.workerPbx.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
|
@ -15,8 +15,8 @@ describe('Item summary path', () => {
|
|||
});
|
||||
|
||||
it('should search for an item', async() => {
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon longbow 2m');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon longbow 2m');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -68,15 +68,14 @@ describe('Item summary path', () => {
|
|||
});
|
||||
|
||||
it(`should close the summary popup`, async() => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.waitUntilNotPresent(selectors.itemSummary.basicData);
|
||||
await page.waitFor(selectors.itemSummary.basicData, {hidden: true});
|
||||
await page.closePopup();
|
||||
await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
|
||||
});
|
||||
|
||||
it('should search for other item', async() => {
|
||||
await page.clearInput('vn-searchbar');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Melee weapon combat fist 15cm');
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Melee weapon combat fist 15cm');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -125,16 +124,15 @@ describe('Item summary path', () => {
|
|||
});
|
||||
|
||||
it(`should now close the summary popup`, async() => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.closePopup();
|
||||
await page.waitForSelector(selectors.itemSummary.basicData, {hidden: true});
|
||||
});
|
||||
|
||||
it(`should navigate to the one of the items detailed section`, async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||
await page.waitForURL('summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('summary');
|
||||
|
||||
expect(url.hash).toContain('summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should check the descritor edit button is not visible for employee`, async() => {
|
|
@ -21,16 +21,16 @@ describe('Item Edit basic data path', () => {
|
|||
});
|
||||
|
||||
it(`should edit the item basic data`, async() => {
|
||||
await page.clearInput(selectors.itemBasicData.nameInput);
|
||||
await page.write(selectors.itemBasicData.nameInput, 'Rose of Purity');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Anthurium');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares');
|
||||
await page.clearInput(selectors.itemBasicData.relevancyInput);
|
||||
await page.write(selectors.itemBasicData.relevancyInput, '1');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.expenseAutocomplete, 'Alquiler VNH');
|
||||
await page.clearInput(selectors.itemBasicData.longNameInput);
|
||||
await page.write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity');
|
||||
await page.clearInput(selectors.itemBasicData.name);
|
||||
await page.write(selectors.itemBasicData.name, 'Rose of Purity');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.type, 'Anthurium');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.intrastat, 'Coral y materiales similares');
|
||||
await page.clearInput(selectors.itemBasicData.relevancy);
|
||||
await page.write(selectors.itemBasicData.relevancy, '1');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.origin, 'Spain');
|
||||
await page.autocompleteSearch(selectors.itemBasicData.expense, 'Alquiler VNH');
|
||||
await page.clearInput(selectors.itemBasicData.longName);
|
||||
await page.write(selectors.itemBasicData.longName, 'RS Rose of Purity');
|
||||
await page.waitToClick(selectors.itemBasicData.isActiveCheckbox);
|
||||
await page.waitToClick(selectors.itemBasicData.priceInKgCheckbox);
|
||||
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
|
||||
|
@ -39,52 +39,71 @@ describe('Item Edit basic data path', () => {
|
|||
expect(result).toEqual('Data saved!');
|
||||
}, 20000);
|
||||
|
||||
it(`should create a new intrastat`, async() => {
|
||||
await page.waitToClick(selectors.itemBasicData.newIntrastatButton);
|
||||
await page.write(selectors.itemBasicData.newIntrastatId, '588420239');
|
||||
await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers');
|
||||
await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton);
|
||||
await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
|
||||
let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
|
||||
|
||||
expect(newcode).toEqual('588420239 Tropical Flowers');
|
||||
});
|
||||
|
||||
it(`should save with the new intrastat`, async() => {
|
||||
await page.waitFor(250);
|
||||
await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
|
||||
await page.waitToClick(selectors.itemBasicData.submitBasicDataButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
});
|
||||
|
||||
it(`should confirm the item name was edited`, async() => {
|
||||
await page.reloadSection('item.card.basicData');
|
||||
await page.waitForContentLoaded();
|
||||
const result = await page.waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.itemBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Rose of Purity');
|
||||
});
|
||||
|
||||
it(`should confirm the item type was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.type, 'value');
|
||||
|
||||
expect(result).toEqual('Anthurium');
|
||||
});
|
||||
|
||||
it(`should confirm the item intrastad was edited`, async() => {
|
||||
it(`should confirm the item intrastat was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
|
||||
|
||||
expect(result).toEqual('5080000 Coral y materiales similares');
|
||||
expect(result).toEqual('588420239 Tropical Flowers');
|
||||
});
|
||||
|
||||
it(`should confirm the item relevancy was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.relevancyInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.relevancy, 'value');
|
||||
|
||||
expect(result).toEqual('1');
|
||||
});
|
||||
|
||||
it(`should confirm the item origin was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.origin, 'value');
|
||||
|
||||
expect(result).toEqual('Spain');
|
||||
});
|
||||
|
||||
it(`should confirm the item expence was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.expenseAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.expense, 'value');
|
||||
|
||||
expect(result).toEqual('Alquiler VNH');
|
||||
});
|
||||
|
||||
it(`should confirm the item long name was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.longNameInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.longName, 'value');
|
||||
|
||||
expect(result).toEqual('RS Rose of Purity');
|
||||
});
|
|
@ -17,9 +17,9 @@ describe('Item edit tax path', () => {
|
|||
});
|
||||
|
||||
it(`should add the item tax to all countries`, async() => {
|
||||
await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'General VAT');
|
||||
await page.autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT');
|
||||
await page.autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'General VAT');
|
||||
await page.autocompleteSearch(selectors.itemTax.firstClass, 'General VAT');
|
||||
await page.autocompleteSearch(selectors.itemTax.secondClass, 'General VAT');
|
||||
await page.autocompleteSearch(selectors.itemTax.thirdClass, 'General VAT');
|
||||
await page.waitToClick(selectors.itemTax.submitTaxButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -28,35 +28,35 @@ describe('Item edit tax path', () => {
|
|||
|
||||
it(`should confirm the first item tax class was edited`, async() => {
|
||||
await page.reloadSection('item.card.tax');
|
||||
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
|
||||
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
|
||||
|
||||
expect(firstVatType).toEqual('General VAT');
|
||||
});
|
||||
|
||||
it(`should confirm the second item tax class was edited`, async() => {
|
||||
const secondVatType = await page
|
||||
.waitToGetProperty(`${selectors.itemTax.secondClassAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTax.secondClass, 'value');
|
||||
|
||||
expect(secondVatType).toEqual('General VAT');
|
||||
});
|
||||
|
||||
it(`should confirm the third item tax class was edited`, async() => {
|
||||
const thirdVatType = await page
|
||||
.waitToGetProperty(`${selectors.itemTax.thirdClassAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTax.thirdClass, 'value');
|
||||
|
||||
expect(thirdVatType).toEqual('General VAT');
|
||||
});
|
||||
|
||||
it(`should edit the first class without saving the form`, async() => {
|
||||
await page.autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT');
|
||||
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
|
||||
await page.autocompleteSearch(selectors.itemTax.firstClass, 'Reduced VAT');
|
||||
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
|
||||
|
||||
expect(firstVatType).toEqual('Reduced VAT');
|
||||
});
|
||||
|
||||
it(`should now click the undo changes button and see the changes works`, async() => {
|
||||
await page.waitToClick(selectors.itemTax.undoChangesButton);
|
||||
const firstVatType = await page.waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value');
|
||||
const firstVatType = await page.waitToGetProperty(selectors.itemTax.firstClass, 'value');
|
||||
|
||||
expect(firstVatType).toEqual('General VAT');
|
||||
});
|
|
@ -19,10 +19,10 @@ describe('Item create tags path', () => {
|
|||
it(`should create a new tag and delete a former one`, async() => {
|
||||
await page.waitToClick(selectors.itemTags.fourthRemoveTagButton);
|
||||
await page.waitToClick(selectors.itemTags.addItemTagButton);
|
||||
await page.autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base');
|
||||
await page.write(selectors.itemTags.seventhValueInput, '50');
|
||||
await page.clearInput(selectors.itemTags.seventhRelevancyInput);
|
||||
await page.write(selectors.itemTags.seventhRelevancyInput, '4');
|
||||
await page.autocompleteSearch(selectors.itemTags.seventhTag, 'Ancho de la base');
|
||||
await page.write(selectors.itemTags.seventhValue, '50');
|
||||
await page.clearInput(selectors.itemTags.seventhRelevancy);
|
||||
await page.write(selectors.itemTags.seventhRelevancy, '4');
|
||||
await page.waitToClick(selectors.itemTags.submitItemTagsButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -32,30 +32,30 @@ describe('Item create tags path', () => {
|
|||
it(`should confirm the fourth row data is the expected one`, async() => {
|
||||
await page.reloadSection('item.card.tags');
|
||||
await page.wait('vn-item-tags');
|
||||
let result = await page.waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value');
|
||||
let result = await page.waitToGetProperty(selectors.itemTags.fourthTag, 'value');
|
||||
|
||||
expect(result).toEqual('Ancho de la base');
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.fourthValueInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.fourthValue, 'value');
|
||||
|
||||
expect(result).toEqual('50');
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.fourthRelevancyInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.fourthRelevancy, 'value');
|
||||
|
||||
expect(result).toEqual('4');
|
||||
});
|
||||
|
||||
it(`should confirm the fifth row data is the expected one`, async() => {
|
||||
let tag = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.fifthTagAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.fifthTag, 'value');
|
||||
|
||||
let value = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.fifthValueInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.fifthValue, 'value');
|
||||
|
||||
let relevancy = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.fifthRelevancyInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.fifthRelevancy, 'value');
|
||||
|
||||
expect(tag).toEqual('Color');
|
||||
expect(value).toEqual('Brown');
|
||||
|
@ -64,13 +64,13 @@ describe('Item create tags path', () => {
|
|||
|
||||
it(`should confirm the sixth row data is the expected one`, async() => {
|
||||
let tag = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.sixthTagAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.sixthTag, 'value');
|
||||
|
||||
let value = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.sixthValueInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.sixthValue, 'value');
|
||||
|
||||
let relevancy = await page
|
||||
.waitToGetProperty(`${selectors.itemTags.sixthRelevancyInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemTags.sixthRelevancy, 'value');
|
||||
|
||||
expect(tag).toEqual('Categoria');
|
||||
expect(value).toEqual('+1 precission');
|
|
@ -17,11 +17,11 @@ describe('Item create niche path', () => {
|
|||
});
|
||||
|
||||
it(`should click create a new niche and delete a former one`, async() => {
|
||||
await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One');
|
||||
await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
|
||||
await page.waitToClick(selectors.itemNiches.addNicheButton);
|
||||
await page.waitToClick(selectors.itemNiches.secondNicheRemoveButton);
|
||||
await page.autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two');
|
||||
await page.write(selectors.itemNiches.thirdCodeInput, 'A4');
|
||||
await page.autocompleteSearch(selectors.itemNiches.thirdWarehouse, 'Warehouse Two');
|
||||
await page.write(selectors.itemNiches.thirdCode, 'A4');
|
||||
await page.waitToClick(selectors.itemNiches.submitNichesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -30,36 +30,36 @@ describe('Item create niche path', () => {
|
|||
|
||||
it(`should confirm the first niche is the expected one`, async() => {
|
||||
await page.reloadSection('item.card.niche');
|
||||
await page.waitForTextInInput(selectors.itemNiches.firstWarehouseAutocomplete, 'Warehouse One');
|
||||
await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
|
||||
let result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.firstWarehouse, 'value');
|
||||
|
||||
expect(result).toEqual('Warehouse One');
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.firstCodeInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.firstCode, 'value');
|
||||
|
||||
expect(result).toEqual('A1');
|
||||
});
|
||||
|
||||
it(`should confirm the second niche is the expected one`, async() => {
|
||||
let result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.secondWarehouseAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.secondWarehouse, 'value');
|
||||
|
||||
expect(result).toEqual('Warehouse Three');
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.secondCodeInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.secondCode, 'value');
|
||||
|
||||
expect(result).toEqual('A3');
|
||||
});
|
||||
|
||||
it(`should confirm the third niche is the expected one`, async() => {
|
||||
let result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.thirdWarehouseAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.thirdWarehouse, 'value');
|
||||
|
||||
expect(result).toEqual('Warehouse Two');
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemNiches.thirdCodeInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemNiches.thirdCode, 'value');
|
||||
|
||||
expect(result).toEqual('A4');
|
||||
});
|
|
@ -17,9 +17,9 @@ describe('Item Create botanical path', () => {
|
|||
});
|
||||
|
||||
it(`should create a new botanical for the item`, async() => {
|
||||
await page.write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata');
|
||||
await page.write(selectors.itemBotanical.botanical, 'Cicuta maculata');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abelia');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.species, 'dealbata');
|
||||
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -28,33 +28,33 @@ describe('Item Create botanical path', () => {
|
|||
|
||||
it(`should confirm the botanical for the item was created`, async() => {
|
||||
await page.reloadSection('item.card.botanical');
|
||||
await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata');
|
||||
await page.waitForTextInField(selectors.itemBotanical.botanical, 'Cicuta maculata');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.botanical, 'value');
|
||||
|
||||
expect(result).toEqual('Cicuta maculata');
|
||||
});
|
||||
|
||||
it(`should confirm the Genus for the item was created`, async() => {
|
||||
await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abelia');
|
||||
await page.waitForTextInField(selectors.itemBotanical.genus, 'Abelia');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.genus, 'value');
|
||||
|
||||
expect(result).toEqual('Abelia');
|
||||
});
|
||||
|
||||
it(`should confirm the Species for the item was created`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.species, 'value');
|
||||
|
||||
expect(result).toEqual('dealbata');
|
||||
});
|
||||
|
||||
it(`should edit botanical for the item`, async() => {
|
||||
await page.clearInput(selectors.itemBotanical.botanicalInput);
|
||||
await page.write(selectors.itemBotanical.botanicalInput, 'Herp Derp');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens');
|
||||
await page.clearInput(selectors.itemBotanical.botanical);
|
||||
await page.write(selectors.itemBotanical.botanical, 'Herp Derp');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.genus, 'Abies');
|
||||
await page.autocompleteSearch(selectors.itemBotanical.species, 'decurrens');
|
||||
await page.waitToClick(selectors.itemBotanical.submitBotanicalButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -63,24 +63,24 @@ describe('Item Create botanical path', () => {
|
|||
|
||||
it(`should confirm the botanical for the item was edited`, async() => {
|
||||
await page.reloadSection('item.card.botanical');
|
||||
await page.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp');
|
||||
await page.waitForTextInField(selectors.itemBotanical.botanical, 'Herp Derp');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.botanicalInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.botanical, 'value');
|
||||
|
||||
expect(result).toEqual('Herp Derp');
|
||||
});
|
||||
|
||||
it(`should confirm the Genus for the item was edited`, async() => {
|
||||
await page.waitForTextInInput(selectors.itemBotanical.genusAutocomplete, 'Abies');
|
||||
await page.waitForTextInField(selectors.itemBotanical.genus, 'Abies');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.genus, 'value');
|
||||
|
||||
expect(result).toEqual('Abies');
|
||||
});
|
||||
|
||||
it(`should confirm the Species for the item was edited`, async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBotanical.species, 'value');
|
||||
|
||||
expect(result).toEqual('decurrens');
|
||||
});
|
|
@ -19,7 +19,7 @@ describe('Item Create barcodes path', () => {
|
|||
it(`should click create a new code and delete a former one`, async() => {
|
||||
await page.waitToClick(selectors.itemBarcodes.firstCodeRemoveButton);
|
||||
await page.waitToClick(selectors.itemBarcodes.addBarcodeButton);
|
||||
await page.write(selectors.itemBarcodes.thirdCodeInput, '5');
|
||||
await page.write(selectors.itemBarcodes.thirdCode, '5');
|
||||
await page.waitToClick(selectors.itemBarcodes.submitBarcodesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -28,9 +28,9 @@ describe('Item Create barcodes path', () => {
|
|||
|
||||
it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => {
|
||||
await page.reloadSection('item.card.itemBarcode');
|
||||
await page.waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5');
|
||||
await page.waitForTextInField(selectors.itemBarcodes.thirdCode, '5');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.itemBarcodes.thirdCodeInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBarcodes.thirdCode, 'value');
|
||||
|
||||
expect(result).toEqual('5');
|
||||
});
|
|
@ -16,8 +16,8 @@ describe('Item Create/Clone path', () => {
|
|||
|
||||
describe('create', () => {
|
||||
it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => {
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -27,34 +27,30 @@ describe('Item Create/Clone path', () => {
|
|||
|
||||
it('should access to the create item view by clicking the create floating button', async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||
await page.wait(selectors.itemCreateView.createButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/create');
|
||||
|
||||
expect(url.hash).toEqual('#!/item/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should return to the item index by clickig the cancel button', async() => {
|
||||
await page.waitToClick(selectors.itemCreateView.cancelButton);
|
||||
await page.wait(selectors.itemsIndex.createItemButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should now access to the create item view by clicking the create floating button', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||
await page.wait(selectors.itemCreateView.createButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/create');
|
||||
|
||||
expect(url.hash).toEqual('#!/item/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should create the Infinity Gauntlet item', async() => {
|
||||
await page.write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
|
||||
await page.waitToClick(selectors.itemCreateView.createButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -63,23 +59,23 @@ describe('Item Create/Clone path', () => {
|
|||
|
||||
it('should confirm Infinity Gauntlet item was created', async() => {
|
||||
let result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.nameInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Infinity Gauntlet');
|
||||
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.type, 'value');
|
||||
|
||||
expect(result).toEqual('Crisantemo');
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');
|
||||
|
||||
expect(result).toEqual('5080000 Coral y materiales similares');
|
||||
|
||||
result = await page
|
||||
.waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.itemBasicData.origin, 'value');
|
||||
|
||||
expect(result).toEqual('Holand');
|
||||
});
|
||||
|
@ -89,15 +85,14 @@ describe('Item Create/Clone path', () => {
|
|||
it('should return to the items index by clicking the return to items button', async() => {
|
||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||
await page.wait(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForURL('#!/item/index');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/index');
|
||||
|
||||
expect(url.hash).toContain('#!/item/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should search for the item Infinity Gauntlet`, async() => {
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -109,16 +104,15 @@ describe('Item Create/Clone path', () => {
|
|||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet');
|
||||
await page.waitToClick(selectors.itemsIndex.searchResultCloneButton);
|
||||
await page.waitToClick(selectors.itemsIndex.acceptClonationAlertButton);
|
||||
await page.waitForURL('tags');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('tags');
|
||||
|
||||
expect(url.hash).toContain('tags');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should search for the item Infinity Gauntlet and find two', async() => {
|
||||
await page.waitToClick(selectors.itemTags.goToItemIndexButton);
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Infinity Gauntlet');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
|
@ -25,17 +25,16 @@ describe('Item regularize path', () => {
|
|||
|
||||
it('should check the local settings were saved', async() => {
|
||||
const userLocalWarehouse = await page
|
||||
.waitToGetProperty(`${selectors.globalItems.userLocalWarehouse} input`, 'value');
|
||||
.waitToGetProperty(selectors.globalItems.userLocalWarehouse, 'value');
|
||||
|
||||
await page.keyboard.press('Escape');
|
||||
await page.waitForSelector('.user-popover.vn-popover', {hidden: true});
|
||||
await page.closePopup();
|
||||
|
||||
expect(userLocalWarehouse).toContain('Warehouse Four');
|
||||
});
|
||||
|
||||
it('should search for an specific item', async() => {
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
|
||||
const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -46,23 +45,22 @@ describe('Item regularize path', () => {
|
|||
it(`should click on the search result to access to the item tax`, async() => {
|
||||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should open the regularize dialog and check the warehouse matches the local user settings', async() => {
|
||||
await page.waitToClick(selectors.itemDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
|
||||
const result = await page.waitToGetProperty(`${selectors.itemDescriptor.regularizeWarehouseAutocomplete} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.itemDescriptor.regularizeWarehouse, 'value');
|
||||
|
||||
expect(result).toEqual('Warehouse Four');
|
||||
});
|
||||
|
||||
it('should regularize the item', async() => {
|
||||
await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100');
|
||||
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One');
|
||||
await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
|
||||
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
|
||||
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -76,13 +74,12 @@ describe('Item regularize path', () => {
|
|||
page.waitForNavigation({waitUntil: ['load', 'networkidle0', 'domcontentloaded']}),
|
||||
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||
]);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should clear the user local settings now', async() => {
|
||||
await page.waitForTransitionEnd('vn-searchbar');
|
||||
await page.waitToClick(selectors.globalItems.userMenuButton);
|
||||
await page.clearInput(selectors.globalItems.userConfigFirstAutocomplete);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
@ -92,7 +89,7 @@ describe('Item regularize path', () => {
|
|||
|
||||
it('should search for the ticket with alias missing', async() => {
|
||||
await page.keyboard.press('Escape');
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, 'missing');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, 'missing');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -103,10 +100,9 @@ describe('Item regularize path', () => {
|
|||
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should check the ticket sale quantity is showing a negative value`, async() => {
|
||||
|
@ -128,15 +124,14 @@ describe('Item regularize path', () => {
|
|||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.itemsButton);
|
||||
await page.wait(selectors.itemsIndex.searchItemInput);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/item/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should search for the item once again', async() => {
|
||||
await page.clearInput(selectors.itemsIndex.searchItemInput);
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm');
|
||||
await page.clearInput(selectors.itemsIndex.topbarSearch);
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Ranged weapon pistol 9mm');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1);
|
||||
const resultCount = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -147,17 +142,16 @@ describe('Item regularize path', () => {
|
|||
it(`should click on the search result to access to the item tax`, async() => {
|
||||
await page.waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm');
|
||||
await page.waitToClick(selectors.itemsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should regularize the item once more', async() => {
|
||||
await page.waitToClick(selectors.itemDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton);
|
||||
await page.write(selectors.itemDescriptor.regularizeQuantityInput, '100');
|
||||
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One');
|
||||
await page.write(selectors.itemDescriptor.regularizeQuantity, '100');
|
||||
await page.autocompleteSearch(selectors.itemDescriptor.regularizeWarehouse, 'Warehouse One');
|
||||
await page.waitToClick(selectors.itemDescriptor.regularizeSaveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -172,13 +166,13 @@ describe('Item regularize path', () => {
|
|||
page.waitToClick(selectors.globalItems.ticketsButton)
|
||||
]);
|
||||
await page.waitForTransitionEnd('vn-searchbar');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should search for the ticket with id 25 once again', async() => {
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '25');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '25');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -189,10 +183,9 @@ describe('Item regularize path', () => {
|
|||
it(`should now click on the search result to access to the ticket summary`, async() => {
|
||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, '25');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should check the ticket contains now two sales`, async() => {
|
|
@ -15,7 +15,7 @@ describe('Item log path', () => {
|
|||
});
|
||||
|
||||
it(`should search for the Knowledge artifact to confirm it isn't created yet`, async() => {
|
||||
await page.write(selectors.itemsIndex.searchItemInput, 'Knowledge artifact');
|
||||
await page.write(selectors.itemsIndex.topbarSearch, 'Knowledge artifact');
|
||||
await page.waitToClick(selectors.itemsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.itemsIndex.searchResult, 0);
|
||||
const result = await page.countElement(selectors.itemsIndex.searchResult);
|
||||
|
@ -25,17 +25,16 @@ describe('Item log path', () => {
|
|||
|
||||
it('should access to the create item view by clicking the create floating button', async() => {
|
||||
await page.waitToClick(selectors.itemsIndex.createItemButton);
|
||||
await page.wait(selectors.itemCreateView.createButton);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/create');
|
||||
|
||||
expect(url.hash).toEqual('#!/item/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should create the Knowledge artifact item', async() => {
|
||||
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
|
||||
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
|
||||
await page.waitToClick(selectors.itemCreateView.createButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -45,19 +44,17 @@ describe('Item log path', () => {
|
|||
it('should return to the items index by clicking the return to items button', async() => {
|
||||
await page.waitToClick(selectors.itemBasicData.goToItemIndexButton);
|
||||
await page.wait(selectors.itemsIndex.createItemButton);
|
||||
await page.waitForURL('#!/item/index');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/item/index');
|
||||
|
||||
expect(url.hash).toContain('#!/item/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should search for the created item and navigate to it's log section`, async() => {
|
||||
await page.accessToSearchResult('Knowledge artifact');
|
||||
await page.accessToSection('item.card.log');
|
||||
await page.waitForURL('/log');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/log');
|
||||
|
||||
expect(url.hash).toContain('/log');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should confirm the log is showing 5 entries`, async() => {
|
|
@ -18,7 +18,6 @@ describe('Ticket List sale path', () => {
|
|||
});
|
||||
|
||||
it('should confirm the first ticket sale contains the colour tag', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
const value = await page
|
||||
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');
|
||||
|
|
@ -21,7 +21,7 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
it(`should click on the first sale claim icon to navigate over there`, async() => {
|
||||
const url = await nightmare
|
||||
.waitToClick(selectors.ticketSales.firstSaleClaimIcon)
|
||||
.wait(selectors.claimBasicData.claimStateAutocomplete)
|
||||
.wait(selectors.claimBasicData.claimState)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/claim/2/basic-data');
|
||||
|
@ -32,7 +32,7 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.wait(selectors.ticketsIndex.topbarSearch)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
|
@ -196,7 +196,7 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
|
||||
.waitToClick(selectors.ticketSales.moreMenu)
|
||||
.waitToClick(selectors.ticketSales.moreMenuCreateClaim)
|
||||
.wait(selectors.claimBasicData.claimStateAutocomplete)
|
||||
.wait(selectors.claimBasicData.claimState)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('basic-data');
|
||||
|
@ -228,7 +228,7 @@ xdescribe('Ticket Edit sale path', () => {
|
|||
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
||||
.wait(selectors.globalItems.applicationsMenuVisible)
|
||||
.waitToClick(selectors.globalItems.ticketsButton)
|
||||
.wait(selectors.ticketsIndex.searchTicketInput)
|
||||
.wait(selectors.ticketsIndex.topbarSearch)
|
||||
.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
|
@ -18,25 +18,24 @@ describe('Ticket Create notes path', () => {
|
|||
});
|
||||
|
||||
it('should create a new note', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketNotes.addNoteButton);
|
||||
await page.autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one');
|
||||
await page.write(selectors.ticketNotes.firstDescriptionInput, 'description');
|
||||
await page.autocompleteSearch(selectors.ticketNotes.firstNoteType, 'observation one');
|
||||
await page.write(selectors.ticketNotes.firstDescription, 'description');
|
||||
await page.waitToClick(selectors.ticketNotes.submitNotesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
expect(result).toEqual('Data saved!');
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
it('should confirm the note is the expected one', async() => {
|
||||
await page.reloadSection('ticket.card.observation');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketNotes.firstNoteType, 'value');
|
||||
|
||||
expect(result).toEqual('observation one');
|
||||
|
||||
const firstDescription = await page
|
||||
.waitToGetProperty(`${selectors.ticketNotes.firstDescriptionInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketNotes.firstDescription, 'value');
|
||||
|
||||
expect(firstDescription).toEqual('description');
|
||||
});
|
|
@ -20,7 +20,7 @@ describe('Ticket Create packages path', () => {
|
|||
it(`should attempt create a new package but receive an error if package is blank`, async() => {
|
||||
await page.waitToClick(selectors.ticketPackages.firstRemovePackageButton);
|
||||
await page.waitToClick(selectors.ticketPackages.addPackageButton);
|
||||
await page.write(selectors.ticketPackages.firstQuantityInput, '99');
|
||||
await page.write(selectors.ticketPackages.firstQuantity, '99');
|
||||
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -28,8 +28,8 @@ describe('Ticket Create packages path', () => {
|
|||
});
|
||||
|
||||
it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => {
|
||||
await page.clearInput(selectors.ticketPackages.firstQuantityInput);
|
||||
await page.autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m');
|
||||
await page.clearInput(selectors.ticketPackages.firstQuantity);
|
||||
await page.autocompleteSearch(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
|
||||
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -40,14 +40,14 @@ describe('Ticket Create packages path', () => {
|
|||
const result = await page
|
||||
.evaluate(selector => {
|
||||
return document.querySelector(`${selector} input`).checkValidity();
|
||||
}, selectors.ticketPackages.firstQuantityInput);
|
||||
}, selectors.ticketPackages.firstQuantity);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should create a new package with correct data`, async() => {
|
||||
await page.clearInput(selectors.ticketPackages.firstQuantityInput);
|
||||
await page.write(selectors.ticketPackages.firstQuantityInput, '-99');
|
||||
await page.clearInput(selectors.ticketPackages.firstQuantity);
|
||||
await page.write(selectors.ticketPackages.firstQuantity, '-99');
|
||||
await page.waitToClick(selectors.ticketPackages.savePackagesButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -56,15 +56,15 @@ describe('Ticket Create packages path', () => {
|
|||
|
||||
it(`should confirm the first select is the expected one`, async() => {
|
||||
await page.reloadSection('ticket.card.package');
|
||||
await page.waitForTextInInput(selectors.ticketPackages.firstPackageAutocomplete, 'Container medical box 1m');
|
||||
const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'value');
|
||||
await page.waitForTextInField(selectors.ticketPackages.firstPackage, 'Container medical box 1m');
|
||||
const result = await page.waitToGetProperty(selectors.ticketPackages.firstPackage, 'value');
|
||||
|
||||
expect(result).toEqual('7 : Container medical box 1m');
|
||||
});
|
||||
|
||||
it(`should confirm the first quantity is just a number and the string part was ignored by the imput number`, async() => {
|
||||
await page.waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '-99');
|
||||
const result = await page.waitToGetProperty(`${selectors.ticketPackages.firstQuantityInput} input`, 'value');
|
||||
await page.waitForTextInField(selectors.ticketPackages.firstQuantity, '-99');
|
||||
const result = await page.waitToGetProperty(selectors.ticketPackages.firstQuantity, 'value');
|
||||
|
||||
expect(result).toEqual('-99');
|
||||
});
|
|
@ -19,12 +19,11 @@ describe('Ticket Create new tracking state path', () => {
|
|||
});
|
||||
|
||||
it('should access to the create state view by clicking the create floating button', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||
await page.waitForSelector(selectors.createStateView.stateAutocomplete, {visible: true});
|
||||
let url = await page.parsedUrl();
|
||||
await page.waitForSelector(selectors.createStateView.state, {visible: true});
|
||||
let url = await page.expectURL('tracking/edit');
|
||||
|
||||
expect(url.hash).toContain('tracking/edit');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should attempt create a new state but receive an error if state is empty`, async() => {
|
||||
|
@ -35,7 +34,7 @@ describe('Ticket Create new tracking state path', () => {
|
|||
});
|
||||
|
||||
it(`should create a new state`, async() => {
|
||||
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?');
|
||||
await page.autocompleteSearch(selectors.createStateView.state, '¿Fecha?');
|
||||
await page.waitToClick(selectors.createStateView.saveStateButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -52,15 +51,14 @@ describe('Ticket Create new tracking state path', () => {
|
|||
|
||||
it('should now access to the create state view by clicking the create floating button', async() => {
|
||||
await page.waitToClick(selectors.ticketTracking.createStateButton);
|
||||
await page.waitForURL('tracking/edit');
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('tracking/edit');
|
||||
|
||||
expect(url.hash).toContain('tracking/edit');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => {
|
||||
await page.waitFor(1500);
|
||||
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'Encajado');
|
||||
await page.autocompleteSearch(selectors.createStateView.state, 'Encajado');
|
||||
await page.waitToClick(selectors.createStateView.saveStateButton);
|
||||
let result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -68,9 +66,9 @@ describe('Ticket Create new tracking state path', () => {
|
|||
});
|
||||
|
||||
it(`should make sure the worker gets autocomplete uppon selecting the assigned state`, async() => {
|
||||
await page.autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado');
|
||||
await page.autocompleteSearch(selectors.createStateView.state, 'asignado');
|
||||
let result = await page
|
||||
.waitToGetProperty(`${selectors.createStateView.workerAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.createStateView.worker, 'value');
|
||||
|
||||
expect(result).toEqual('salesPersonNick');
|
||||
});
|
|
@ -18,10 +18,10 @@ describe('Ticket Edit basic data path', () => {
|
|||
});
|
||||
|
||||
it(`should confirm the zone autocomplete is disabled unless your role is productionBoss`, async() => {
|
||||
await page.waitForSelector(selectors.ticketBasicData.zoneAutocomplete, {});
|
||||
await page.waitForSelector(selectors.ticketBasicData.zone, {});
|
||||
const disabled = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.ticketBasicData.zoneAutocomplete} input`);
|
||||
}, `${selectors.ticketBasicData.zone} input`);
|
||||
|
||||
expect(disabled).toBeTruthy();
|
||||
});
|
||||
|
@ -34,43 +34,43 @@ describe('Ticket Edit basic data path', () => {
|
|||
|
||||
it(`should confirm the zone autocomplete is enabled for the role productionBoss`, async() => {
|
||||
await page.waitForSpinnerLoad();
|
||||
await page.wait(selectors.ticketBasicData.zoneAutocomplete);
|
||||
await page.wait(selectors.ticketBasicData.zone);
|
||||
const disabled = await page.evaluate(selector => {
|
||||
return document.querySelector(selector).disabled;
|
||||
}, `${selectors.ticketBasicData.zoneAutocomplete} input`);
|
||||
}, `${selectors.ticketBasicData.zone} input`);
|
||||
|
||||
expect(disabled).toBeFalsy();
|
||||
});
|
||||
|
||||
it(`should check the zone is for Silla247`, async() => {
|
||||
let zone = await page
|
||||
.waitToGetProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketBasicData.zone, 'value');
|
||||
|
||||
expect(zone).toContain('Zone 247 A');
|
||||
});
|
||||
|
||||
it(`should edit the ticket agency then check there are no zones for it`, async() => {
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Entanglement');
|
||||
let zone = await page
|
||||
.getProperty(`${selectors.ticketBasicData.zoneAutocomplete} input`, 'value');
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Entanglement');
|
||||
await page.waitFor(1000);
|
||||
let emptyZone = await page
|
||||
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');
|
||||
|
||||
expect(zone.length).toEqual(0);
|
||||
expect(emptyZone).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should edit the ticket zone then check the agency is for the new zone`, async() => {
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.zoneAutocomplete, 'Zone expensive A');
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.zone, 'Zone expensive A');
|
||||
let zone = await page
|
||||
.waitToGetProperty(`${selectors.ticketBasicData.agencyAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketBasicData.agency, 'value');
|
||||
|
||||
expect(zone).toContain('Silla247Expensive');
|
||||
});
|
||||
|
||||
it(`should click next`, async() => {
|
||||
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
||||
await page.waitForURL('data/step-two');
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('data/step-two');
|
||||
|
||||
expect(url.hash).toContain('data/step-two');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should have a price diference`, async() => {
|
||||
|
@ -80,20 +80,11 @@ describe('Ticket Edit basic data path', () => {
|
|||
expect(result).toContain('-€248.00');
|
||||
});
|
||||
|
||||
it(`should then click next to move on to step three`, async() => {
|
||||
await page.waitToClick(selectors.ticketBasicData.nextStepButton);
|
||||
await page.waitForURL('data/step-three');
|
||||
let url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toContain('data/step-three');
|
||||
});
|
||||
|
||||
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
||||
await page.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket');
|
||||
await page.waitToClick(selectors.ticketBasicData.chargesReason);
|
||||
await page.waitToClick(selectors.ticketBasicData.finalizeButton);
|
||||
await page.waitForURL('summary');
|
||||
let url = await page.parsedUrl();
|
||||
let url = await page.expectURL('summary');
|
||||
|
||||
expect(url.hash).toContain('summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
});
|
|
@ -8,7 +8,7 @@ describe('Ticket descriptor path', () => {
|
|||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('employee', 'ticket');
|
||||
await page.loginAndModule('buyer', 'ticket');
|
||||
await page.accessToSection('ticket.weekly.index');
|
||||
});
|
||||
|
||||
|
@ -26,7 +26,6 @@ describe('Ticket descriptor path', () => {
|
|||
it('should go back to the ticket index then search and access a ticket summary', async() => {
|
||||
await page.accessToSection('ticket.index');
|
||||
await page.accessToSearchResult('11');
|
||||
await page.waitForContentLoaded();
|
||||
});
|
||||
|
||||
it('should add the ticket to thursday turn using the descriptor more menu', async() => {
|
||||
|
@ -42,16 +41,14 @@ describe('Ticket descriptor path', () => {
|
|||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForContentLoaded();
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
const url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should confirm the ticket 11 was added to thursday', async() => {
|
||||
await page.accessToSection('ticket.weekly.index');
|
||||
const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
|
||||
|
||||
expect(result).toEqual('Thursday');
|
||||
});
|
||||
|
@ -60,16 +57,13 @@ describe('Ticket descriptor path', () => {
|
|||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.waitForURL('#!/ticket/index');
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
const url = await page.parsedUrl();
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should now search for the ticket 11', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '11');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '11');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -79,14 +73,12 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
it(`should click on the search result to access to the ticket`, async() => {
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should add the ticket to saturday turn using the descriptor more menu', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenuAddToTurn);
|
||||
await page.waitToClick(selectors.ticketDescriptor.saturdayButton);
|
||||
|
@ -99,21 +91,20 @@ describe('Ticket descriptor path', () => {
|
|||
await page.waitToClick(selectors.globalItems.applicationsMenuButton);
|
||||
await page.wait(selectors.globalItems.applicationsMenuVisible);
|
||||
await page.waitToClick(selectors.globalItems.ticketsButton);
|
||||
await page.wait(selectors.ticketsIndex.searchTicketInput);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should confirm the ticket 11 was added on saturday', async() => {
|
||||
await page.accessToSection('ticket.weekly.index');
|
||||
const result = await page.waitToGetProperty(`${selectors.ticketsIndex.sixthWeeklyTicket} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.ticketsIndex.sixthWeeklyTicket, 'value');
|
||||
|
||||
expect(result).toEqual('Saturday');
|
||||
});
|
||||
|
||||
it('should now search for the weekly ticket 11', async() => {
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '11');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '11');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchWeeklyResult);
|
|
@ -20,9 +20,9 @@ describe('Ticket purchase request path', () => {
|
|||
it(`should add a new request`, async() => {
|
||||
await page.waitToClick(selectors.ticketRequests.addRequestButton);
|
||||
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
|
||||
await page.write(selectors.ticketRequests.quantityInput, '99');
|
||||
await page.autocompleteSearch(selectors.ticketRequests.atenderAutocomplete, 'buyerNick');
|
||||
await page.write(selectors.ticketRequests.priceInput, '999');
|
||||
await page.write(selectors.ticketRequests.quantity, '99');
|
||||
await page.autocompleteSearch(selectors.ticketRequests.atender, 'buyerNick');
|
||||
await page.write(selectors.ticketRequests.price, '999');
|
||||
await page.waitToClick(selectors.ticketRequests.saveButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -30,15 +30,14 @@ describe('Ticket purchase request path', () => {
|
|||
});
|
||||
|
||||
it(`should have been redirected to the request index`, async() => {
|
||||
await page.waitForURL('/request');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/request');
|
||||
|
||||
expect(url.hash).toContain('/request');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should confirm the new request was added`, async() => {
|
||||
await page.reloadSection('ticket.card.request.index');
|
||||
const result = await page.waitToGetProperty(`${selectors.ticketRequests.firstDescription} input`, 'value');
|
||||
const result = await page.waitToGetProperty(selectors.ticketRequests.firstDescription, 'value');
|
||||
|
||||
expect(result).toEqual('New stuff');
|
||||
});
|
|
@ -17,7 +17,7 @@ xdescribe('Ticket diary path', () => {
|
|||
});
|
||||
|
||||
it('should search for a specific ticket', async() => {
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '1');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '1');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -28,20 +28,18 @@ xdescribe('Ticket diary path', () => {
|
|||
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => {
|
||||
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
|
||||
await page.waitForTransitionEnd('.vn-popover');
|
||||
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
|
||||
await page.waitForURL('/diary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/diary');
|
||||
|
||||
expect(url.hash).toContain('/diary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should check the second line id is marked as message`, async() => {
|
||||
|
@ -59,7 +57,7 @@ xdescribe('Ticket diary path', () => {
|
|||
});
|
||||
|
||||
it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => {
|
||||
await page.autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two');
|
||||
await page.autocompleteSearch(selectors.itemDiary.warehouse, 'Warehouse Two');
|
||||
const result = await page
|
||||
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
|
||||
|
|
@ -17,7 +17,7 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
describe('Delete ticket', () => {
|
||||
it('should search for an specific ticket', async() => {
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '18');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '18');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -28,17 +28,15 @@ describe('Ticket descriptor path', () => {
|
|||
it(`should click on the search result to access to the ticket summary`, async() => {
|
||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Cerebro');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should update the shipped hour using the descriptor menu`, async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour);
|
||||
await page.pickTime(selectors.ticketDescriptor.changeShippedHourInput, '08:15');
|
||||
await page.pickTime(selectors.ticketDescriptor.changeShippedHour, '08:15');
|
||||
await page.waitToClick(selectors.ticketDescriptor.acceptChangeHourButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -62,13 +60,13 @@ describe('Ticket descriptor path', () => {
|
|||
});
|
||||
|
||||
it('should have been relocated to the ticket index', async() => {
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/index');
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/index');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should search for the deleted ticket and check it's date`, async() => {
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '18');
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '18');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
await page.wait(selectors.ticketsIndex.searchResultDate);
|
||||
|
@ -80,8 +78,8 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
describe('add stowaway', () => {
|
||||
it('should search for a ticket', async() => {
|
||||
await page.clearInput(selectors.ticketsIndex.searchTicketInput);
|
||||
await page.write(selectors.ticketsIndex.searchTicketInput, '16');
|
||||
await page.clearInput(selectors.ticketsIndex.topbarSearch);
|
||||
await page.write(selectors.ticketsIndex.topbarSearch, '16');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
|
||||
const result = await page.countElement(selectors.ticketsIndex.searchResult);
|
||||
|
@ -92,10 +90,9 @@ describe('Ticket descriptor path', () => {
|
|||
it(`should now click on the search result to access to the ticket summary`, async() => {
|
||||
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Many Places');
|
||||
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should open the add stowaway dialog', async() => {
|
||||
|
@ -126,14 +123,12 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
|
||||
await page.waitToClick(selectors.ticketDescriptor.shipButton);
|
||||
await page.waitForURL('#!/ticket/17/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/17/summary');
|
||||
|
||||
expect(url.hash).toContain('#!/ticket/17/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should delete the stowaway', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteStowawayButton);
|
||||
await page.waitToClick(selectors.ticketDescriptor.acceptDeleteStowawayButton);
|
||||
|
@ -153,10 +148,9 @@ describe('Ticket descriptor path', () => {
|
|||
|
||||
await page.loginAndModule('adminBoss', 'ticket');
|
||||
await page.accessToSearchResult(invoiceableTicketId);
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL(`ticket/${invoiceableTicketId}/summary`);
|
||||
|
||||
expect(url.hash).toContain(`ticket/${invoiceableTicketId}/summary`);
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it(`should make sure the ticket doesn't have an invoiceOutFk yet`, async() => {
|
|
@ -26,11 +26,11 @@ describe('Ticket services path', () => {
|
|||
const result = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
}, 15000);
|
||||
});
|
||||
|
||||
it('should receive an error if you attempt to save a service without access rights', async() => {
|
||||
await page.clearInput(selectors.ticketService.firstPriceInput);
|
||||
await page.write(selectors.ticketService.firstPriceInput, '999');
|
||||
await page.clearInput(selectors.ticketService.firstPrice);
|
||||
await page.write(selectors.ticketService.firstPrice, '999');
|
||||
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -44,17 +44,15 @@ describe('Ticket services path', () => {
|
|||
await page.loginAndModule('administrative', 'ticket');
|
||||
await page.accessToSearchResult(editableTicketId);
|
||||
await page.accessToSection('ticket.card.service');
|
||||
await page.waitForURL('/service');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/service');
|
||||
|
||||
expect(url.hash).toContain('/service');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should click on the add button to prepare the form to create a new service', async() => {
|
||||
await page.waitForContentLoaded();
|
||||
await page.waitToClick(selectors.ticketService.addServiceButton);
|
||||
const result = await page
|
||||
.isVisible(selectors.ticketService.firstServiceTypeAutocomplete);
|
||||
.isVisible(selectors.ticketService.firstServiceType);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
@ -69,7 +67,7 @@ describe('Ticket services path', () => {
|
|||
it('should click on the add new service type to open the dialog', async() => {
|
||||
await page.waitToClick(selectors.ticketService.firstAddServiceTypeButton);
|
||||
await page.wait('.vn-dialog.shown');
|
||||
const result = await page.isVisible(selectors.ticketService.newServiceTypeNameInput);
|
||||
const result = await page.isVisible(selectors.ticketService.newServiceTypeName);
|
||||
|
||||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
@ -82,10 +80,11 @@ describe('Ticket services path', () => {
|
|||
});
|
||||
|
||||
it('should create a new service type then add price then create the service', async() => {
|
||||
await page.write(selectors.ticketService.newServiceTypeNameInput, 'Documentos');
|
||||
await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpenseAutocomplete, 'Retencion');
|
||||
await page.write(selectors.ticketService.newServiceTypeName, 'Documentos');
|
||||
await page.autocompleteSearch(selectors.ticketService.newServiceTypeExpense, 'Retencion');
|
||||
await page.waitToClick(selectors.ticketService.saveServiceTypeButton);
|
||||
await page.write(selectors.ticketService.firstPriceInput, '999');
|
||||
await page.write(selectors.ticketService.firstPrice, '999');
|
||||
await page.waitFor(1000); // time needed for the button to be clickable
|
||||
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -95,28 +94,28 @@ describe('Ticket services path', () => {
|
|||
it('should confirm the service description was created correctly', async() => {
|
||||
await page.reloadSection('ticket.card.service');
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.ticketService.firstServiceTypeAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketService.firstServiceType, 'value');
|
||||
|
||||
expect(result).toEqual('Documentos');
|
||||
});
|
||||
|
||||
it('should confirm the service quantity was created correctly', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.ticketService.firstQuantityInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketService.firstQuantity, 'value');
|
||||
|
||||
expect(result).toEqual('1');
|
||||
});
|
||||
|
||||
it('should confirm the service price was created correctly', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.ticketService.firstPriceInput} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketService.firstPrice, 'value');
|
||||
|
||||
expect(result).toEqual('999');
|
||||
});
|
||||
|
||||
it('should confirm the service VAT was created correctly', async() => {
|
||||
const result = await page
|
||||
.waitToGetProperty(`${selectors.ticketService.firstVatTypeAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.ticketService.firstVatType, 'value');
|
||||
|
||||
expect(result).toEqual('General VAT');
|
||||
});
|
||||
|
@ -124,6 +123,7 @@ describe('Ticket services path', () => {
|
|||
it('should delete the service', async() => {
|
||||
await page.waitToClick(selectors.ticketService.fistDeleteServiceButton);
|
||||
await page.waitForNumberOfElements(selectors.ticketService.serviceLine, 0);
|
||||
await page.waitFor(1000); // without this wait it fails to click the save button
|
||||
await page.waitToClick(selectors.ticketService.saveServiceButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
|
@ -17,18 +17,17 @@ describe('Ticket create path', () => {
|
|||
|
||||
it('should open the new ticket form', async() => {
|
||||
await page.waitToClick(selectors.ticketsIndex.newTicketButton);
|
||||
await page.wait(selectors.createTicketView.clientAutocomplete);
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('#!/ticket/create');
|
||||
|
||||
expect(url.hash).toEqual('#!/ticket/create');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should succeed to create a ticket', async() => {
|
||||
await page.autocompleteSearch(selectors.createTicketView.clientAutocomplete, 'Tony Stark');
|
||||
await page.autocompleteSearch(selectors.createTicketView.addressAutocomplete, 'Tony Stark');
|
||||
await page.datePicker(selectors.createTicketView.deliveryDateInput, 1, null);
|
||||
await page.autocompleteSearch(selectors.createTicketView.warehouseAutocomplete, 'Warehouse One');
|
||||
await page.autocompleteSearch(selectors.createTicketView.agencyAutocomplete, 'Silla247');
|
||||
await page.autocompleteSearch(selectors.createTicketView.client, 'Tony Stark');
|
||||
await page.autocompleteSearch(selectors.createTicketView.address, 'Tony Stark');
|
||||
await page.datePicker(selectors.createTicketView.deliveryDate, 1, null);
|
||||
await page.autocompleteSearch(selectors.createTicketView.warehouse, 'Warehouse One');
|
||||
await page.autocompleteSearch(selectors.createTicketView.agency, 'Silla247');
|
||||
await page.waitToClick(selectors.createTicketView.createButton);
|
||||
const result = await page.waitForLastSnackbar();
|
||||
|
||||
|
@ -36,9 +35,8 @@ describe('Ticket create path', () => {
|
|||
});
|
||||
|
||||
it('should check the url is now the summary of the ticket', async() => {
|
||||
await page.waitForURL('/summary');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('/summary');
|
||||
|
||||
expect(url.hash).toContain('/summary');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
});
|
|
@ -19,18 +19,17 @@ describe('Ticket create from client path', () => {
|
|||
it('should click the create simple ticket on the descriptor menu', async() => {
|
||||
await page.waitToClick(selectors.clientDescriptor.moreMenu);
|
||||
await page.waitToClick(selectors.clientDescriptor.simpleTicketButton);
|
||||
await page.waitForURL('#!/ticket/create?clientFk=102');
|
||||
const url = await page.parsedUrl();
|
||||
let url = await page.expectURL('clientFk=102');
|
||||
|
||||
expect(url.hash).toContain('clientFk=102');
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should check if the client details are the expected ones', async() => {
|
||||
const client = await page
|
||||
.waitToGetProperty(`${selectors.createTicketView.clientAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.createTicketView.client, 'value');
|
||||
|
||||
const address = await page
|
||||
.waitToGetProperty(`${selectors.createTicketView.addressAutocomplete} input`, 'value');
|
||||
.waitToGetProperty(selectors.createTicketView.address, 'value');
|
||||
|
||||
|
||||
expect(client).toContain('Petter Parker');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue