Repository navigation
test(e2e): Add Gherkin acceptance tests with playwright-bdd and Screenplay actors - #57
DetweilerRyan wants to merge 7 commits into
Conversation
Scenarios in e2e/features run on Playwright Test through playwright-bdd, with step definitions written as actors performing tasks and answering questions. An assistant actor calls create_receipt_room over /api/mcp with the MCP client SDK, and people open the link in their own phone-sized browser contexts and split the receipt live. Runs stay offline: NEXT_PUBLIC_WEBRTC_SIGNALING_URLS points room sync at y-webrtc's own signaling server, which playwright.config.ts starts beside the app, and actors' browsers refuse requests to other hosts. npm run test:e2e is a new definition-of-done check and CI step. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
npm run lint now also runs gplint over e2e/features with .gplintrc: the structure rules from the gol repository, plus a list of implementation words scenarios may not use. npm run format and format:check now also run scripts/format-features.mjs, which formats features with @cucumber/gherkin-utils, or checks them with --check since its CLI has no check mode. Layout rules stay off in the linter so only the formatter decides layout. The first lint run caught create_receipt_room in a feature description, reworded here, and the formatter right-aligned the price columns. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
.gplintrc's no-restricted-patterns grows from 15 words to 52 patterns in six categories from web research on Gherkin style: code identifiers (any snake_case name), URLs and HTTP, storage and sync internals, the DOM, widgets and gestures, and the browser and test harness. Words that belong to this app's domain (table, link, page, MCP server) stay allowed. None matches the current features; a planted scenario in implementation language gets 13 findings. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why the linter is gplint, where each rule comes from, and the research behind the banned-word list now sit beside .gplintrc instead of in testing-conventions.meta.md, which keeps the formatter choice, the precedents and a pointer. single-source-of-truth.md now lets a config file have a sidecar named for the whole file name, when its reasons need more than a comment. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
let's make this a ts file
There was a problem hiding this comment.
Done in 09c2f98: scripts/format-features.mjs is now scripts/format-features.ts.
- How it runs: Node 26 runs it directly by stripping the types, so no build step or new dependency is needed.
npm run formatandformat:checkcallnode scripts/format-features.ts. - Type checking:
npm run typechecknow covers the script. On the first run it caught thatreaddirSync(path, { recursive: true })with no encoding is typed to return Buffers, so the script now passesencoding: 'utf8'. - One limit: type stripping only handles TypeScript syntax that can simply be erased, with no enums, namespaces or parameter properties. A comment at the top of the script says so.
- References updated:
package.json, the script's test,AGENTS.md,.gplintrc,.gplintrc.meta.md,testing-conventions.meta.mdand the PR description. - Self-review: I reread the whole branch diff, and no other file names the old
.mjsscript. - Checks: all six definition-of-done checks pass locally, including the script's five tests. CI is running.
CucumberOpen.cucumber-official highlights, formats and autocompletes the e2e features and jumps from a step to its definition. Its default paths don't include e2e/, so the dev container's settings point it at e2e/features and e2e/steps, and make it the formatter for .feature files. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As asked in review: scripts/format-features.mjs becomes scripts/format-features.ts, which Node 26 runs directly by stripping its types, so npm run typecheck now covers it. The typecheck caught that readdirSync without an encoding is typed to return Buffers, so it now asks for utf8. Refs #55 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Feedback given in a Claude Code session, 2026-11-22:
Correct.
|
|
Feedback given in a Claude Code session, 2026-11-22, recorded late (why):
It answered a recommendation to lint and format |
|
Feedback given in a Claude Code session, 2026-11-22, recorded late (why):
It answered a recommended list of implementation words to ban in |
|
Feedback given in a Claude Code session, 2026-11-22, recorded late (why):
|
|
Feedback given in a Claude Code session, 2026-11-22, recorded late (why):
|
|
Feedback given in a Claude Code session, 2026-11-22, recorded late (why):
and, after the session compared the conventions:
|
|
Reply to this feedback: done in baf20e6.
|
|
Reply to this feedback: done in 9aae08d.
|
|
Reply to this feedback: done in 1eacfee, as suggested.
|
|
Reply to this feedback: done in 087a6e3.
|
|
Reply to this feedback: kept
|
|
Reply to this feedback: the five requests from the session are now recorded, each with a reply.
|
|
Follow-up to this feedback: the guard against it happening again is in #58. It adds a boundary in AGENTS.md, which every session loads, and the definition of in-session feedback in the workflow index and revising-work.md. |
Adds Gherkin end-to-end tests, run by Playwright Test through playwright-bdd. The step definitions use a small Screenplay layer: actors with a browser and an MCP client, plus tasks and questions. The conventions are in testing conventions, and the reasons and owner decisions are in its sidecar.
.featurefiles are linted and formatted too.npm run lintruns gplint with.gplintrc, andnpm run formatandformat:checkrunscripts/format-features.ts, which uses Cucumber's own formatter. Node 26 runs the script directly by stripping its types, andnpm run typecheckcovers it. The definition-of-done commands and CI steps don't change.What to look at
src/store/yjsProvider.ts: the only app change.NEXT_PUBLIC_WEBRTC_SIGNALING_URLSreplaces the hard-coded signaling servers when set. Unset or blank keeps the public servers, so Vercel behaves as before.e2e/screenplay/actor.ts: each actor's browser context aborts every request to a host other thanlocalhost. That is how the e2e run meets the offline rule, along with the localy-webrtc-signalingstarted inplaywright.config.ts.CI gains an "End-to-end tests" step after the production build, and the e2e run builds the app again with the signaling variable set. In CI the "Definition of done" job took 1 min 5 s. The new step took 9 s, its rebuild included, and the other steps did not change.
.gplintrc's vocabulary list (no-restricted-patterns): 52 patterns, approved in session on 2026-11-22, in six commented categories. The categories come from web research recorded in.gplintrc.meta.md.table,link,page,request,phoneandMCP serverstay allowed as domain words.Decisions made
gplint2.6.1 and@cucumber/gherkin-utils12.0.2, approved in session on 2026-11-22. The rules are ported fromgol's.gherkin-lintrc, with two changes:only-one-whenbecomesmax-keywords(when: 1,ignoreConjunctions: true).gol2, so only the formatter decides layout..gplintrc.meta.md. The formatter's are in testing conventions' sidecar.CucumberOpen.cucumber-official1.12.1 (approved in session on 2026-11-22).e2e/featuresande2e/steps, since its default paths misse2e/, and make it the formatter for.featurefiles.e2e/features/, not a top-levelfeatures/: your decision on 2026-11-22, recorded in the sidecar..gplintrc's reasons live in.gplintrc.meta.md.single-source-of-truth.mdnow allows a<config>.meta.mdwhen the reasons need more than a comment. Until now it defined sidecars for documents only.lintandformat:checkrather than getting new ones, so the definition-of-done table and CI stay as they are.en-USlocale, following the mobile-first guidance, with amounts in USD so no exchange rate is fetched.reuseExistingServeris off.NEXT_PUBLIC_variables are fixed at build time, so a server already running could be pointing at the public signaling servers.test-results/.For the owner to confirm
Nothing.
Changed test expectations
Nothing. The new tests in
yjsProvider.test.tsandscripts/format-features.real.test.tsare additions. The edits to the two.featurefiles leave every scenario's steps unchanged:create_receipt_room;Verification
npm run test:e2eincluded, exit 0 locally in the Docker Sandbox.--repeat-each 10, 40 runs, 8 workers).Whens, aThenthat should beAnd, andbuttonandclicksfailednpm run lintwith six findings. It passed again once the file was removed.format:checkfailed on both features before formatting and passes after.scripts/format-features.real.test.tscovers formatted, unformatted, nested, empty and unparseable input.@cucumber/gherkin-utilsmoved to 12.0.2 at the top level, and playwright-bdd keeps its own 11.0.0.npm auditreports 0 vulnerabilities.devcontainer.jsonparses, and the extension package's own settings confirm its default paths misse2e/. Not verified: opening the container in VS Code, the extension linking steps, and whether its bundled formatter matchesnpm run format. Its code is minified, so the version can't be read.Links
Closes #55. Running against Vercel previews is deferred to #56.
🤖 Generated with Claude Code