78f843cdcc
* 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
27 lines
692 B
TypeScript
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;
|
|
}
|
|
}
|