keycloak-scim/cypress/support/pages/admin_console/components/ActionToolbarPage.ts

38 lines
967 B
TypeScript
Raw Normal View History

2022-04-19 12:25:57 +00:00
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;
}
2022-07-12 14:29:59 +00:00
private getDropdownItem(itemName: string) {
return cy.get(this.dropdownMenuItem).contains(itemName);
}
2022-04-19 12:25:57 +00:00
checkActionItemExists(itemName: string, exists: boolean) {
const condition = exists ? "exist" : "not.exist";
2022-07-12 14:29:59 +00:00
this.getDropdownItem(itemName).should(condition);
return this;
}
clickDropdownItem(itemName: string) {
this.getDropdownItem(itemName).click();
2022-04-19 12:25:57 +00:00
return this;
}
}