Files
portal/tests/e2e/health.spec.ts
T
sharang 99fe3b55b2
ci / shared (push) Successful in 4s
ci / test (push) Successful in 23s
ci / e2e (push) Has been skipped
ci / image (push) Has been skipped
feat(test): M5.3 — Playwright e2e harness for the dev stack
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
2026-05-19 14:53:18 +00:00

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");
});
});