fix back test and e2e that now fail
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2022-06-27 11:17:45 +02:00
parent 9acd98e7b7
commit a98a927663
9 changed files with 70 additions and 122 deletions

View File

@ -122,17 +122,17 @@ INSERT INTO `vn`.`currency`(`id`, `code`, `name`, `ratio`)
(3, 'GBP', 'Libra', 1),
(4, 'JPY', 'Yen Japones', 1);
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`)
INSERT INTO `vn`.`country`(`id`, `country`, `isUeeMember`, `code`, `currencyFk`, `politicalCountryFk`, `ibanLength`, `continentFk`, `hasDailyInvoice`, `CEE`)
VALUES
(1, 'España', 1, 'ES', 1, 24, 4, 0, 1),
(2, 'Italia', 1, 'IT', 1, 27, 4, 0, 1),
(3, 'Alemania', 1, 'DE', 1, 22, 4, 0, 1),
(4, 'Rumania', 1, 'RO', 1, 24, 4, 0, 1),
(5, 'Holanda', 1, 'NL', 1, 18, 4, 0, 1),
(8, 'Portugal', 1, 'PT', 1, 27, 4, 0, 1),
(13,'Ecuador', 0, 'EC', 1, 24, 2, 1, 2),
(19,'Francia', 1, 'FR', 1, 27, 4, 0, 1),
(30,'Canarias', 1, 'IC', 1, 24, 4, 1, 2);
(1, 'España', 1, 'ES', 1, 1, 24, 4, 0, 1),
(2, 'Italia', 1, 'IT', 1, 2, 27, 4, 0, 1),
(3, 'Alemania', 1, 'DE', 1, 3, 22, 4, 0, 1),
(4, 'Rumania', 1, 'RO', 1, 4, 24, 4, 0, 1),
(5, 'Holanda', 1, 'NL', 1, 5, 18, 4, 0, 1),
(8, 'Portugal', 1, 'PT', 1, 8, 27, 4, 0, 1),
(13,'Ecuador', 0, 'EC', 1, 13, 24, 2, 1, 2),
(19,'Francia', 1, 'FR', 1, 19, 27, 4, 0, 1),
(30,'Canarias', 1, 'IC', 1, 1, 24, 4, 1, 2);
INSERT INTO `vn`.`warehouseAlias`(`id`, `name`)
VALUES
@ -148,10 +148,10 @@ INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 0, 2, 1, 1),
(13, 'Inventory', NULL, 1, 1, 1, 0, 0, 0, 0, 2, 1, 0);
INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPreparedByPacking`, `code`, `pickingPlacement`, `path`)
INSERT INTO `vn`.`sector`(`id`, `description`, `warehouseFk`, `isPreviousPreparedByPacking`, `code`)
VALUES
(1, 'First sector', 1, 1, 'FIRST', 999, 999),
(2, 'Second sector', 2, 0, 'SECOND', 100, 150);
(1, 'First sector', 1, 1, 'FIRST'),
(2, 'Second sector', 2, 0, 'SECOND');
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
VALUES
@ -174,15 +174,19 @@ INSERT INTO `vn`.`accountingType`(`id`, `description`, `receiptDescription`,`cod
(6, 'Loans', NULL, NULL, NULL, 0),
(7, 'Leasing', NULL, NULL, NULL, 0),
(8, 'Compensations', 'Compensations', 'compensation', NULL, 0);
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`)
VALUES
(1, 'Pay on receipt', '5720000001', 3, 0, 1, 1),
(2, 'Cash', '5700000001', 2, 0, 1, 1),
(3, 'Compensation', '4000000000', 8, 0, 1, 1),
(4, 'Transfers', '4000000001', 1, 0, 1, 1),
(3117, 'Caixa Rural d''Algemesi', '5720000000', 8, 3117, 1, 1);
INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`)
VALUES
(128, 1, 'The Best Bank', 'BBKKESMMMMMM'),
(2100, 1, 'Caixa Bank', 'CAIXESBB');
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`, `currencyFk`)
VALUES
(1, 'Pay on receipt', '5720000001', 3, 128, 1, 1),
(2, 'Cash', '5700000001', 2, 128, 1, 1),
(3, 'Compensation', '4000000000', 8, 128, 1, 1),
(4, 'Transfers', '4000000001', 1, 128, 1, 1),
(3117, 'Caixa Rural d''Algemesi', '5720000000', 8, 2100, 1, 1);
INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
VALUES
@ -191,18 +195,18 @@ INSERT INTO `vn`.`deliveryMethod`(`id`, `code`, `description`)
(3, 'PICKUP', 'Recogida'),
(4, 'OTHER', 'Otros');
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, `warehouseAliasFk`)
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `bankFk__`, `warehouseAliasFk`)
VALUES
(1, 'inhouse pickup' , 1, 0, 1, 1),
(2, 'Super-Man delivery' , 1, 0, 1, 1),
(3, 'Teleportation device' , 1, 0, 1, 1),
(4, 'Entanglement' , 1, 0, 1, 1),
(5, 'Quantum break device' , 1, 0, 1, 1),
(6, 'Walking' , 1, 0, 1, 1),
(7, 'Gotham247' , 1, 0, 1, 1),
(8, 'Gotham247Expensive' , 1, 0, 1, 1),
(9, 'Refund' , 1, 0, 1, 1),
(10, 'Other agency' , 1, 0, 1, 1);
(1, 'inhouse pickup' , 1, 1, 1),
(2, 'Super-Man delivery' , 1, 1, 1),
(3, 'Teleportation device' , 1, 1, 1),
(4, 'Entanglement' , 1, 1, 1),
(5, 'Quantum break device' , 1, 1, 1),
(6, 'Walking' , 1, 1, 1),
(7, 'Gotham247' , 1, 1, 1),
(8, 'Gotham247Expensive' , 1, 1, 1),
(9, 'Refund' , 1, 1, 1),
(10, 'Other agency' , 1, 1, 1);
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
@ -470,11 +474,19 @@ INSERT INTO `vn`.`companyGroup`(`id`, `code`)
VALUES
(1, 'wayneIndustries'),
(2, 'verdnatura');
INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`)
INSERT INTO `vn`.`supplierActivity`(`code`, `name`)
VALUES
(128, 1, 'The Best Bank', 'BBKKESMMMMMM'),
(2100, 1, 'Caixa Bank', 'CAIXESBB');
('animals', 'Food and complements for pets'),
('complements', 'Other complements'),
('flowerPlants', 'Wholesale of flowers and plants'),
('vegetablesFruits', 'Fruit and vegetable trade');
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
VALUES
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierAccount`(`id`, `supplierFk`, `iban`, `bankEntityFk`)
VALUES
@ -875,18 +887,18 @@ INSERT INTO `vn`.`expeditionStateType`(`id`, `description`, `code`)
(3, 'Perdida', 'LOST');
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `checked`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`)
INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `created`, `itemFk`, `counter`, `workerFk`, `externalId`, `packagingFk`, `stateTypeFk`)
VALUES
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 1, 18, 'UR9000006041', 94, 1),
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 1, 18, 'UR9000006041', 94, 1),
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 3, 1, 18, 'UR9000006041', 94, 2),
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 4, 1, 18, 'UR9000006041', 94, 2),
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 3),
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 1, 1, 18, NULL, 94, 3),
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, 1, 1, 18, NULL, 94, NULL),
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, 1, 1, 18, NULL, 94, 1),
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 1, 18, NULL, 94, 2),
(10, 7, 7, 71, NOW(), NULL, 1, 1, 18, NULL, 94, 3);
(1, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 15, 1, 18, 'UR9000006041', 94, 1),
(2, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 16, 2, 18, 'UR9000006041', 94, 1),
(3, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 3, 18, 'UR9000006041', 94, 2),
(4, 1, 1, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 4, 18, 'UR9000006041', 94, 2),
(5, 1, 2, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 18, NULL, 94, 3),
(6, 7, 3, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL, 1, 18, NULL, 94, 3),
(7, 2, 4, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL, 1, 18, NULL, 94, NULL),
(8, 3, 5, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL, 1, 18, NULL, 94, 1),
(9, 3, 6, 71, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL, 1, 18, NULL, 94, 2),
(10, 7, 7, 71, NOW(), NULL, 1, 18, NULL, 94, 3);
INSERT INTO `vn`.`expeditionState`(`id`, `created`, `expeditionFk`, `typeFk`, `userFk`)
@ -1111,13 +1123,6 @@ INSERT INTO `vn`.`itemBarcode`(`id`, `itemFk`, `code`)
(2, 1, 2222222222),
(3, 1, 3333333333),
(4, 2, 4444444444);
INSERT INTO `vn`.`itemPlacement`(`id`, `itemFk`, `warehouseFk`, `code`)
VALUES
(1, 1, 1, 'A11'),
(2, 1, 2, 'A22'),
(3, 1, 3, 'A33'),
(4, 2, 1, 'A44');
INSERT INTO `vn`.`train`(`id`, `name`)
VALUES
@ -1309,13 +1314,6 @@ INSERT INTO `vn`.`annualAverageInvoiced`(`clientFk`, `invoiced`)
(1104, 500),
(1105, 5000);
INSERT INTO `vn`.`supplierActivity`(`code`, `name`)
VALUES
('animals', 'Food and complements for pets'),
('complements', 'Other complements'),
('flowerPlants', 'Wholesale of flowers and plants'),
('vegetablesFruits', 'Fruit and vegetable trade');
INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `provinceFk`, `postalCode`, `city`, `phone`, `mobile`)
VALUES
(1, 1, 'Ace Chemicals', 'The Midtown', 1, '46000', 'Gotham', '111111111', '222222222'),
@ -1325,12 +1323,6 @@ INSERT INTO `vn`.`supplierAddress`(`id`, `supplierFk`, `nickname`, `street`, `pr
(5, 442, 'GCR building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222'),
(6, 442, 'The Gotham Tonight building', 'Bristol district', 1, '46000', 'Gotham', '111111111', '222222222');
INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`, `commission`, `created`, `isActive`, `street`, `city`, `provinceFk`, `postCode`, `payMethodFk`, `payDemFk`, `payDay`, `taxTypeSageFk`, `withholdingSageFk`, `transactionTypeSageFk`, `workerFk`, `supplierActivityFk`, `isPayMethodChecked`, `healthRegister`)
VALUES
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
(442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
VALUES
(1, 1, 123121212, 654789123, 'supplier1@email.es', 'observation1', 'the boss'),
@ -1921,11 +1913,6 @@ INSERT INTO `postgresql`.`profile_media`(`profile_media_id`, `profile_id`, `medi
(1, 1106, 1),
(2, 1107, 2);
INSERT INTO `vn`.`workCenter` (`id`, `name`, `warehouseFk`)
VALUES
('1', 'Gotham', '1'),
('5', 'Madrid', '5');
INSERT INTO `vn`.`workCenterHoliday` (`workCenterFk`, `days`, `year`)
VALUES
('1', '27.5', YEAR(util.VN_CURDATE())),
@ -1933,7 +1920,7 @@ INSERT INTO `vn`.`workCenterHoliday` (`workCenterFk`, `days`, `year`)
('1', '24.5', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR))),
('5', '23', YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR)));
INSERT INTO `postgresql`.`calendar_state` (`calendar_state_id`, `type`, `rgb`, `code`, `holidayEntitlementRate`, `discountRate`)
INSERT INTO `vn`.`absenceType` (`id`, `name`, `rgb`, `code`, `holidayEntitlementRate`, `discountRate`)
VALUES
(1, 'Holidays', '#FF4444', 'holiday', 0, 0),
(2, 'Leave of absence', '#C71585', 'absence', 0, 1),

