feat(ui-test): Playwright ui tests helpers + per-test scenarios stage 1#2196
Draft
cjlg-soloio wants to merge 9 commits into
Draft
feat(ui-test): Playwright ui tests helpers + per-test scenarios stage 1#2196cjlg-soloio wants to merge 9 commits into
cjlg-soloio wants to merge 9 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>
Builds on the Stage 0 foundation to unlock non-happy-path testing and give
specs a small, proven driver surface:
- Scenario-override engine in the stub backend: POST /__mock/scenario sets a
per-endpoint { status, body } override; /__mock/reset clears them. Default
stays the happy path.
- Typed control seam (mocks/control.ts) surfaced as a `mock` fixture
(mock.noAgents(), mock.agentsError(), ...); the fixture resets the stub
before every test so scenarios never leak between tests.
- page.ts (loadPage, expectNoErrors, expectToast) and nav.ts (dropdown-aware
gotoView/gotoCreate) driver helpers.
- home spec (happy / empty / error) proving the engine, and a nav spec proving
dropdown routing.
Form/select/dialog helpers are deferred to Stage 2 (built demand-driven with the
create-agent flow).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Carlos Logroño Guerrero <carlos.logrono@solo.io>
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
Stage 1 of the Playwright UI E2E suite — builds on the Stage 0 foundation to unlock non-happy-path testing and add a small, proven driver surface.
Stage 0 could only serve a fixed happy path, so specs couldn't cover empty/error states and there were no reusable driver helpers. This stage adds:
POST /__mock/scenariosets a per-endpoint{ status, body }override;POST /__mock/resetclears them. Default stays the happy path.mocks/control.ts) surfaced as amockfixture:mock.noAgents(),mock.agentsError(), etc. The fixture resets the stub before every test, so scenarios never leak between tests.page.ts(loadPage,expectNoErrors,expectToast) andnav.ts(dropdown-awaregotoView/gotoCreate).Form/select/dialog helpers are intentionally deferred to Stage 2, built demand-driven against the real create-agent flow. See
ui/playwright/README.md.Files
New
ui/playwright/mocks/control.ts/__mock/*(makeMock):noAgents,agentsError,noModelConfigs,noToolServers,setScenario,resetui/playwright/helpers/page.tsloadPage,expectNoErrors,expectToast(sonner)ui/playwright/helpers/nav.tsgotoView/gotoCreate/gotoHomeui/playwright/tests/home.spec.tsui/playwright/tests/nav.spec.tsModified
ui/playwright/mocks/server.mjs— scenario-override engine (/__mock/scenario,/__mock/reset) layered over the happy-path defaultsui/playwright/mocks/data.ts—ok()success-envelope helper for scenario payloadsui/playwright/fixtures/test.ts— exposes themockfixture;pagedepends on it so the stub resets before every testui/playwright/README.md— layout + roadmap updated for Stage 1Testing
Playwright boots the stub backend and dev server automatically. The home spec drives the mock through three states — the seeded agent (happy path),
mock.noAgents()(empty state), andmock.agentsError()(error state) — and the nav spec walks the header dropdown from Agents → Models → MCP. Runs serially (workers: 1) against the shared stub; CI runs the same on anyui/**change.Change type
test — extends the Playwright test infrastructure. No product or runtime code changed.
Changelog
Stage 2 of 3 playwright tests for ui