fix: refs #6889 e2e tests
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2024-05-31 12:51:06 +02:00
parent 38bea60776
commit 4772509b67
4 changed files with 35 additions and 24 deletions

View File

@ -1259,7 +1259,8 @@ INSERT INTO `vn`.`collection`(`id`, `workerFk`, `stateFk`, `created`, `trainFk`)
(1, 1106, 5, DATE_ADD(util.VN_CURDATE(),INTERVAL +1 DAY), 1),
(2, 1106, 14, util.VN_CURDATE(), 1),
(4, 49, 5, util.VN_CURDATE(), 1),
(5, 18, 5, util.VN_CURDATE(), 1);
(5, 18, 5, util.VN_CURDATE(), 1),
(6, 18, 5, util.VN_CURDATE(), 1);
INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`)
VALUES
@ -1268,7 +1269,8 @@ INSERT INTO `vn`.`ticketCollection`(`ticketFk`, `collectionFk`, `level`)
(3, 2, NULL),
(23, 1, NULL),
(34, 4, 1),
(35, 5, 1);
(35, 5, 1),
(8, 6, 1);
INSERT INTO `vn`.`genus`(`id`, `name`)
VALUES

View File

@ -1,6 +1,6 @@
use account;
INSERT INTO account.role
INSERT INTO role
SET name = 'reviewer',
description = 'Revisor de producción',
hasLogin = TRUE,
@ -8,29 +8,29 @@ INSERT INTO account.role
modified = util.VN_CURDATE(),
editorFk = NULL;
INSERT IGNORE INTO account.roleInherit(
INSERT INTO roleInherit(
role,
inheritsFrom
)
SELECT r1.id,
r2.id
FROM account.role r1
JOIN account.role r2
WHERE r2.name = 'production'
AND r1.name = 'reviewer'
FROM role r1
JOIN role r2
WHERE r1.name = 'reviewer'
AND r2.name = 'production'
UNION
SELECT ri.role,
r2.id
FROM account.roleInherit ri
JOIN account.role r1 ON r1.id = ri.role
JOIN account.role r2 ON r2.name = 'reviewer'
FROM roleInherit ri
JOIN role r1 ON r1.id = ri.role
JOIN role r2 ON r2.name = 'reviewer'
WHERE r1.name IN ('claimManager', 'productionBoss')
GROUP BY ri.role;
DELETE ri
FROM account.roleInherit ri
JOIN account.role r1 ON ri.role = r1.id
JOIN account.role r2 ON ri.inheritsFrom = r2.id
FROM roleInherit ri
JOIN role r1 ON ri.role = r1.id
JOIN role r2 ON ri.inheritsFrom = r2.id
WHERE r1.name = 'replenisher'
AND r2.name = 'buyer';
@ -38,9 +38,9 @@ UPDATE salix.ACL
SET principalId = 'reviewer'
WHERE property = 'isInPreparing';
UPDATE account.user u
UPDATE user u
JOIN vn.workerDepartment wd ON wd.workerFk = u.id
JOIN vn.department d ON wd.departmentFk = d.id
JOIN account.role r ON r.name = 'reviewer'
JOIN role r ON r.name = 'reviewer'
SET u.role = r.id
WHERE d.name IN ('REVISION', 'PREVIA');

View File

@ -225,7 +225,7 @@ describe('Ticket Edit sale path', () => {
});
it('should show error trying to delete a ticket with a refund', async() => {
await page.loginAndModule('production', 'ticket');
await page.loginAndModule('salesPerson', 'ticket');
await page.accessToSearchResult('8');
await page.waitToClick(selectors.ticketDescriptor.moreMenu);
await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket);

View File

@ -5,7 +5,6 @@ require('regenerator-runtime/runtime');
require('vn-loopback/server/boot/date')();
const getopts = require('getopts');
const fs = require('fs');
const path = require('path');
const Myt = require('@verdnatura/myt/myt');
const Run = require('@verdnatura/myt/myt-run');
@ -36,12 +35,22 @@ async function test() {
const Jasmine = require('jasmine');
const jasmine = new Jasmine();
const e2ePath = './e2e/paths';
const file = '*[sS]pec.js';
const specFiles = fs.readdirSync(e2ePath)
.sort()
.map(folder => `${e2ePath}/${folder}/${file}`)
.concat(`${e2ePath}/**/${file}`);
const specFiles = [
`./e2e/paths/01*/*[sS]pec.js`,
`./e2e/paths/02*/*[sS]pec.js`,
`./e2e/paths/03*/*[sS]pec.js`,
`./e2e/paths/04*/*[sS]pec.js`,
`./e2e/paths/05*/*[sS]pec.js`,
`./e2e/paths/06*/*[sS]pec.js`,
`./e2e/paths/07*/*[sS]pec.js`,
`./e2e/paths/08*/*[sS]pec.js`,
`./e2e/paths/09*/*[sS]pec.js`,
`./e2e/paths/10*/*[sS]pec.js`,
`./e2e/paths/11*/*[sS]pec.js`,
`./e2e/paths/12*/*[sS]pec.js`,
`./e2e/paths/13*/*[sS]pec.js`,
`./e2e/paths/**/*[sS]pec.js`
];
jasmine.loadConfig({
spec_dir: '.',