removed flacky test (#2020)

This commit is contained in:
Erik Jan de Wit 2022-02-07 13:10:19 +01:00 committed by GitHub
parent d85ff6e9be
commit 39107ac8ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 48 deletions

View file

@ -3,7 +3,6 @@ import SidebarPage from "../support/pages/admin_console/SidebarPage";
import CreateRealmPage from "../support/pages/admin_console/CreateRealmPage";
import Masthead from "../support/pages/admin_console/Masthead";
import AdminClient from "../support/util/AdminClient";
import RealmSelector from "../support/pages/admin_console/RealmSelector";
import {
keycloakBefore,
keycloakBeforeEach,
@ -13,7 +12,6 @@ const masthead = new Masthead();
const loginPage = new LoginPage();
const sidebarPage = new SidebarPage();
const createRealmPage = new CreateRealmPage();
const realmSelector = new RealmSelector();
const adminClient = new AdminClient();
describe("Realms test", () => {
@ -78,23 +76,4 @@ describe("Realms test", () => {
.should("eq", testRealmName);
});
});
describe("More then 5 realms", () => {
const realmNames = ["One", "Two", "Three", "Four", "Five"];
before(() => {
keycloakBefore();
loginPage.logIn();
realmNames.map((realm) => adminClient.createRealm(realm));
});
after(() => {
for (const realmName of realmNames) {
adminClient.deleteRealm(realmName);
}
});
it("switch to searchable realm selector", () => {
realmSelector.openRealmContextSelector().shouldContainAll(realmNames);
});
});
});

View file

@ -1,27 +0,0 @@
const expect = chai.expect;
export default class RealmSelector {
private realmSelector = "realmSelector";
private realmContextSelector = ".keycloak__realm_selector__context_selector";
shouldContainAll(realmsList: string[]) {
cy.findByTestId(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.findByTestId(this.realmSelector).scrollIntoView();
cy.get(this.realmContextSelector).click();
return this;
}
}