From 315c089936b551e14c5a7652ce8111c25408e1e9 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 10 Jan 2024 14:01:36 +0100 Subject: [PATCH] fix: refs #6643 fix tests --- test/cypress/support/commands.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 4dfde6e21..fc3a593ad 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -138,23 +138,20 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => { Cypress.Commands.add('removeRow', (rowIndex) => { let rowsBefore; - let rowsAfter; - - cy.get('tr') + cy.get('tbody > tr:visible') .its('length') .then((length) => { - rowsBefore = length; cy.get('.q-checkbox').eq(rowIndex).click(); cy.removeCard(); cy.get('.q-dialog button').eq(2).click(); + rowsBefore = length; }) .then(() => { - cy.get('tr') - .its('length') - .then((length) => { - rowsAfter = length; - expect(rowsBefore).to.eq(rowsAfter + 1); - }); + // Check the existence of tbody before performing the second assertion. + cy.get('tbody').then(($tbody) => { + if ($tbody.length > 0) + cy.get('tbody > tr:visible').should('have.length', rowsBefore - 1); + }); }); }); Cypress.Commands.add('openListSummary', (row) => {