/// describe('InvoiceOut list', () => { const serial = 'EspaƱola rapida'; const columnCheckbox = '.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner'; const firstRowDescriptor = 'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link'; const firstRowCheckbox = 'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner '; const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon'; const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content'; const firstSummaryIcon = ':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon'; beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-out/list`); cy.typeSearchbar('{enter}'); }); it('should download one pdf from the subtoolbar button', () => { cy.get(firstRowCheckbox).click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click(); }); it('should download all pdfs', () => { cy.get(columnCheckbox).click(); cy.dataCy('InvoiceOutDownloadPdfBtn').click(); }); it('should open the invoice descriptor from table icon', () => { cy.get(firstSummaryIcon).click(); cy.get('.cardSummary').should('be.visible'); cy.get('.summaryHeader > div').should('include.text', 'A1111111'); }); it('should open the client descriptor', () => { cy.get(firstRowDescriptor).click(); cy.get(summaryPopupIcon).click(); }); it('should filter the results by client ID, then check the first result is correct', () => { cy.dataCy('Customer ID_input').type('1103'); cy.get(filterBtn).click(); cy.get(firstRowDescriptor).click(); cy.get('.q-item > .q-item__label').should('include.text', '1103'); }); it('should give an error when manual invoicing a ticket that is already invoiced', () => { cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('InvoiceOutCreateTicketinput').type(1); cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('This ticket is already invoiced'); }); it('should create a manual invoice and enter to its summary, then delete that invoice', () => { cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('InvoiceOutCreateTicketinput').type(9); cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial); cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); cy.dataCy('descriptor-more-opts').click(); cy.get('.q-menu > .q-list > :nth-child(4)').click(); cy.dataCy('VnConfirm_confirm').click(); }); });