+
-import VnCardBeta from 'src/components/common/VnCardBeta.vue';
+import VnCard from 'src/components/common/VnCard.vue';
import ZoneDescriptor from './ZoneDescriptor.vue';
-
+
diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js
index 4a322d305..798c671eb 100644
--- a/src/router/modules/wagon.js
+++ b/src/router/modules/wagon.js
@@ -1,52 +1,60 @@
import { RouterView } from 'vue-router';
+const wagonCard = {
+ name: 'WagonCard',
+ path: ':id',
+ component: () => import('src/pages/Wagon/Card/WagonCard.vue'),
+ redirect: { name: 'WagonEdit' },
+ meta: {
+ menu: ['WagonEdit'],
+ },
+ children: [
+ {
+ path: 'edit',
+ name: 'WagonEdit',
+ meta: {
+ title: 'wagonEdit',
+ icon: 'edit',
+ },
+ component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ },
+ ],
+};
+
export default {
- path: '/wagon',
name: 'Wagon',
+ path: '/wagon',
meta: {
title: 'wagons',
icon: 'vn:trolley',
moduleName: 'Wagon',
+ menu: ['WagonList', 'WagonTypeList', 'WagonCounter'],
},
component: RouterView,
redirect: { name: 'WagonMain' },
- menus: {
- main: ['WagonList', 'WagonTypeList', 'WagonCounter', 'WagonTray'],
- card: [],
- },
children: [
{
- path: '/wagon',
+ path: '',
name: 'WagonMain',
component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonList' },
+ redirect: { name: 'WagonIndexMain' },
children: [
{
- path: 'list',
- name: 'WagonList',
- meta: {
- title: 'list',
- icon: 'vn:trolley',
- },
+ path: '',
+ name: 'WagonIndexMain',
+ redirect: { name: 'WagonList' },
component: () => import('src/pages/Wagon/WagonList.vue'),
- },
- {
- path: 'create',
- name: 'WagonCreate',
- meta: {
- title: 'wagonCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonEdit',
- meta: {
- title: 'wagonEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/WagonCreate.vue'),
+ children: [
+ {
+ name: 'WagonList',
+ path: 'list',
+ meta: {
+ title: 'list',
+ icon: 'view_list',
+ },
+ },
+ wagonCard,
+ ],
},
{
path: 'counter',
@@ -57,40 +65,32 @@ export default {
},
component: () => import('src/pages/Wagon/WagonCounter.vue'),
},
- ],
- },
- {
- path: '/wagon/type',
- name: 'WagonTypeMain',
- component: () => import('src/components/common/VnModule.vue'),
- redirect: { name: 'WagonTypeList' },
- children: [
{
- path: 'list',
- name: 'WagonTypeList',
- meta: {
- title: 'typesList',
- icon: 'view_list',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: 'create',
- name: 'WagonTypeCreate',
- meta: {
- title: 'typeCreate',
- icon: 'create',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeList.vue'),
- },
- {
- path: ':id/edit',
- name: 'WagonTypeEdit',
- meta: {
- title: 'typeEdit',
- icon: 'edit',
- },
- component: () => import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ path: 'type',
+ name: 'WagonTypeMain',
+ redirect: { name: 'WagonTypeList' },
+ children: [
+ {
+ path: 'list',
+ name: 'WagonTypeList',
+ meta: {
+ title: 'typesList',
+ icon: 'view_list',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeList.vue'),
+ },
+ {
+ path: ':id/edit',
+ name: 'WagonTypeEdit',
+ meta: {
+ title: 'typeEdit',
+ icon: 'edit',
+ },
+ component: () =>
+ import('src/pages/Wagon/Type/WagonTypeEdit.vue'),
+ },
+ ],
},
],
},
diff --git a/test/cypress/integration/client/clientBalance.spec.js b/test/cypress/integration/client/clientBalance.spec.js
index abfa74cec..56ce01692 100644
--- a/test/cypress/integration/client/clientBalance.spec.js
+++ b/test/cypress/integration/client/clientBalance.spec.js
@@ -5,7 +5,10 @@ describe('Client balance', () => {
cy.login('developer');
cy.visit('#/customer/1101/balance');
});
- it('Should load layout', () => {
- cy.get('.q-page').should('be.visible');
+ it('Should create a mandate', () => {
+ cy.get('.q-page-sticky > div > .q-btn').click();
+ cy.selectOption('[data-cy="paymentBank"]', 2);
+ cy.dataCy('paymentAmount_input').type('100');
+ cy.saveCard();
});
});
diff --git a/test/cypress/integration/order/orderList.spec.js b/test/cypress/integration/order/orderList.spec.js
index 8b8852a02..c48b317a8 100644
--- a/test/cypress/integration/order/orderList.spec.js
+++ b/test/cypress/integration/order/orderList.spec.js
@@ -34,8 +34,8 @@ describe('OrderList', () => {
cy.dataCy('Customer ID_input').type('1101{enter}');
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('landedDate').find('input').type('06/01/2001');
- cy.get(agencyCreateSelect).click();
- cy.get('.q-menu > div> .q-item:nth-child(1)').click();
+ cy.selectOption(agencyCreateSelect, 1);
+
cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
cy.wait('@orderSale');
@@ -60,8 +60,8 @@ describe('OrderList', () => {
cy.get(clientCreateSelect).should('have.value', 'Bruce Wayne');
cy.get(addressCreateSelect).should('have.value', 'Bruce Wayne');
cy.dataCy('landedDate').find('input').type('06/01/2001');
- cy.get(agencyCreateSelect).click();
- cy.get('.q-menu > div> .q-item:nth-child(1)').click();
+ cy.selectOption(agencyCreateSelect, 1);
+
cy.intercept('GET', /\/api\/Orders\/\d/).as('orderSale');
cy.get('[data-cy="FormModelPopup_save"] > .q-btn__content > .block').click();
cy.wait('@orderSale');
diff --git a/test/cypress/integration/route/roadMap/roadmapList.spec.js b/test/cypress/integration/route/roadMap/roadmapList.spec.js
index 6d46b2cf6..35c0c2b02 100644
--- a/test/cypress/integration/route/roadMap/roadmapList.spec.js
+++ b/test/cypress/integration/route/roadMap/roadmapList.spec.js
@@ -1,12 +1,74 @@
describe('RoadMap', () => {
+ const getSelector = (colField) =>
+ `tr:last-child > [data-col-field="${colField}"] > .no-padding`;
+
+ const selectors = {
+ roadmap: getSelector('name'),
+ id: getSelector('id'),
+ etd: getSelector('etd'),
+ summaryHeader: '.summaryHeader > :nth-child(2)',
+ summaryGoToSummaryBtn: '.summaryHeader > a > .q-icon',
+ summaryBtn: 'tableAction-0',
+ inputRoadmap: 'Roadmap_input',
+ checkbox: '.q-virtual-scroll__content tr:last-child .q-checkbox',
+ cloneFormBtn: '.q-card__actions > .q-btn--standard',
+ cloneBtn: '#subToolbar > :nth-child(3)',
+ deleteBtn: ':nth-child(4) > .q-btn__content',
+ confirmBtn: 'VnConfirm_confirm',
+ inputEtd: 'ETD_inputDate',
+ };
+
+ const data = {
+ roadmap: 'TEST-ROADMAP',
+ etd: '01/01/2025',
+ };
+
+ const dataCreated = 'Data created';
+ const summaryUrl = '/summary';
+
beforeEach(() => {
+ cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/roadmap`);
+ cy.typeSearchbar('{enter}');
});
+
+ it('Should list roadmaps', () => {
+ cy.get('.q-table')
+ .children()
+ .should('be.visible')
+ .should('have.length.greaterThan', 0);
+ });
+
it('Route list create roadmap and redirect', () => {
cy.addBtnClick();
- cy.get('input[name="name"]').type('roadMapTestOne{enter}');
- cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.url().should('include', '/summary');
+ cy.dataCy(selectors.inputRoadmap).type(`${data.roadmap}{enter}`);
+ cy.checkNotification(dataCreated);
+ cy.url().should('include', summaryUrl);
+ });
+
+ it('open summary', () => {
+ cy.dataCy(selectors.summaryBtn).last().click();
+ cy.get(selectors.summaryHeader).should('contain', data.roadmap);
+ cy.get(selectors.summaryGoToSummaryBtn).click();
+ cy.get(selectors.summaryHeader).should('contain', data.roadmap);
+ });
+
+ it('Should clone selected roadmap with new ETD', () => {
+ cy.get(selectors.checkbox).click();
+ cy.get(selectors.cloneBtn).click();
+ cy.dataCy(selectors.inputEtd).click().type(`${data.etd}{enter}`);
+ cy.get(selectors.cloneFormBtn).click();
+ cy.get(selectors.etd).should('contain', data.etd);
+ });
+
+ it('Should delete selected roadmap', () => {
+ cy.get(selectors.id).then(($el) => {
+ cy.get(selectors.checkbox).click();
+ cy.get(selectors.deleteBtn).click();
+ cy.dataCy(selectors.confirmBtn).click();
+ cy.typeSearchbar('{enter}');
+ cy.get(selectors.id).should('not.have.text', $el.text);
+ });
});
});
diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js
index da35066c3..5fda93b25 100644
--- a/test/cypress/integration/route/routeExtendedList.spec.js
+++ b/test/cypress/integration/route/routeExtendedList.spec.js
@@ -1,4 +1,4 @@
-describe('Route extended list', () => {
+describe.skip('Route extended list', () => {
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
const selectors = {
diff --git a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
index 19f4dc3b2..b4997fa69 100644
--- a/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
+++ b/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js
@@ -138,7 +138,7 @@ describe.skip('Ticket Lack detail', () => {
cy.get('[data-cy="itemProposal"]').click();
cy.wait('@getItemGetSimilar');
});
- describe('Replace item if', () => {
+ describe.skip('Replace item if', () => {
it('Quantity is less than available', () => {
cy.get(':nth-child(1) > .text-right > .q-btn').click();
});
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index 25ee05033..2409dd149 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -38,8 +38,8 @@ describe('TicketList', () => {
it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
+ cy.wait('@ticketSearchbar');
- cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
cy.dataCy('Customer ID_input').clear('1');
cy.dataCy('Customer ID_input').type('1101{enter}');
diff --git a/test/cypress/integration/wagon/wagonCreate.spec.js b/test/cypress/integration/wagon/wagonCreate.spec.js
index 6d185ea69..88855fdf9 100644
--- a/test/cypress/integration/wagon/wagonCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonCreate.spec.js
@@ -1,4 +1,4 @@
-describe.skip('WagonCreate', () => {
+describe('WagonCreate', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -17,7 +17,7 @@ describe.skip('WagonCreate', () => {
'.grid-create > [label="Volume"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Volume_input"]',
).type('100');
cy.selectOption('[data-cy="Type_select"]', '1');
-
+ cy.dataCy('FormModelPopup_save').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});
diff --git a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
index 49d7d9f01..915927a6d 100644
--- a/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
+++ b/test/cypress/integration/wagon/wagonType/wagonTypeCreate.spec.js
@@ -2,7 +2,7 @@ describe('WagonTypeCreate', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit('/#/wagon/type/create');
+ cy.visit('/#/wagon/type/list');
cy.waitForElement('.q-page', 6000);
});
diff --git a/test/cypress/integration/worker/workerBasicData.spec.js b/test/cypress/integration/worker/workerBasicData.spec.js
new file mode 100644
index 000000000..cf452a044
--- /dev/null
+++ b/test/cypress/integration/worker/workerBasicData.spec.js
@@ -0,0 +1,15 @@
+describe('WorkerBasicData', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/worker/1107/basic-data');
+ });
+
+ it('should modify worker summary', () => {
+ cy.dataCy('MaritalStatus').type('Married');
+ cy.dataCy('fi').type('42572374H');
+ cy.dataCy('country').type('Alemania');
+ cy.saveCard();
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/worker/workerBusiness.spec.js b/test/cypress/integration/worker/workerBusiness.spec.js
new file mode 100644
index 000000000..46da28cd6
--- /dev/null
+++ b/test/cypress/integration/worker/workerBusiness.spec.js
@@ -0,0 +1,34 @@
+describe.skip('WorkerBusiness', () => {
+ const saveBtn = '.q-mt-lg > .q-btn--standard';
+ const contributionCode = `Representantes de comercio`;
+ const contractType = `INDEFINIDO A TIEMPO COMPLETO`;
+
+ const Business = {
+ 'Start Date': { val: '26-12-2002', type: 'date' },
+ Company: { val: `VNL`, type: 'select' },
+ Department: { val: `RECICLAJE`, type: 'select' },
+ 'Professional Category': { val: `employee`, type: 'select' },
+ 'Work Calendar': { val: `General schedule`, type: 'select' },
+ 'Work Center': { val: `Silla`, type: 'select' },
+ 'Contract Category': { val: `INFORMATICA`, type: 'select' },
+ 'Contribution Code': { val: contributionCode, type: 'select' },
+ Rate: { val: `5` },
+ 'Contract Type': { val: contractType, type: 'select' },
+ 'Transport Workers Salary': { val: `1000` },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('hr');
+ cy.visit('/#/worker/1107/business');
+ cy.addCard();
+ });
+
+ it('should create a business', () => {
+ cy.fillInForm({
+ ...Business,
+ });
+ cy.get(saveBtn).click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/worker/workerMutual.spec.js b/test/cypress/integration/worker/workerMutual.spec.js
new file mode 100644
index 000000000..a6d2c5f4f
--- /dev/null
+++ b/test/cypress/integration/worker/workerMutual.spec.js
@@ -0,0 +1,23 @@
+///
+describe('WorkerMutual', () => {
+ const userId = 1106;
+ const saveBtn = '.q-mt-lg > .q-btn--standard';
+ const medicalReview = {
+ Date: { val: '01-01-2001', type: 'date' },
+ 'Formation Center': { val: '1', type: 'select' },
+ Invoice: { val: '24532' },
+ Amount: { val: '540' },
+ };
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/worker/${userId}/medical`);
+ cy.addCard();
+ });
+
+ it('should create a medical Review', () => {
+ cy.fillInForm(medicalReview);
+ cy.get(saveBtn).click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/worker/workerNotes.spec.js b/test/cypress/integration/worker/workerNotes.spec.js
new file mode 100644
index 000000000..661314ac9
--- /dev/null
+++ b/test/cypress/integration/worker/workerNotes.spec.js
@@ -0,0 +1,13 @@
+///
+describe('WorkerNotes', () => {
+ const userId = 1106;
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/worker/${userId}/notes`);
+ });
+
+ it('Should load layout', () => {
+ cy.get('.q-card').should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/worker/workerOperator.spec.js b/test/cypress/integration/worker/workerOperator.spec.js
new file mode 100644
index 000000000..95839aeba
--- /dev/null
+++ b/test/cypress/integration/worker/workerOperator.spec.js
@@ -0,0 +1,19 @@
+///
+describe('WorkerOperator', () => {
+ const userId = 1106;
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('hr');
+ cy.visit(`/#/worker/${userId}/operator`);
+ });
+
+ it('should fill the operator form', () => {
+ cy.dataCy('numberOfWagons').type('4');
+ cy.dataCy('linesLimit').type('6');
+ cy.dataCy('volumeLimit').type('3');
+ cy.dataCy('sizeLimit').type('3');
+ cy.saveCard();
+
+ cy.checkNotification('Data saved');
+ });
+});
diff --git a/test/cypress/integration/worker/workerPit.spec.js b/test/cypress/integration/worker/workerPit.spec.js
index 19cbebc20..04f232648 100644
--- a/test/cypress/integration/worker/workerPit.spec.js
+++ b/test/cypress/integration/worker/workerPit.spec.js
@@ -1,19 +1,5 @@
describe('WorkerPit', () => {
- const familySituationInput = '[data-cy="Family Situation_input"]';
- const familySituation = '1';
- const childPensionInput = '[data-cy="Child Pension_input"]';
- const childPension = '120';
- const spouseNifInput = '[data-cy="Spouse Pension_input"]';
- const spouseNif = '65117125P';
- const spousePensionInput = '[data-cy="Spouse Pension_input"]';
- const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
- const isDescendantSelect = '[data-cy="Descendant/Ascendant"]';
- const Descendant = 'Descendiente';
- const birthedInput = '[data-cy="Birth Year_input"]';
- const birthed = '2002';
- const adoptionYearInput = '[data-cy="Adoption Year_input"]';
- const adoptionYear = '2004';
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
@@ -24,15 +10,15 @@ describe('WorkerPit', () => {
});
it('complete PIT', () => {
- cy.get(familySituationInput).type(familySituation);
- cy.get(childPensionInput).type(childPension);
- cy.get(spouseNifInput).type(spouseNif);
- cy.get(spousePensionInput).type(spousePension);
+ cy.dataCy('familySituation').type('1');
+ cy.dataCy('childPension').type('120');
+ cy.dataCy('spouseNif').type('65117125P');
+ cy.dataCy('spousePension').type('120');
cy.get(savePIT).click();
cy.get(addRelative).click();
- cy.get(isDescendantSelect).type(Descendant);
- cy.get(birthedInput).type(birthed);
- cy.get(adoptionYearInput).type(adoptionYear);
+ cy.dataCy('Descendant/Ascendant').type('Descendiente');
+ cy.dataCy('birthed').type('2002');
+ cy.dataCy('adoptionYear').type('2004');
cy.get(saveRelative).click();
});
});
diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js
index 3d70fdf96..c50b2c943 100644
--- a/test/cypress/integration/worker/workerSummary.spec.js
+++ b/test/cypress/integration/worker/workerSummary.spec.js
@@ -1,4 +1,6 @@
describe('WorkerSummary', () => {
+ const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link';
+ const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
@@ -10,7 +12,17 @@ describe('WorkerSummary', () => {
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
'have.text',
- 'salesBossNick'
+ 'salesBossNick',
);
});
+
+ it('should try descriptors', () => {
+ cy.waitForElement('.summaryHeader');
+ cy.get(departmentDescriptor).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '43');
+ cy.get(roleDescriptor).click();
+ cy.get('.descriptor').should('be.visible');
+ cy.get('.q-item > .q-item__label').should('include.text', '19');
+ });
});