This commit is contained in:
parent
2555d2b2d1
commit
315c089936
|
@ -138,23 +138,20 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
|
||||||
|
|
||||||
Cypress.Commands.add('removeRow', (rowIndex) => {
|
Cypress.Commands.add('removeRow', (rowIndex) => {
|
||||||
let rowsBefore;
|
let rowsBefore;
|
||||||
let rowsAfter;
|
cy.get('tbody > tr:visible')
|
||||||
|
|
||||||
cy.get('tr')
|
|
||||||
.its('length')
|
.its('length')
|
||||||
.then((length) => {
|
.then((length) => {
|
||||||
rowsBefore = length;
|
|
||||||
cy.get('.q-checkbox').eq(rowIndex).click();
|
cy.get('.q-checkbox').eq(rowIndex).click();
|
||||||
cy.removeCard();
|
cy.removeCard();
|
||||||
cy.get('.q-dialog button').eq(2).click();
|
cy.get('.q-dialog button').eq(2).click();
|
||||||
|
rowsBefore = length;
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
cy.get('tr')
|
// Check the existence of tbody before performing the second assertion.
|
||||||
.its('length')
|
cy.get('tbody').then(($tbody) => {
|
||||||
.then((length) => {
|
if ($tbody.length > 0)
|
||||||
rowsAfter = length;
|
cy.get('tbody > tr:visible').should('have.length', rowsBefore - 1);
|
||||||
expect(rowsBefore).to.eq(rowsAfter + 1);
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Cypress.Commands.add('openListSummary', (row) => {
|
Cypress.Commands.add('openListSummary', (row) => {
|
||||||
|
|
Loading…
Reference in New Issue