keycloak-scim/cypress/support/pages/admin_console/RealmSelector.ts
Erik Jan de Wit 78f843cdcc
Fixes with realm list (#576)
* only query realms endpoint once

currently the realm list query is expensive and we only need it once.

* fixed refresh issues

* fixed tests

* fixed imports

* fixed types

* removed strange non code

* reload instead

* added more realm tests
2021-05-03 12:44:47 -04:00

27 lines
692 B
TypeScript

const expect = chai.expect;
export default class RealmSelector {
private realmSelector = "realmSelector";
private realmContextSelector = ".keycloak__realm_selector__context_selector";
shouldContainAll(realmsList: string[]) {
cy.getId(this.realmSelector)
.scrollIntoView()
.get("ul")
.should((realms) => {
for (let index = 0; index < realmsList.length; index++) {
const realmName = realmsList[index];
expect(realms).to.contain(realmName);
}
});
return this;
}
openRealmContextSelector() {
cy.getId(this.realmSelector).scrollIntoView();
cy.get(this.realmContextSelector).click();
return this;
}
}