Tengo poca experiencia con Java. por eso te pido ayuda. la situacion es asi
Aquí está mi código. Estoy más que seguro de que está equivocado. Y ayúdenme a escribir correctamente "número de líneas - 1" en el último paso. Gracias !
it('Step 5 - get the table row count', () => { cy.getByTestId('user-management-roles-table-container') .find("tr") .then((row) => { //row.length will give you the row count cy.log(String(row.length)) }); }); it('Step 6 - Click on the 3 dots', () => { cy.getByTestId('button-group-buttonGroup-dropdown-button').first().click(); cy.getByTestId('select-menu-buttonGroup-items-wrapper').should('be.visible'); }); it('Step 7 - Click on the "Delete" button', () => { cy.getByTestId('select-menu-buttonGroup-value-delete').click(); }); it('Step 8 - ', () => { cy.getByTestId('user-management-roles-table-container').find('tr').its('length').should('eq', "number of lines - 1" ); }); ```Puedes hacer algo como esto:
let lenBefore; it('Step 5 - get the before table row count', () => { cy.getByTestId('user-management-roles-table-container').find("tr").its('length').then((len) => { lenBefore = len; cy.log('Initial table Length is: ' + lenBefore); }); }); it('Step 6 - Click on the 3 dots', () => { cy.getByTestId('button-group-buttonGroup-dropdown-button').first().click(); cy.getByTestId('select-menu-buttonGroup-items-wrapper').should('be.visible'); }); it('Step 7 - Click on the "Delete" button', () => { cy.getByTestId('select-menu-buttonGroup-value-delete').click(); }); it('Step 5 - get the after table row count', () => { cy.getByTestId('user-management-roles-table-container').find("tr").its('length').then((lenAfter) => { cy.log('After table Length is: ' + lenAfter); expect(lenBefore).to.equal(lenAfter - 1); }); });