/// describe('InvoiceOut list', () => { const notification = '.q-notification__message'; const invoice = { Ticket: { val: '8' }, Serial: { val: 'EspaƱola rapida', 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}'); cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}'); }); it('should download a pdf', () => { 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.get(notification).should('contains.text', '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.get(notification).should('contains.text', 'Data created'); }); });