View File

@ -501,7 +501,7 @@ export default {
},
itemLog: {
anyLineCreated: 'vn-item-log > vn-log vn-tbody > vn-tr',
fifthLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(5) > vn-td > vn-one:nth-child(3) > div span:nth-child(2)',
thirdLineCreatedProperty: 'vn-item-log > vn-log vn-tbody > vn-tr:nth-child(3) > vn-td > vn-one:nth-child(3) > div span:nth-child(2)',
},
ticketSummary: {
header: 'vn-ticket-summary > vn-card > h5',
@ -598,7 +598,7 @@ export default {
submitNotesButton: 'button[type=submit]'
},
ticketExpedition: {
secondExpeditionRemoveButton: 'vn-ticket-expedition vn-table div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button[icon="delete"]',
thirdExpeditionRemoveButton: 'vn-ticket-expedition vn-table div > vn-tbody > vn-tr:nth-child(3) > vn-td:nth-child(1) > vn-icon-button[icon="delete"]',
expeditionRow: 'vn-ticket-expedition vn-table vn-tbody > vn-tr'
},
ticketPackages: {

View File

@ -38,7 +38,7 @@ describe('Item Create', () => {
it('should create the Infinity Gauntlet item', async() => {
await page.write(selectors.itemCreateView.temporalName, 'Infinity Gauntlet');
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.type, 'Paniculata');
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton);
@ -56,7 +56,7 @@ describe('Item Create', () => {
result = await page
.waitToGetProperty(selectors.itemBasicData.type, 'value');
expect(result).toEqual('Crisantemo');
expect(result).toEqual('Paniculata');
result = await page
.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');

View File

@ -28,7 +28,7 @@ describe('Item log path', () => {
it('should create the Knowledge artifact item', async() => {
await page.write(selectors.itemCreateView.temporalName, 'Knowledge artifact');
await page.autocompleteSearch(selectors.itemCreateView.type, 'Crisantemo');
await page.autocompleteSearch(selectors.itemCreateView.type, 'Paniculata');
await page.autocompleteSearch(selectors.itemCreateView.intrastat, 'Coral y materiales similares');
await page.autocompleteSearch(selectors.itemCreateView.origin, 'Holand');
await page.waitToClick(selectors.itemCreateView.createButton);
@ -52,12 +52,12 @@ describe('Item log path', () => {
await page.waitForSelector(selectors.itemLog.anyLineCreated);
const anyLineCreatedCount = await page.countElement(selectors.itemLog.anyLineCreated);
expect(anyLineCreatedCount).toEqual(5);
expect(anyLineCreatedCount).toEqual(3);
});
it(`should confirm the log is showing the intrastat for the created item`, async() => {
const fifthLineCreatedProperty = await page
.waitToGetProperty(selectors.itemLog.fifthLineCreatedProperty, 'innerText');
.waitToGetProperty(selectors.itemLog.thirdLineCreatedProperty, 'innerText');
expect(fifthLineCreatedProperty).toEqual('Coral y materiales similares');
});

View File

@ -18,7 +18,7 @@ describe('Ticket expeditions and log path', () => {
});
it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => {
await page.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton);
await page.waitToClick(selectors.ticketExpedition.thirdExpeditionRemoveButton);
await page.waitToClick(selectors.globalItems.acceptButton);
await page.reloadSection('ticket.card.expedition');

View File

@ -9,7 +9,7 @@ describe('Route summary path', () => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'route');
await page.waitToClick('vn-route-index vn-tbody > a:nth-child(1)');
await page.waitToClick('vn-route-index vn-tbody > a:nth-child(7)');
});
afterAll(async() => {

View File

@ -32,9 +32,6 @@
"ItemPackingType": {
"dataSource": "vn"
},
"ItemPlacement": {
"dataSource": "vn"
},
"ItemTag": {
"dataSource": "vn"
},

View File

@ -1,36 +0,0 @@
{
"name": "ItemPlacement",
"base": "VnModel",
"options": {
"mysql": {
"table": "itemPlacement"
}
},
"properties": {
"id": {
"type": "number",
"id": true
},
"code": {
"type": "string"
},
"itemFk": {
"type": "number"
},
"warehouseFk": {
"type": "number"
}
},
"relations": {
"item": {
"type": "belongsTo",
"model": "Item",
"foreignKey": "itemFk"
},
"warehouse": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
}
}
}

View File

@ -8,7 +8,7 @@ describe('department removeChild()', () => {
});
it('should remove a child department', async() => {
const childId = 1;
const childId = 130;
removedChild = await app.models.Department.findById(childId);
const result = await app.models.Department.removeChild(childId);