keycloak-scim/cypress/support/pages/admin_console/manage/authentication/DuplicateFlowModal.ts
2022-05-18 11:16:47 +02:00

21 lines
615 B
TypeScript

export default class DuplicateFlowModal {
private aliasInput = "alias";
private descriptionInput = "description";
private confirmButton = "confirm";
private errorText = ".pf-m-error";
fill(name?: string, description?: string) {
cy.findByTestId(this.aliasInput).clear();
if (name) {
cy.findByTestId(this.aliasInput).type(name);
if (description) cy.get(this.descriptionInput).type(description);
}
cy.findByTestId(this.confirmButton).click();
return this;
}
shouldShowError(message: string) {
cy.get(this.errorText).invoke("text").should("contain", message);
}
}