keycloak-scim/tests/cypress/support/util/ModalUtils.js
Stan Silvert f2e26b0049
Cypress tests for masthead. (#304)
* Cypress tests for masthead.

* Update snapshot

* Update Keycloak version.

* Fix download address

* Update start.js

Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Follow redirect when downloading keycloak.

* Refactor HeaderPage into Masthead and ModalUtils

* Minor change to kick off build.

* logOutTest no longer needs a param

* goToAcctMgtTest no longer needs a param

* Update tests/cypress/support/pages/admin_console/Masthead.js

Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com>

* Update tests/cypress/support/pages/admin_console/Masthead.js

Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com>

* Fix userDropdown() method

* Minor refactor

Co-authored-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Co-authored-by: Aboullos <61687012+Aboullos@users.noreply.github.com>
2021-01-21 07:09:50 -05:00

40 lines
819 B
JavaScript

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