Skip to content

test(e2e): QA.4 — governed chat flow (login, PII, deny, audit log)#9

Merged
Shaivpidadi merged 3 commits intodevfrom
feat/t4-e2e-chat-flow
Apr 23, 2026
Merged

test(e2e): QA.4 — governed chat flow (login, PII, deny, audit log)#9
Shaivpidadi merged 3 commits intodevfrom
feat/t4-e2e-chat-flow

Conversation

@Shaivpidadi
Copy link
Copy Markdown
Member

@Shaivpidadi Shaivpidadi commented Apr 23, 2026

Summary

  • Adds tests/e2e/governed-chat.spec.ts — 9 Playwright tests covering all four flows required by TASKS.md §QA.4 / T-4:
    • QA.4-1 OIDC login via Keycloak → redirect to /login for guests, full login handshake, logout
    • QA.4-2 PII prompt (email address) → Redact decision badge in chat UI + matching redact/transform row in platform decision log
    • QA.4-3 Malicious / bash.exec-style prompt → Block badge, red message bubble, Request blocked copy, UI stays interactive
    • QA.4-4 Any chat message → at least one decision row on the platform decisions page, org-scoped (no cross-org leakage)
  • Updates playwright.config.ts to honour BASE_URL env var (required by task spec)
  • Updates fixtures.ts defaults to the known staging deployed URLs:
    • Platform: https://platform-platform-pi.vercel.app
    • Keycloak: https://governs-keycloak.onrender.com
  • Credentials are read from KEYCLOAK_USER / KEYCLOAK_PASSWORD env vars — no hardcoded credentials

Credentials needed to run

The tests that exercise the real Keycloak login flow require:

KEYCLOAK_USER=<test-user-email>
KEYCLOAK_PASSWORD=<test-user-password>

A demo user seeded in the governs-ai Keycloak realm with access to the configured E2E_ORG_SLUG org is needed. Until CI secrets are wired, tests can be run locally against the staging stack.

Test plan

  • npx playwright test --list — 20 tests across 6 files all discovered
  • Run against staging with real credentials once KEYCLOAK_USER / KEYCLOAK_PASSWORD are available as CI secrets
  • Screenshots/traces captured on failure (configured in playwright.config.ts)

Pins the demo app to the new SDK release candidate. pnpm install and
pnpm build confirmed clean (build output unchanged). pnpm install will
fully resolve once alpha.14 is published via:

  cd typescript-sdk && npm adduser && npm publish --tag alpha
Adds governed-chat.spec.ts covering all four flows required by TASKS.md §QA.4:

  1. QA.4-1  OIDC login via Keycloak → chat UI loads (redirect, login, logout)
  2. QA.4-2  PII prompt → Redact badge in chat + matching entry in decisions log
  3. QA.4-3  Malicious / bash.exec-style prompt → Block badge + red UI bubble
  4. QA.4-4  Audit log — decisions page shows at least one row with correct org scope

Updates playwright.config.ts to honour BASE_URL env var (task requirement).
Updates fixtures.ts defaults to staging deployed URLs:
  - Platform:  https://platform-platform-pi.vercel.app
  - Keycloak:  https://governs-keycloak.onrender.com
Credentials are read from KEYCLOAK_USER / KEYCLOAK_PASSWORD env vars.

All 20 tests (6 files) verified discovered via `npx playwright test --list`.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-agent-example Ready Ready Preview, Comment Apr 23, 2026 2:27pm

@Shaivpidadi Shaivpidadi merged commit 542f2e2 into dev Apr 23, 2026
4 checks passed
@Shaivpidadi Shaivpidadi deleted the feat/t4-e2e-chat-flow branch April 23, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant