-
-
- {{ t('order.summary.basket') }} #{{ entity?.id }} -
- {{ entity?.client?.name }} ({{ entity?.clientFk }})
-
-
-
- {{ t('order.summary.confirmLines') }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ dashIfEmpty(entity?.address?.nickname) }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ dashIfEmpty(entity?.address?.phone) }}
-
-
-
-
-
-
-
-
-
-
-
- {{ entity?.note }}
-
-
-
-
-
-
- {{ t('globals.subtotal') }}
-
-
- {{
- toCurrency(entity?.subTotal)
- }}
-
-
-
-
- {{ t('globals.vat') }}
-
-
- {{ toCurrency(entity?.VAT) }}
-
-
-
-
- {{ t('order.summary.total') }}
-
-
- {{ toCurrency(entity?.total) }}
-
-
-
-
-
-
-
-
- {{ t('globals.item') }}
- {{ t('globals.description') }}
- {{ t('globals.quantity') }}
- {{ t('globals.price') }}
- {{ t('order.summary.amount') }}
-
-
-
-
-
-
- {{ props.row.item?.id }}
-
-
-
-
-
-
- {{ props.row.item.name }}
-
- {{ props.row.item.subName }}
-
-
+
+
+ {{ t('order.summary.basket') }} #{{ entity?.id }} -
+ {{ entity?.client?.name }} ({{ entity?.clientFk }})
+
+
+
+ {{ t('order.summary.confirmLines') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dashIfEmpty(entity?.address?.nickname) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ dashIfEmpty(entity?.address?.phone) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ entity?.note }}
+
+
+
+
+
+
+ {{ t('globals.subtotal') }}
+
+
+ {{ toCurrency(entity?.subTotal) }}
+
+
+
+
+ {{ t('globals.vat') }}
+
+
+ {{ toCurrency(entity?.VAT) }}
+
+
+
+
+ {{ t('order.summary.total') }}
+
+
+ {{ toCurrency(entity?.total) }}
+
+
+
+
+
+
+
+
+ {{ t('globals.item') }}
+ {{ t('globals.description') }}
+ {{ t('globals.quantity') }}
+ {{ t('globals.price') }}
+ {{ t('order.summary.amount') }}
+
+
+
+
+
+
+ {{ props.row.item?.id }}
+
+
+
+
+
+
+ {{ props.row.item.name }}
+
+ {{ props.row.item.subName }}
+
-
-
-
- {{ props.row.quantity }}
-
-
- {{ toCurrency(props.row.price) }}
-
-
- {{
- toCurrency(props.row?.quantity * props.row?.price)
- }}
-
-
-
-
-
-
-
-
+
+
+
+
+ {{ props.row.quantity }}
+
+
+ {{ toCurrency(props.row.price) }}
+
+
+ {{ toCurrency(props.row?.quantity * props.row?.price) }}
+
+
+
+
+
+
+
diff --git a/src/stores/useDescriptorStore.js b/src/stores/useDescriptorStore.js
index 89189f32e..be342b016 100644
--- a/src/stores/useDescriptorStore.js
+++ b/src/stores/useDescriptorStore.js
@@ -11,14 +11,12 @@ export const useDescriptorStore = defineStore('descriptorStore', () => {
const files = import.meta.glob(`/src/**/*DescriptorProxy.vue`);
const moduleParser = {
account: 'user',
- client: 'customer',
+ customer: 'client',
};
for (const file in files) {
const name = file.split('/').at(-1).slice(0, -19).toLowerCase();
const descriptor = moduleParser[name] ?? name;
- currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(
- () => import(/* @vite-ignore */ file),
- );
+ currentDescriptors[descriptor + 'Fk'] = defineAsyncComponent(files[file]);
}
setDescriptors(currentDescriptors);
return currentDescriptors;
diff --git a/test/cypress/integration/entry/entryCard/entryBuys.spec.js b/test/cypress/integration/entry/entryCard/entryBuys.spec.js
index f8f5e6b80..b5e185a8e 100644
--- a/test/cypress/integration/entry/entryCard/entryBuys.spec.js
+++ b/test/cypress/integration/entry/entryCard/entryBuys.spec.js
@@ -80,6 +80,11 @@ describe('EntryBuys', () => {
checkColor('amount', COLORS.positive);
cy.saveCard();
+ cy.get('tbody > tr [tabindex="0"][role="checkbox"]').click();
+ cy.dataCy('transferBuys').should('be.enabled').click();
+ cy.dataCy('entryDestinyInput').should('be.visible').type('100');
+ cy.dataCy('transferBuysBtn').click();
+
cy.deleteEntry();
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
index 44a61609e..7254e8909 100644
--- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js
@@ -4,7 +4,7 @@ describe('InvoiceInList', () => {
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
const firstId = `${firstRow} > td:nth-child(2) span`;
const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`;
- const summaryHeaders = '.summaryBody .header-link';
+ const summaryHeaders = (opt) => `.summaryBody > .${opt} > .q-pb-lg > .header-link`;
const mockInvoiceRef = `createMockInvoice${Math.floor(Math.random() * 100)}`;
const mock = {
vnSupplierSelect: { val: 'farmer king', type: 'select' },
@@ -32,8 +32,8 @@ describe('InvoiceInList', () => {
it('should open the details', () => {
cy.get(firstDetailBtn).click();
- cy.get(summaryHeaders).eq(1).contains('Basic data');
- cy.get(summaryHeaders).eq(4).contains('Vat');
+ cy.get(summaryHeaders('max-width')).contains('Basic data');
+ cy.get(summaryHeaders('vat')).contains('Vat');
});
it('should create a new Invoice', () => {
@@ -41,12 +41,12 @@ describe('InvoiceInList', () => {
cy.fillInForm({ ...mock }, { attr: 'data-cy' });
cy.dataCy('FormModelPopup_save').click();
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
- cy.wait('@invoice').then(() =>
+ cy.wait('@invoice').then(() => {
cy.validateDescriptor({
title: mockInvoiceRef,
listBox: { 0: '11/16/2001', 3: 'The farmer' },
- }),
- );
- cy.get('[data-cy="vnLvCompany"]').should('contain.text', 'ORN');
+ });
+ cy.dataCy('invoiceInBasicDataCompanyFk').should('have.value', 'ORN');
+ });
});
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index e9412244f..ff7d639e6 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -1,7 +1,7 @@
///
describe('InvoiceInVat', () => {
const thirdRow = 'tbody > :nth-child(3)';
- const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)';
+ const firstLineVat = 'tbody > :nth-child(1) ';
const vats = '[data-cy="vat-sageiva"]';
const dialogInputs = '.q-dialog label input';
const addBtn = 'tbody tr:nth-child(1) td:nth-child(2) .--add-icon';
@@ -18,6 +18,17 @@ describe('InvoiceInVat', () => {
cy.get(vats).eq(0).should('have.value', '8: H.P. IVA 21% CEE');
});
+ it('should mark the line as deductible VAT', () => {
+ cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`).click();
+
+ cy.saveCard();
+
+ cy.get(`${firstLineVat} [data-cy="isDeductible_checkbox"]`)
+
+ .click();
+ cy.saveCard();
+ });
+
it('should add a new row', () => {
cy.addRow();
cy.fillRow(thirdRow, [true, 2000000001, 30, 'H.P. IVA 10']);
diff --git a/test/cypress/integration/route/cmr/cmrList.spec.js b/test/cypress/integration/route/cmr/cmrList.spec.js
new file mode 100644
index 000000000..d33508e3a
--- /dev/null
+++ b/test/cypress/integration/route/cmr/cmrList.spec.js
@@ -0,0 +1,91 @@
+describe('Cmr list', () => {
+ const getLinkSelector = (colField) =>
+ `tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
+
+ const selectors = {
+ ticket: getLinkSelector('ticketFk'),
+ client: getLinkSelector('clientFk'),
+ lastRowSelectCheckBox:
+ '.q-virtual-scroll__content > tr:last-child > :nth-child(1) > .q-checkbox',
+ downloadBtn: '#subToolbar > .q-btn',
+ viewCmr: 'tableAction-0',
+ descriptorOpenSummaryBtn: '.descriptor [data-cy="openSummaryBtn"]',
+ summaryTitle: '.summaryHeader',
+ descriptorId: '.descriptor .subtitle',
+ descriptorTitle: '.descriptor .title',
+ summaryGoToSummaryBtn: '.summaryHeader [data-cy="goToSummaryBtn"]',
+ descriptorGoToSummaryBtn: '.descriptor [data-cy="goToSummaryBtn"]',
+ removeFilter: '.q-chip__icon--remove',
+ };
+
+ const data = {
+ ticket: '1',
+ client: 'Bruce Wayne',
+ };
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit('/#/route/cmr');
+ cy.typeSearchbar('{enter}');
+ cy.get(selectors.removeFilter).click();
+ });
+
+ it('Should download selected cmr', () => {
+ const downloadsFolder = Cypress.config('downloadsFolder');
+ cy.get(selectors.lastRowSelectCheckBox).should('be.visible').click();
+ cy.get(selectors.downloadBtn).should('be.visible').click();
+ cy.wait(3000);
+
+ const fileName = 'cmrs.zip';
+ cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
+ });
+
+ it('Should open selected cmr pdf', () => {
+ cy.window().then((win) => {
+ cy.stub(win, 'open').as('windowOpen');
+ });
+ cy.dataCy(selectors.viewCmr).last().click();
+ cy.get('@windowOpen').should('be.calledWithMatch', '\/api\/Cmrs\/3');
+ });
+
+ describe('Ticket pop-ups', () => {
+ it('Should redirect to the ticket summary from the ticket descriptor pop-up', () => {
+ cy.get(selectors.ticket).should('be.visible').click();
+ cy.containContent(selectors.descriptorId, data.ticket);
+ cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
+ cy.url().should('include', '/ticket/1/summary');
+ cy.containContent(selectors.summaryTitle, data.client);
+ });
+
+ it('Should redirect to the ticket summary from summary pop-up from the ticket descriptor pop-up', () => {
+ cy.get(selectors.ticket).should('be.visible').click();
+ cy.containContent(selectors.descriptorId, data.ticket);
+ cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
+ cy.containContent(selectors.summaryTitle, data.client);
+ cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
+ cy.url().should('include', '/ticket/1/summary');
+ cy.containContent(selectors.summaryTitle, data.client);
+ });
+ });
+
+ describe('Client pop-ups', () => {
+ it('Should redirect to the client summary from the client descriptor pop-up', () => {
+ cy.get(selectors.client).should('be.visible').click();
+ cy.containContent(selectors.descriptorTitle, data.client);
+ cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
+ cy.url().should('include', '/customer/1101/summary');
+ cy.containContent(selectors.summaryTitle, data.client);
+ });
+
+ it('Should redirect to the client summary from summary pop-up from the client descriptor pop-up', () => {
+ cy.get(selectors.client).should('be.visible').click();
+ cy.containContent(selectors.descriptorTitle, data.client);
+ cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
+ cy.containContent(selectors.summaryTitle, data.client);
+ cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
+ cy.url().should('include', '/customer/1101/summary');
+ cy.containContent(selectors.summaryTitle, data.client);
+ });
+ });
+});
diff --git a/test/cypress/integration/route/routeAutonomous.spec.js b/test/cypress/integration/route/routeAutonomous.spec.js
index acf82bd95..08fd7d7ea 100644
--- a/test/cypress/integration/route/routeAutonomous.spec.js
+++ b/test/cypress/integration/route/routeAutonomous.spec.js
@@ -1,4 +1,4 @@
-describe('RouteAutonomous', () => {
+describe.skip('RouteAutonomous', () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js
index fb2885f35..a183c08cb 100644
--- a/test/cypress/integration/route/routeExtendedList.spec.js
+++ b/test/cypress/integration/route/routeExtendedList.spec.js
@@ -154,10 +154,9 @@ describe('Route extended list', () => {
cy.validateContent(selectors.served, checkboxState.check);
});
- it('Should delete the selected routes', () => {
+ it('Should delete the selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.removeBtn).click();
-
cy.dataCy(selectors.confirmBtn).click();
cy.checkNotification(dataSaved);
diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js
index 0ba2723a2..b5c95c463 100644
--- a/test/cypress/integration/ticket/ticketDescriptor.spec.js
+++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js
@@ -3,10 +3,10 @@ describe('Ticket descriptor', () => {
const listItem = '[role="menu"] .q-list .q-item';
const toCloneOpt = 'To clone ticket';
const setWeightOpt = 'Set weight';
- const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
+ const warehouseValue = ':nth-child(1) > [data-cy="vnLvWarehouse"]';
const summaryHeader = '.summaryHeader > div';
const weight = 25;
- const weightValue = '.summaryBody.row :nth-child(1) > :nth-child(9) > .value > span';
+ const weightValue = '[data-cy="vnLvWeight"]';
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index a3d8fe908..5613a5854 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -35,7 +35,7 @@ describe('TicketList', () => {
cy.get('.summaryBody').should('exist');
});
- it.skip('filter client and create ticket', () => {
+ it('filter client and create ticket', () => {
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
searchResults();
cy.wait('@ticketSearchbar');
@@ -44,6 +44,7 @@ describe('TicketList', () => {
cy.dataCy('Customer ID_input').type('1101{enter}');
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
+ cy.waitSpinner();
cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
cy.dataCy('Address_select').click();
diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js
index 25724e873..8722fe37e 100644
--- a/test/cypress/integration/vnComponent/UserPanel.spec.js
+++ b/test/cypress/integration/vnComponent/UserPanel.spec.js
@@ -39,11 +39,11 @@ describe('UserPanel', () => {
cy.get(userCompany).should('have.value', 'Warehouse One').click();
//Actualizo la opción
- cy.getOption(2);
+ cy.getOption(3);
//Compruebo la notificación
cy.get('.q-notification').should('be.visible');
- cy.get(userCompany).should('have.value', 'Warehouse Two');
+ cy.get(userCompany).should('have.value', 'TestingWarehouse');
//Restauro el valor
cy.get(userCompany).click();
diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js
index ae0013150..8ca32b681 100644
--- a/test/cypress/integration/vnComponent/VnLog.spec.js
+++ b/test/cypress/integration/vnComponent/VnLog.spec.js
@@ -20,7 +20,7 @@ describe('VnLog', () => {
it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click();
- cy.validateContent(chips[0], 'Claim');
+ cy.validateContent(chips[0], 'Beginning');
});
it('should show claimDescriptor', () => {
diff --git a/test/cypress/integration/worker/workerSummary.spec.js b/test/cypress/integration/worker/workerSummary.spec.js
index c50b2c943..6071c4cdf 100644
--- a/test/cypress/integration/worker/workerSummary.spec.js
+++ b/test/cypress/integration/worker/workerSummary.spec.js
@@ -1,27 +1,25 @@
describe('WorkerSummary', () => {
- const departmentDescriptor = ':nth-child(1) > :nth-child(3) > .value > .link';
- const roleDescriptor = ':nth-child(3) > :nth-child(4) > .value > .link';
+ const department = ':nth-child(1) > [data-cy="vnLvDepartment"] > .value';
+ const role = '[data-cy="vnLvRole"] > .value';
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/worker/19/summary');
});
- it('should load worker summary', () => {
+ it('should load worker summary and show the department', () => {
cy.waitForElement('.summaryHeader');
cy.get('.summaryHeader > div').should('have.text', '19 - salesboss salesboss');
- cy.get(':nth-child(1) > :nth-child(2) > .value > span').should(
- 'have.text',
- 'salesBossNick',
- );
+ cy.get(department).should('have.text', 'VENTAS');
});
it('should try descriptors', () => {
cy.waitForElement('.summaryHeader');
- cy.get(departmentDescriptor).click();
+ cy.get(department).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '43');
- cy.get(roleDescriptor).click();
+ cy.get('.summaryBody').click();
+ cy.get(role).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '19');
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index fe8d38e79..7f5203547 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -370,6 +370,21 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => {
cy.get(selector).should('have.text', expectedValue);
});
+Cypress.Commands.add('containContent', (selector, expectedValue) => {
+ cy.get(selector)
+ .should('be.visible')
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.include(expectedValue);
+ });
+});
+
+Cypress.Commands.add('openActionDescriptor', (opt) => {
+ cy.openActionsDescriptor();
+ const listItem = '[role="menu"] .q-list .q-item';
+ cy.contains(listItem, opt).click();
+});
+
Cypress.Commands.add('openActionsDescriptor', () => {
cy.get('[data-cy="vnDescriptor"] [data-cy="descriptor-more-opts"]').click();
});