keycloak-scim/cypress/support/pages/admin_console/components/FormPage.ts
2022-04-19 08:25:57 -04:00

35 lines
704 B
TypeScript

import CommonElements from "../../CommonElements";
export default class FormPage extends CommonElements {
constructor() {
super(".pf-c-form:visible");
}
save() {
cy.get(this.primaryBtn).contains("Save").click();
return this;
}
add() {
cy.get(this.primaryBtn).contains("Add").click();
return this;
}
cancel() {
cy.get(this.secondaryBtnLink).contains("Cancel").click();
return this;
}
revert() {
cy.get(this.secondaryBtnLink).contains("Revert").click();
return this;
}
checkSaveButtonIsDisabled(disabled: boolean) {
this.checkElementIsDisabled(
cy.get(this.primaryBtn).contains("Save"),
disabled
);
return this;
}
}