diff --git a/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js b/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js index ee5ffe08d1..f39c808099 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js @@ -1,7 +1,6 @@ /// describe('InvoiceInDueDay', () => { const inputs = 'label input'; - const inputBtns = 'label button'; const addBtn = '.q-page-sticky > div > .q-btn > .q-btn__content'; beforeEach(() => { @@ -10,7 +9,6 @@ describe('InvoiceInDueDay', () => { }); it('should update the amount', () => { - cy.get(inputBtns).eq(1).click(); cy.get(inputs).eq(3).type(23); cy.saveCard(); cy.get('.q-notification__message').should('have.text', 'Data saved'); diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js index 2f045f32c9..ff891399b6 100644 --- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js @@ -1,11 +1,11 @@ /// describe('InvoiceInVat', () => { - const inputs = 'label input'; - const inputBtns = 'label button'; const thirdRow = 'tbody > :nth-child(3)'; const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)'; const dialogInputs = '.q-dialog label input'; const dialogBtns = '.q-dialog button'; + const acrossInput = + ':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon'; const randomInt = Math.floor(Math.random() * 100); beforeEach(() => { @@ -13,11 +13,8 @@ describe('InvoiceInVat', () => { cy.visit(`/#/invoice-in/1/vat`); }); - it('should edit the first line', () => { - cy.get(inputBtns).eq(1).click(); - cy.get(inputs).eq(2).type(23); + it('should edit the sage iva', () => { cy.selectOption(firstLineVat, 'H.P. IVA 21% CEE'); - cy.saveCard(); cy.visit(`/#/invoice-in/1/vat`); @@ -36,16 +33,13 @@ describe('InvoiceInVat', () => { }); it('should throw an error if there are fields undefined', () => { - cy.get(inputBtns).eq(0).click(); - cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click(); + cy.get(acrossInput).click(); cy.get(dialogBtns).eq(2).click(); cy.get('.q-notification__message').should('have.text', "The code can't be empty"); }); it('should correctly handle expense addition', () => { - cy.get(inputBtns).eq(0).click(); - - cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click(); + cy.get(acrossInput).click(); cy.get(dialogInputs).eq(0).type(randomInt); cy.get(dialogInputs).eq(1).click(); cy.get(dialogInputs).eq(1).type('This is a dummy expense');