test(e2e): improve error reporting (#4931)

* cleanup

* test(e2e): improve error reporting

* lint

* lint

* better timeout messages

* fix shouldNotExist
This commit is contained in:
Elio Bischof
2023-01-04 13:38:27 +00:00
committed by GitHub
parent dc2a4ea92c
commit 35faa1b233
12 changed files with 84 additions and 225 deletions
+6 -5
View File
@@ -32,14 +32,13 @@ describe('humans', () => {
cy.get('[formcontrolname="lastName"]').type('e2ehumanlastname');
cy.get('[formcontrolname="phone"]').type('+41 123456789');
cy.get('[data-e2e="create-button"]').click();
cy.get('.data-e2e-success');
cy.shouldConfirmSuccess();
let loginName = user.addName;
if (user.mustBeDomain) {
loginName = loginname(user.addName, Cypress.env('ORGANIZATION'));
}
cy.contains('[data-e2e="copy-loginname"]', loginName).click();
cy.clipboardMatches(loginName);
cy.shouldNotExist({ selector: '.data-e2e-failure' });
});
});
@@ -58,9 +57,11 @@ describe('humans', () => {
cy.get(rowSelector).find('[data-e2e="enabled-delete-button"]').click({ force: true });
cy.get('[data-e2e="confirm-dialog-input"]').focus().type(loginName);
cy.get('[data-e2e="confirm-dialog-button"]').click();
cy.get('.data-e2e-success');
cy.shouldNotExist({ selector: rowSelector, timeout: 2000 });
cy.shouldNotExist({ selector: '.data-e2e-failure' });
cy.shouldConfirmSuccess();
cy.shouldNotExist({
selector: rowSelector,
timeout: { ms: 2000, errMessage: 'timed out before human disappeared from the table' },
});
});
});
});