keycloak-scim/cypress/support/pages/admin_console/components/ActionToolbarPage.ts
2022-07-12 16:29:59 +02:00

37 lines
967 B
TypeScript

import CommonElements from "../../CommonElements";
export default class ActionToolbarPage extends CommonElements {
constructor() {
super(".pf-l-level.pf-m-gutter");
}
get bearerOnlyExplainerLabelElement() {
return cy
.get(this.parentSelector)
.findByTestId("bearer-only-explainer-label");
}
get bearerOnlyExplainerTooltipElement() {
return cy.findByTestId("bearer-only-explainer-tooltip");
}
clickActionToggleButton() {
cy.get(this.parentSelector).findByTestId("action-dropdown").click();
return this;
}
private getDropdownItem(itemName: string) {
return cy.get(this.dropdownMenuItem).contains(itemName);
}
checkActionItemExists(itemName: string, exists: boolean) {
const condition = exists ? "exist" : "not.exist";
this.getDropdownItem(itemName).should(condition);
return this;
}
clickDropdownItem(itemName: string) {
this.getDropdownItem(itemName).click();
return this;
}
}