diff --git a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js index 145f492a19..ecd26f4c5a 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutMakeInvoice.spec.js @@ -1,5 +1,6 @@ /// describe('InvoiceOut manual invoice', () => { + const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list'; beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); @@ -7,15 +8,25 @@ describe('InvoiceOut manual invoice', () => { cy.get('#searchbar input').type('{enter}'); }); - it('should create an invoice from a ticket and go to that invoice', () => { + it('should create an invoice from a ticket and go to that invoice, then delete that invoice', () => { cy.searchByLabel('Customer ID', '1101'); cy.get( - '[data-q-vs-anchor=""] > :nth-child(1) > .q-checkbox > .q-checkbox__inner' + '[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(); + cy.get('[href="#/invoice-out/6/summary"] > .q-btn > .q-btn__content').click(); + cy.dataCy('descriptor-more-opts').click(); + cy.get(descriptorOptions) + .find('.q-item') + .its('length') + .then((count) => { + cy.log('NĂºmero de opciones:', count); + expect(count).to.equal(7); + }); + cy.get('[data-cy="descriptor-more-opts-menu"] > .q-list > :nth-child(4)').click(); + cy.get('[data-cy="VnConfirm_confirm"]').click(); }); }); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index 0213ef7863..5114e6e3bb 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -32,7 +32,7 @@ describe('InvoiceOut summary', () => { }); it('should open the ticket list', () => { - cy.get(toTicketList).click(); + cy.dataCy('invoiceOutDescriptorTicketList').click(); cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111'); }); @@ -61,14 +61,6 @@ describe('InvoiceOut summary', () => { cy.checkNotification('Notification sent'); }); - it('should delete an invoice ', () => { - cy.typeSearchbar('T2222222{enter}'); - cy.dataCy('descriptor-more-opts').click(); - cy.get(selectMenuOption(4)).click(); - cy.dataCy('VnConfirm_confirm').click(); - cy.checkNotification('InvoiceOut deleted'); - }); - it('should book the invoice', () => { cy.dataCy('descriptor-more-opts').click(); cy.get(selectMenuOption(5)).click();