diff --git a/test/cypress/.gitignore b/test/cypress/.gitignore
index 8d940320e..c9793a5f2 100644
--- a/test/cypress/.gitignore
+++ b/test/cypress/.gitignore
@@ -1,2 +1,3 @@
reports/*
screenshots/*
+downloads/*
\ No newline at end of file
diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
new file mode 100644
index 000000000..30cc8e497
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js
@@ -0,0 +1,46 @@
+///
+describe('InvoiceOut list', () => {
+ const invoice = {
+ Ticket: { val: '8' },
+ Serial: { val: 'Española rapida', type: 'select' },
+ };
+ const invoiceError = {
+ Ticket: { val: '1' },
+ Serial: { val: 'Española rapida', type: 'select' },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/invoice-out/list`);
+ cy.typeSearchbar('{enter}');
+ });
+
+ it('should search and filter an invoice and enter to the summary', () => {
+ cy.typeSearchbar('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.typeSearchbar('{enter}');
+ cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
+ });
+
+ it('should download all pdfs', () => {
+ cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
+ 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.dataCy('vnTableCreateBtn').click();
+ cy.fillInForm(invoiceError);
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('This ticket is already invoiced');
+ });
+
+ it('should create a manual invoice and enter to its summary', () => {
+ cy.dataCy('vnTableCreateBtn').click();
+ cy.fillInForm(invoice);
+ cy.dataCy('FormModelPopup_save').click();
+ cy.checkNotification('Data created');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
new file mode 100644
index 000000000..145f492a1
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js
@@ -0,0 +1,21 @@
+///
+describe('InvoiceOut manual invoice', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/ticket/list`);
+ cy.get('#searchbar input').type('{enter}');
+ });
+
+ it('should create an invoice from a ticket and go to that invoice', () => {
+ cy.searchByLabel('Customer ID', '1101');
+ cy.get(
+ '[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner'
+ ).click();
+ cy.dataCy('ticketListMakeInvoiceBtn').click();
+ cy.checkNotification('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('.header > :nth-child(3) > .q-btn__content').click();
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
new file mode 100644
index 000000000..5f629df0b
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutNegativeBases.spec.js
@@ -0,0 +1,16 @@
+///
+describe('InvoiceOut negative bases', () => {
+ 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.checkNotification('CSV downloaded successfully');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
new file mode 100644
index 000000000..b7fd11307
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js
@@ -0,0 +1,47 @@
+///
+describe('InvoiceOut summary', () => {
+ 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.typeSearchbar('{enter}');
+ });
+
+ it('should generate the invoice PDF', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(6)').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('The invoice PDF document has been regenerated');
+ });
+
+ it('should refund the invoice ', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').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.checkNotification('The following refund ticket have been created 1000000');
+ });
+
+ it('should delete an invoice ', () => {
+ cy.typeSearchbar('T2222222{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(4)').click();
+ cy.dataCy('VnConfirm_confirm').click();
+ cy.checkNotification('InvoiceOut deleted');
+ });
+
+ it('should transfer the invoice ', () => {
+ cy.typeSearchbar('T1111111{enter}');
+ cy.dataCy('descriptor-more-opts').click();
+ cy.get('.q-menu > .q-list > :nth-child(1)').click();
+ cy.fillInForm(transferInvoice);
+ cy.get('.q-mt-lg > .q-btn').click();
+ cy.checkNotification('Transferred invoice');
+ });
+});
diff --git a/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js b/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js
new file mode 100644
index 000000000..06e132b39
--- /dev/null
+++ b/test/cypress/integration/invoiceOut/invvoiceOutGlobal.spec.js
@@ -0,0 +1,28 @@
+///
+describe('InvoiceOut global invoicing', () => {
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('administrative');
+ cy.visit(`/#/invoice-out/global-invoicing`);
+ });
+
+ it('should invoice the client tickets', () => {
+ cy.get('.q-mb-sm > .q-radio__inner').click();
+ cy.dataCy('InvoiceOutGlobalClientSelect').type('1102');
+ cy.get('.q-menu .q-item').contains('1102').click();
+ cy.dataCy('InvoiceOutGlobalSerialSelect').click();
+ cy.get('.q-menu .q-item').contains('global').click();
+ cy.dataCy('InvoiceOutGlobalCompanySelect').type('VNL');
+ cy.get('.q-menu .q-item').contains('VNL').click();
+ cy.dataCy('InvoiceOutGlobalPrinterSelect').type('printer1');
+ cy.get('.q-menu .q-item').contains('printer1').click();
+ cy.get(
+ '[label="Invoice date"] > .q-field > .q-field__inner > .q-field__control'
+ ).click();
+ cy.get(':nth-child(5) > div > .q-btn > .q-btn__content > .block').click();
+ cy.get('.q-date__years-content > :nth-child(2) > .q-btn').click();
+ cy.get('.q-date__calendar-days > :nth-child(6) > .q-btn').click();
+ cy.get('[label="Max date ticket"]').type('01-01-2001{enter}');
+ cy.get('.q-card').should('be.visible');
+ });
+});
diff --git a/test/cypress/integration/outLogin/login.spec.js b/test/cypress/integration/outLogin/login.spec.js
index 3db223cdb..2bd5a8c3b 100755
--- a/test/cypress/integration/outLogin/login.spec.js
+++ b/test/cypress/integration/outLogin/login.spec.js
@@ -19,6 +19,7 @@ describe('Login', () => {
it('should fail to log in using wrong password', () => {
cy.get('input[aria-label="Username"]').type('employee');
cy.get('input[aria-label="Password"]').type('wrongPassword');
+ cy.get('.q-field__append > .q-icon');
cy.get('button[type="submit"]').click();
cy.get('.q-notification__message').should(
'have.text',
diff --git a/test/cypress/integration/vnComponent/VnSearchBar.spec.js b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
index c6a33ab4d..c710d5192 100644
--- a/test/cypress/integration/vnComponent/VnSearchBar.spec.js
+++ b/test/cypress/integration/vnComponent/VnSearchBar.spec.js
@@ -16,10 +16,12 @@ describe('VnSearchBar', () => {
});
it('should stay on the list page if there are several results or none', () => {
+ cy.typeSearchbar('salesA{enter}');
cy.typeSearchbar('salesA{enter}');
checkTableLength(2);
cy.clearSearchbar();
+
cy.typeSearchbar('0{enter}');
checkTableLength(0);
});
@@ -27,6 +29,7 @@ describe('VnSearchBar', () => {
const searchAndCheck = (searchTerm, expectedText) => {
cy.clearSearchbar();
cy.typeSearchbar(`${searchTerm}{enter}`);
+ cy.typeSearchbar(`${searchTerm}{enter}`);
cy.get(idGap).should('have.text', expectedText);
};
diff --git a/test/cypress/integration/worker/workerCreate.spec.js b/test/cypress/integration/worker/workerCreate.spec.js
index 50afe1892..7f2810395 100644
--- a/test/cypress/integration/worker/workerCreate.spec.js
+++ b/test/cypress/integration/worker/workerCreate.spec.js
@@ -1,6 +1,5 @@
describe('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)';
- const notification = '.q-notification__message';
const developerBossId = 120;
const payMethodCross =
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
@@ -41,7 +40,7 @@ describe('WorkerCreate', () => {
cy.fillInForm(internal);
cy.get(payMethodCross).click();
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Payment method is required');
+ cy.checkNotification('Payment method is required');
});
it('should create an internal', () => {
@@ -50,13 +49,13 @@ describe('WorkerCreate', () => {
'Pay method': { val: 'PayMethod one', type: 'select' },
});
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Data created');
+ cy.checkNotification('Data created');
});
it('should create an external', () => {
cy.get(externalRadio).click();
cy.fillInForm(external);
cy.get(saveBtn).click();
- cy.get(notification).should('contains.text', 'Data created');
+ cy.checkNotification('Data created');
});
});
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
index 6229039b7..95a075fb3 100644
--- a/test/cypress/integration/zone/zoneBasicData.spec.js
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -1,5 +1,4 @@
describe('ZoneBasicData', () => {
- const notification = '.q-notification__message';
const priceBasicData = '[data-cy="Price_input"]';
beforeEach(() => {
@@ -11,13 +10,13 @@ describe('ZoneBasicData', () => {
it('should throw an error if the name is empty', () => {
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get('.q-btn-group > .q-btn--standard').click();
- cy.get(notification).should('contains.text', "can't be blank");
+ cy.checkNotification("can't be blank");
});
it('should throw an error if the price is empty', () => {
cy.get(priceBasicData).clear();
cy.get('.q-btn-group > .q-btn--standard').click();
- cy.get(notification).should('contains.text', 'cannot be blank');
+ cy.checkNotification('cannot be blank');
});
it("should edit the basicData's zone", () => {
diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js
index cc5de8c6c..0f630db5d 100644
--- a/test/cypress/integration/zone/zoneCreate.spec.js
+++ b/test/cypress/integration/zone/zoneCreate.spec.js
@@ -1,6 +1,4 @@
describe('ZoneCreate', () => {
- const notification = '.q-notification__message';
-
const data = {
Name: { val: 'Zone pickup D' },
Price: { val: '3' },
@@ -24,7 +22,7 @@ describe('ZoneCreate', () => {
cy.get('input[aria-label="Close"]').type('10:00');
cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.get(notification).should('contains.text', 'Agency cannot be blank');
+ cy.checkNotification('Agency cannot be blank');
});
it('should create a zone', () => {
@@ -35,6 +33,6 @@ describe('ZoneCreate', () => {
cy.get('input[aria-label="Close"]').type('10:00');
cy.get('body').click();
cy.get('.q-mt-lg > .q-btn--standard').click();
- cy.get(notification).should('contains.text', 'Data created');
+ cy.checkNotification('Data created');
});
});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index f166a0ed1..93f6d0054 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -124,7 +124,7 @@ Cypress.Commands.add('countSelectOptions', (selector, option) => {
});
Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
- cy.waitForElement('.q-form > .q-card');
+ cy.waitForElement(form);
cy.get(`${form} input`).each(([el]) => {
cy.wrap(el)
.invoke('attr', 'aria-label')
@@ -277,7 +277,7 @@ Cypress.Commands.add('clearSearchbar', (element) => {
cy.get('[data-cy="vn-searchbar"]').clear();
});
-Cypress.Commands.add('writeSearchbar', (value) => {
+Cypress.Commands.add('typeSearchbar', (value) => {
cy.get('[data-cy="vn-searchbar"]').type(value);
});