feat(ui-test): Playwright ui tests foundation stage 0#2262
Open
cjlg-soloio wants to merge 19 commits into
Open
feat(ui-test): Playwright ui tests foundation stage 0#2262cjlg-soloio wants to merge 19 commits into
cjlg-soloio wants to merge 19 commits into
Conversation
Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: cjlg-soloio <carlos.logrono@solo.io> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
- Force single Playwright worker unconditionally (shared stub + Next server) - Default req.method/req.url before parsing in the stub server - Fail fast on stub reset failure in CI; stay non-fatal locally - Drop unused pull-requests:write permission from the workflow Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Pairs fullyParallel with workers: 1 so both stay off until per-test data isolation lands, preventing tests from silently racing against the shared stub backend if the worker count is raised. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
- Pin STUB_PORT on the stub webServer so a shell-set STUB_PORT can't misbind it - Stop reusing the dev server so BACKEND_INTERNAL_URL always applies (no silent stub bypass) - Type ToolServerListEntry as the real RemoteMCPServerResponse for compile-time drift detection - Drop no-op **/*.mjs from the playwright tsconfig include Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
…ght video Resolve Charlesthebird's review on PR kagent-dev#2180: - Playwright workflow now reads node-version-file: ui/.nvmrc instead of a hardcoded major version. - Remove Cypress entirely: delete cypress.config.ts and cypress/e2e/smoke.cy.ts, drop the cypress and now-unused start-server-and-test devDeps plus the test:e2e/test:e2e:cypress scripts, and remove the dead CYPRESS_INSTALL_BINARY env from the ui-playwright, ci, and ui-chromatic workflows and the Dockerfile. - Enable Playwright video recording (video: "on"); artifacts already upload via the existing test-results step. - De-Cypress the Playwright README (Jest, Vitest, Storybook untouched). data.ts is intentionally kept — it is consumed by the stacked stage-2 PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Restore a conventional test:e2e entrypoint pointing at the Playwright suite, per review feedback on kagent-dev#2180. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Charlesthebird
approved these changes
Jul 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a Stage 0 Playwright E2E testing foundation for the ui/ Next.js app, running against a local stub backend to enable cross-component flow testing without requiring a Kubernetes cluster.
Changes:
- Adds Playwright configuration, fixtures, a stub backend, and an initial smoke test for the Agents page.
- Adds a dedicated GitHub Actions workflow to run Playwright on
ui/**changes and upload reports/artifacts. - Removes Cypress E2E scaffolding and related CI/Dockerfile knobs in favor of Playwright.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
ui/playwright.config.ts |
Playwright runner config that boots the stub backend + next dev via webServer. |
ui/playwright/fixtures/test.ts |
Shared fixture that resets the stub and bypasses onboarding for deterministic tests. |
ui/playwright/tests/smoke.spec.ts |
Stage 0 smoke test asserting the Agents page renders and no fatal page errors occur. |
ui/playwright/mocks/server.mjs |
Dependency-free Node http stub backend serving /api/* happy-path responses plus control/health endpoints. |
ui/playwright/mocks/data.ts |
Typed mock builders for spec-side assertions / future scenario injection. |
ui/playwright/tsconfig.json |
TS config for Playwright tests/types, extending the UI’s TS config. |
ui/playwright/README.md |
Documentation for scope, mocking approach (server-side fetch redirection), conventions, and roadmap. |
.github/workflows/ui-playwright.yaml |
New CI workflow to run Playwright against the stubbed backend and upload reports. |
ui/package.json |
Adds @playwright/test and Playwright scripts; maps test:e2e to Playwright. |
ui/package-lock.json |
Lockfile updates for Playwright/Cypress dependency changes. |
ui/.gitignore |
Ignores Playwright report and test-results outputs. |
ui/Dockerfile |
Removes CYPRESS_INSTALL_BINARY since Cypress is no longer used. |
.github/workflows/ui-chromatic.yaml |
Removes Cypress-related env var from UI dependency install step. |
.github/workflows/ci.yaml |
Removes Cypress-related env var from UI dependency install step. |
ui/cypress/e2e/smoke.cy.ts |
Removes Cypress smoke/regression E2E spec. |
ui/cypress.config.ts |
Removes Cypress configuration. |
Files not reviewed (1)
- ui/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- rename fixture callback param to `provide` (drops the rules-of-hooks eslint-disable) - record video only on failure to match screenshot/trace - pin @playwright/test and playwright to aligned 1.61.1 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
Charlesthebird
approved these changes
Jul 15, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
EItanya
approved these changes
Jul 15, 2026
Charlesthebird
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the Stage 0 foundation for Playwright page-level E2E testing of the kagent UI, running against a mocked backend with no cluster required.
The suite targets the one gap nothing else covers — multi-step user flows across components:
The core design challenge: the UI fetches data server-side via Next.js server actions, so browser-level
page.route("**/api/**")intercepts nothing. Instead, this PR boots a dependency-free stub backend and redirects Next's server-side fetch to it viaBACKEND_INTERNAL_URL— whichgetBackendUrl()inui/src/lib/utils.tsalready honors. Playwright'swebServerblock starts both the stub (:8899) andnext dev(:8001) automatically.This is foundation-only: config, stub backend, shared fixture, CI workflow, and a single smoke test. The helper/driver library and per-test scenarios land in Stage 1; feature flows in Stage 3 (see
ui/playwright/README.md).Files
New
ui/playwright.config.tsui/playwright/mocks/server.mjshttponly); serves happy-path payloads mirroringsrc/types/index.ts; exposes/__mock/health&/__mock/resetui/playwright/mocks/data.tsui/playwright/fixtures/test.tstest/expectfixture; resets stub per test and bypasses first-run onboardingui/playwright/tests/smoke.spec.tsui/playwright/tsconfig.jsonui/playwright/README.md.github/workflows/ui-playwright.yamlui/**); installs chromium, runstest:pw, uploads reportModified
ui/package.json—@playwright/testdev dep +test:pw/test:pw:ui/test:pw:debugscriptsui/package-lock.json— lockfile updatesui/.gitignore— ignoresplaywright-report,playwright/test-results,playwright/.cacheTesting
Playwright starts the stub backend and dev server automatically. The smoke test passes when the home page renders the Agents, no "Error Encountered" state appears, and no uncaught page errors occur. CI runs the same on any
ui/**change.Change type
test / ci — new test infrastructure and CI workflow. No product or runtime code changed.
Changelog
Stage 1 of 3 playwright tests for ui