keycloak-scim/cypress/support/util/ModalUtils.ts
Erik Jan de Wit 6a970e6cb7
updated and fixed user test (#1956)
* updated and fixed user test

* Update cypress/integration/users_test.spec.ts

* fixed the confirm button test id

* fixed tests

* fix

* removed unused refresh

Co-authored-by: Jenny <32821331+jenny-s51@users.noreply.github.com>
2022-02-02 12:44:52 +01:00

38 lines
844 B
TypeScript

export default class ModalUtils {
private modalTitle = ".pf-c-modal-box .pf-c-modal-box__title-text";
private modalMessage = ".pf-c-modal-box .pf-c-modal-box__body";
private confirmModalBtn = "confirm";
private cancelModalBtn = "cancel";
private closeModalBtn = ".pf-c-modal-box .pf-m-plain";
confirmModal(force = false) {
cy.findByTestId(this.confirmModalBtn).click({ force });
return this;
}
cancelModal() {
cy.findByTestId(this.cancelModalBtn).click();
return this;
}
closeModal() {
cy.get(this.closeModalBtn).click();
return this;
}
checkModalTitle(title: string) {
cy.get(this.modalTitle).invoke("text").should("eq", title);
return this;
}
checkModalMessage(message: string) {
cy.get(this.modalMessage).invoke("text").should("eq", message);
return this;
}
}