Files
keycloak/js/apps/admin-ui/test/utils/sidebar.ts
Erik Jan de Wit 3b5f1b2565 change the realm selector into a section (#38169)
* change the realm selector into a section

fixes: #38112

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

make realms a section and remove realm selector

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* pr feedback

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed tests

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed realm test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* update nav items

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fixed markup

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* fix test

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* only show manage when you are logged in via master realm

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* add fallback for when no realm access still see manage realms

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* change link to go to realm dashboard

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* change recent realms to go to dashboard

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

---------

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
2025-03-27 14:33:45 -04:00

63 lines
1.7 KiB
TypeScript

import { Page } from "@playwright/test";
import { clickTableRowItem } from "./table";
export async function goToRealm(page: Page, realmName: string) {
const currentRealm = await page.getByTestId("currentRealm").textContent();
if (currentRealm !== realmName) {
await goToRealms(page);
await clickTableRowItem(page, realmName);
}
}
export async function goToRealms(page: Page) {
await page.getByTestId("nav-item-realms").click();
}
export async function goToOrganizations(page: Page) {
page.getByTestId("nav-item-organizations").click();
}
export async function goToClients(page: Page) {
await page.getByTestId("nav-item-clients").click();
}
export async function goToClientScopes(page: Page) {
await page.getByTestId("nav-item-client-scopes").click();
}
export async function goToRealmRoles(page: Page) {
await page.getByTestId("nav-item-roles").click();
}
export async function goToUsers(page: Page) {
await page.getByTestId("nav-item-users").click();
}
export async function goToGroups(page: Page) {
await page.getByTestId("nav-item-groups").click();
}
export async function goToSessions(page: Page) {
await page.getByTestId("nav-item-sessions").click();
}
export async function goToEvents(page: Page) {
await page.getByTestId("nav-item-events").click();
}
export async function goToRealmSettings(page: Page) {
await page.getByTestId("nav-item-realm-settings").click();
}
export async function goToAuthentication(page: Page) {
await page.getByTestId("nav-item-authentication").click();
}
export async function goToIdentityProviders(page: Page) {
await page.getByTestId("nav-item-identity-providers").click();
}
export async function goToUserFederation(page: Page) {
await page.getByTestId("nav-item-user-federation").click();
}