This commit is contained in:
parent
2555d2b2d1
commit
315c089936
|
@ -138,22 +138,19 @@ 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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue