Add petstore SPA UI with Playwright e2e tests#14
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
Open
Agent-Logs-Url: https://github.com/counterfact/example-petstore/sessions/15794b61-698a-4ef6-8833-bd28f7a06353 Co-authored-by: pmcelhaney <51504+pmcelhaney@users.noreply.github.com>
…onsistency Agent-Logs-Url: https://github.com/counterfact/example-petstore/sessions/15794b61-698a-4ef6-8833-bd28f7a06353 Co-authored-by: pmcelhaney <51504+pmcelhaney@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Design UI for simple SPA for pet store
Add petstore SPA UI with Playwright e2e tests
Apr 28, 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.
Adds a vanilla JS single-page application for the petstore covering all APIs, plus a full Playwright test suite that runs against the real Counterfact backend.
UI (
ui/index.html)Single-file SPA with three tabs, no build step required:
API base URL defaults to
http://localhost:3100; overridable via?api=<url>query param (used by tests to isolate on port 3101).Tests (
test/petstore.ui.test.ts)22 Playwright tests across all three tabs, started with
npm run test:ui. Config inplaywright.config.tsspins up both the Counterfact backend and aservestatic file server automatically. SharedTEST_API_URLextracted totest/constants.tsto keep config and tests in sync.Route handler fixes
Counterfact passes URL path parameters as strings at runtime. All handlers that look up entities by numeric ID now coerce explicitly:
Affected:
pet/{petId}.ts,pet/{petId}/uploadImage.ts,store/order/{orderId}.ts.package.jsonscriptstesttsxloader for unit teststest:uistart:test