99fe3b55b2
playwright.config.ts + tests/e2e/{apex,tenant,health}.spec.ts. make e2e for local. CI e2e job opt-in via RUN_E2E repo variable. OIDC click-through deferred to when stage is up.
Refs: M5.3
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
|
|
// Health checks — confirm the underlying services are reachable before the
|
|
// stack-dependent tests run. Skips with a clear reason if anything is down,
|
|
// so we don't waste 30s on a slow OIDC redirect when Keycloak isn't running.
|
|
|
|
test.describe("dev stack health @needs-stack", () => {
|
|
test("portal /api/auth/providers responds", async ({ request }) => {
|
|
const r = await request.get("/api/auth/providers");
|
|
expect(r.status()).toBe(200);
|
|
const data = await r.json();
|
|
expect(data).toHaveProperty("keycloak");
|
|
});
|
|
|
|
test("tenant-registry /healthz responds", async ({ request }) => {
|
|
const url =
|
|
process.env.PLAYWRIGHT_TENANT_REGISTRY_URL ?? "http://localhost:8090";
|
|
const r = await request.get(`${url}/healthz`);
|
|
expect(r.status()).toBe(200);
|
|
expect(await r.json()).toMatchObject({ status: "ok" });
|
|
});
|
|
|
|
test("keycloak realm metadata is exposed", async ({ request }) => {
|
|
const url =
|
|
process.env.PLAYWRIGHT_KEYCLOAK_URL ??
|
|
"http://localhost:8080/realms/breakpilot-dev";
|
|
const r = await request.get(`${url}/.well-known/openid-configuration`);
|
|
expect(r.status()).toBe(200);
|
|
const cfg = await r.json();
|
|
expect(cfg.issuer).toContain("breakpilot-dev");
|
|
});
|
|
});
|