From a9e8621903f8aabbb6bc85fc91c7648cf2314ca6 Mon Sep 17 00:00:00 2001 From: jorgep Date: Fri, 9 Aug 2024 10:47:15 +0200 Subject: [PATCH] chore: refs #6900 fix e2e tests --- .../integration/invoiceIn/invoiceInIntrastat.spec.js | 11 ++++++----- .../integration/invoiceIn/invoiceInList.spec.js | 12 ++++++------ .../integration/invoiceIn/invoiceInVat.spec.js | 3 +-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js index a297a60f4..f6dac4c73 100644 --- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js @@ -1,8 +1,9 @@ /// describe('InvoiceInIntrastat', () => { - const inputBtns = 'label button'; + const firstRow = 'tbody > :nth-child(1)'; const thirdRow = 'tbody > :nth-child(3)'; - const firstLineCode = 'tbody > :nth-child(1) > :nth-child(2)'; + const firstRowCode = `${firstRow} > :nth-child(2)`; + const firstRowAmount = `${firstRow} > :nth-child(3)`; beforeEach(() => { cy.login('developer'); @@ -10,10 +11,10 @@ describe('InvoiceInIntrastat', () => { }); it('should edit the first line', () => { - cy.selectOption(firstLineCode, 'Plantas vivas: Esqueje/injerto, Vid'); - cy.get(inputBtns).eq(1).click(); + cy.selectOption(firstRowCode, 'Plantas vivas: Esqueje/injerto, Vid'); + cy.get(firstRowAmount).clear(); cy.saveCard(); - cy.get(`${firstLineCode} span`).should( + cy.get(`${firstRowCode} span`).should( 'have.text', '6021010:Plantas vivas: Esqueje/injerto, Vid' ); diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index b2fa10d52..fa0d1c5e4 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -1,23 +1,23 @@ /// describe('InvoiceInList', () => { - const firstCard = '.q-card:nth-child(1)'; - const firstChipId = - ':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content'; - const firstDetailBtn = '.q-card:nth-child(1) .q-btn:nth-child(2)'; + const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)'; + const firstId = `${firstRow} > td:nth-child(1) span`; + const firstDetailBtn = `${firstRow} .q-btn:nth-child(1)`; const summaryHeaders = '.summaryBody .header-link'; beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-in/list`); + cy.get('#searchbar input').type('{enter}'); }); it('should redirect on clicking a invoice', () => { - cy.get(firstChipId) + cy.get(firstId) .invoke('text') .then((content) => { const id = content.replace(/\D/g, ''); - cy.get(firstCard).click(); + cy.get(firstRow).click(); cy.url().should('include', `/invoice-in/${id}/summary`); }); }); diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js index 932aca96d..018ae7a53 100644 --- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js @@ -4,8 +4,7 @@ describe('InvoiceInVat', () => { 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 acrossInput = 'tbody tr:nth-child(1) td:nth-child(2) .default-icon'; const randomInt = Math.floor(Math.random() * 100); beforeEach(() => {