#8219 Added InvoiceOut e2e tests #1001
|
@ -485,6 +485,7 @@ invoiceOut:
|
|||
card:
|
||||
issued: Issued
|
||||
customerCard: Customer card
|
||||
ticketList: Ticket List
|
||||
summary:
|
||||
issued: Issued
|
||||
dued: Due
|
||||
|
|
|
@ -47,6 +47,7 @@ const states = ref();
|
|||
:label="t('Amount')"
|
||||
v-model="params.amount"
|
||||
is-outlined
|
||||
data-cy="InvoiceOutFilterAmountBtn"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
|
|
@ -101,6 +101,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
data-cy="InvoiceOutGlobalClientSelect"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
@ -122,6 +123,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
data-cy="InvoiceOutGlobalSerialSelect"
|
||||
/>
|
||||
<VnInputDate
|
||||
v-model="formData.invoiceDate"
|
||||
|
@ -132,6 +134,7 @@ onMounted(async () => {
|
|||
v-model="formData.maxShipped"
|
||||
:label="t('maxShipped')"
|
||||
is-outlined
|
||||
data-cy="InvoiceOutGlobalMaxShippedDate"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('company')"
|
||||
|
@ -141,6 +144,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
data-cy="InvoiceOutGlobalCompanySelect"
|
||||
/>
|
||||
<VnSelect
|
||||
:label="t('printer')"
|
||||
|
@ -149,6 +153,7 @@ onMounted(async () => {
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
data-cy="InvoiceOutGlobalPrinterSelect"
|
||||
/>
|
||||
</div>
|
||||
<QBtn
|
||||
|
|
|
@ -139,25 +139,22 @@ function openPdf(id) {
|
|||
}
|
||||
|
||||
function downloadPdf() {
|
||||
if (selectedRows.value.size === 0) return;
|
||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||
if (selectedRows.value.size === 0) return;
|
||||
const selectedCardsArray = Array.from(selectedRows.value.values());
|
||||
|
||||
if (selectedRows.value.size === 1) {
|
||||
const [invoiceOut] = selectedCardsArray;
|
||||
openPdf(invoiceOut.id);
|
||||
} else {
|
||||
const invoiceOutIdsArray = selectedCardsArray.map(
|
||||
(invoiceOut) => invoiceOut.id
|
||||
);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
if (selectedRows.value.size === 1) {
|
||||
const [invoiceOut] = selectedCardsArray;
|
||||
openPdf(invoiceOut.id);
|
||||
} else {
|
||||
const invoiceOutIdsArray = selectedCardsArray.map((invoiceOut) => invoiceOut.id);
|
||||
const invoiceOutIds = invoiceOutIdsArray.join(',');
|
||||
|
||||
const params = {
|
||||
ids: invoiceOutIds,
|
||||
};
|
||||
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
}
|
||||
const params = {
|
||||
ids: invoiceOutIds,
|
||||
};
|
||||
|
||||
openReport(`${MODEL}/downloadZip`, params);
|
||||
}
|
||||
}
|
||||
|
||||
watchEffect(selectedRows);
|
||||
|
@ -181,6 +178,7 @@ watchEffect(selectedRows);
|
|||
icon-right="cloud_download"
|
||||
@click="downloadPdf()"
|
||||
:disable="!hasSelectedCards"
|
||||
data-cy="InvoiceOutDownloadPdfBtn"
|
||||
>
|
||||
<QTooltip>{{ t('downloadPdf') }}</QTooltip>
|
||||
</QBtn>
|
||||
|
@ -201,7 +199,6 @@ watchEffect(selectedRows);
|
|||
order="id DESC"
|
||||
:columns="columns"
|
||||
redirect="invoice-out"
|
||||
auto-load
|
||||
:table="{
|
||||
'row-key': 'id',
|
||||
selection: 'multiple',
|
||||
|
@ -230,6 +227,7 @@ watchEffect(selectedRows);
|
|||
v-model="data.ticketFk"
|
||||
:label="t('globals.ticket')"
|
||||
style="flex: 1"
|
||||
data-cy="InvoiceOutCreateTicketinput"
|
||||
/>
|
||||
|
||||
<div
|
||||
|
@ -344,6 +342,7 @@ watchEffect(selectedRows);
|
|||
option-value="code"
|
||||
option-filter
|
||||
:expr-builder="exprBuilder"
|
||||
data-cy="InvoiceOutCreateSerialSelect"
|
||||
>
|
||||
<template #option="scope">
|
||||
<QItem v-bind="scope.itemProps">
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice path', () => {
|
||||
const notification = '.q-notification__message';
|
||||
const invoice = {
|
||||
Ticket: { val: '8' },
|
||||
Serial: { val: 'Española rápida', type: 'select' },
|
||||
};
|
||||
const invoiceError = {
|
||||
Ticket: { val: '1' },
|
||||
Serial: { val: 'T - Española rapida', type: 'select' },
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/list`);
|
||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
||||
});
|
||||
|
||||
it('should search and filter an invoice and enter to the summary', () => {
|
||||
cy.dataCy('vnSearchBar').find('input').type('1{enter}');
|
||||
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
|
||||
cy.get('.header > a.q-btn > .q-btn__content').click();
|
||||
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
|
||||
});
|
||||
it('should download a pdf with one and all invoices', () => {
|
||||
cy.get(
|
||||
':nth-child(6) > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
|
||||
).click();
|
||||
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||
cy.get(
|
||||
':nth-child(6) > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
|
||||
).click();
|
||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
porque aqui está de diferente forma que en la 29? porque aqui está de diferente forma que en la 29?
alexm
commented
fillInForm¿? fillInForm¿?
alexm
commented
Esta bien Esta bien
|
||||
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
|
||||
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
|
||||
});
|
||||
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
|
||||
cy.get('[data-cy="vnTableCreateBtn"]').click();
|
||||
cy.fillInForm(invoiceError);
|
||||
jsegarra marked this conversation as resolved
Outdated
jsegarra
commented
porque aqui está de diferente forma que en la 29? porque aqui está de diferente forma que en la 29?
|
||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||
cy.get(notification).should('contains.text', 'This ticket is already invoiced');
|
||||
});
|
||||
it('should create a manual invoice and enter to its summary', () => {
|
||||
cy.get('[data-cy="vnTableCreateBtn"]').click();
|
||||
cy.fillInForm(invoice);
|
||||
cy.get('[data-cy="FormModelPopup_save"]').click();
|
||||
cy.get(notification).should('contains.text', 'Data created');
|
||||
});
|
||||
});
|
|
@ -0,0 +1,27 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice path', () => {
|
||||
const notification = '.q-notification__message';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/ticket/list`);
|
||||
cy.get('#searchbar input').type('{enter}');
|
||||
jon marked this conversation as resolved
jsegarra
commented
tienes estilo diferente al anterior test tienes estilo diferente al anterior test
|
||||
});
|
||||
|
||||
it('should create an invoice from a ticket and go to that invoice', () => {
|
||||
cy.get(
|
||||
jon marked this conversation as resolved
Outdated
jsegarra
commented
Si es VnInput mirate el selector Si es VnInput mirate el selector
jsegarra
commented
Revisa el archivo commands Revisa el archivo commands
jsegarra
commented
También se puede usar cy.get('[data-cy="Customer ID_input"]') También se puede usar cy.get('[data-cy="Customer ID_input"]')
|
||||
'[label="Customer ID"] > .q-field > .q-field__inner > .q-field__control'
|
||||
).type('1101{enter}');
|
||||
cy.get(
|
||||
'[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
|
||||
).click();
|
||||
cy.get(
|
||||
'[style="transform: translate(-256px, 0px); margin: 80px 20px; z-index: 2;"] > div > .q-btn'
|
||||
).click();
|
||||
cy.get(notification).should('contains.text', 'Data saved');
|
||||
cy.get('.q-virtual-scroll__content > :nth-child(1) > :nth-child(3)').click();
|
||||
cy.get(':nth-child(8) > .value > .link').click();
|
||||
cy.get('[href="#/invoice-out/6/summary"] > .q-btn > .q-btn__content').click();
|
||||
});
|
||||
});
|
|
@ -0,0 +1,18 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice path', () => {
|
||||
const notification = '.q-notification__message';
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/negative-bases`);
|
||||
});
|
||||
|
||||
it('should filter and download as CSV', () => {
|
||||
cy.get(
|
||||
':nth-child(7) > .full-width > :nth-child(1) > .column > div.q-px-xs > .q-field > .q-field__inner > .q-field__control'
|
||||
).type('23{enter}');
|
||||
cy.get('#subToolbar > .q-btn').click();
|
||||
cy.get(notification).should('contains.text', 'CSV downloaded successfully');
|
||||
jon marked this conversation as resolved
jsegarra
commented
commands.js commands.js
|
||||
});
|
||||
});
|
|
@ -0,0 +1,56 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice path', () => {
|
||||
const notification = '.q-notification__message';
|
||||
const transferInvoice = {
|
||||
Client: { val: 'employee', type: 'select' },
|
||||
Type: { val: 'Error in customer data', type: 'select' },
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/list`);
|
||||
cy.get('#searchbar input').type('{enter}');
|
||||
jon marked this conversation as resolved
jsegarra
commented
Revisalo Revisalo
|
||||
});
|
||||
|
||||
it('should generate the invoice PDF', () => {
|
||||
cy.get('#searchbar input').type('T1111111{enter}');
|
||||
cy.get('[data-cy="descriptor-more-opts"] > .q-btn__content > .q-icon').click();
|
||||
jon marked this conversation as resolved
Outdated
jsegarra
commented
revisate el archivo comands revisate el archivo comands
|
||||
cy.get('.q-menu > .q-list > :nth-child(6)').click();
|
||||
cy.get('[data-cy="VnConfirm_confirm"]').click();
|
||||
jon marked this conversation as resolved
Outdated
jsegarra
commented
Esto me hace pensar que nos has tirado los tests 🚩 Esto me hace pensar que nos has tirado los tests 🚩
|
||||
cy.get(notification).should(
|
||||
'contains.text',
|
||||
'The invoice PDF document has been regenerated'
|
||||
);
|
||||
});
|
||||
|
||||
it('should refund the invoice ', () => {
|
||||
cy.get('#searchbar input').type('T1111111{enter}');
|
||||
cy.get('[data-cy="descriptor-more-opts"] > .q-btn__content > .q-icon').click();
|
||||
cy.get('.q-menu > .q-list > :nth-child(7)').click();
|
||||
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
|
||||
cy.get(notification).should(
|
||||
jon marked this conversation as resolved
Outdated
jsegarra
commented
revisate el archivo commands revisate el archivo commands
|
||||
'contains.text',
|
||||
'The following refund ticket have been created 1000000'
|
||||
);
|
||||
});
|
||||
|
||||
it('should delete an invoice ', () => {
|
||||
cy.get('#searchbar input').type('T2222222{enter}');
|
||||
cy.get('.q-menu > .q-list > :nth-child(4)').click();
|
||||
cy.get('[data-cy="VnConfirm_confirm"]').click();
|
||||
cy.get(notification).should('contains.text', 'InvoiceOut deleted');
|
||||
});
|
||||
|
||||
it('should transfer the invoice ', () => {
|
||||
cy.get('#searchbar input').type('T1111111{enter}');
|
||||
cy.get('[data-cy="descriptor-more-opts"] > .q-btn__content > .q-icon').click();
|
||||
jon marked this conversation as resolved
jsegarra
commented
revisate commands revisate commands
|
||||
cy.get('.q-menu > .q-list > :nth-child(1)').click();
|
||||
cy.fillInForm(transferInvoice);
|
||||
cy.get('.q-mt-lg > .q-btn').click();
|
||||
cy.get(notification).should(
|
||||
'contains.text',
|
||||
'The following refund ticket have been created 1000000'
|
||||
);
|
||||
});
|
||||
});
|
|
@ -0,0 +1,23 @@
|
|||
/// <reference types="cypress" />
|
||||
describe('InvoiceOut manual invoice path', () => {
|
||||
beforeEach(() => {
|
||||
cy.viewport(1920, 1080);
|
||||
cy.login('developer');
|
||||
cy.visit(`/#/invoice-out/global-invoicing`);
|
||||
});
|
||||
|
||||
it('should filter and download as CSV', () => {
|
||||
cy.get('.q-mb-sm > .q-radio__inner').click();
|
||||
cy.get('[data-cy="InvoiceOutGlobalClientSelect"]').type('1102');
|
||||
cy.get('.q-menu .q-item').contains('1102').click();
|
||||
cy.get('[data-cy="InvoiceOutGlobalSerialSelect"]').click();
|
||||
cy.get('.q-menu .q-item').contains('global').click();
|
||||
cy.get('[data-cy="InvoiceOutGlobalCompanySelect"]').type('VNL');
|
||||
cy.get('.q-menu .q-item').contains('VNL').click();
|
||||
cy.get('[data-cy="InvoiceOutGlobalPrinterSelect"]').type('printer1');
|
||||
cy.get('.q-menu .q-item').contains('printer1').click();
|
||||
cy.get(
|
||||
'[label="Max date ticket"] > .q-field > .q-field__inner > .q-field__control'
|
||||
).type('01-01-2000{enter}');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
🚩