Repository navigation
test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) - #586
Merged
Merged
Conversation
added 2 commits
October 27, 2026 15:03
…signOut QA helpers Signed-off-by: Aixle Flow <[email protected]>
Signed-off-by: Aixle Flow <[email protected]>
…t base URL probeRoutes no longer caches the CSRF token for the whole batch, so a row that resets the session (DELETE /logout, a sign-in) cannot give later rows false 422s. The request helpers resolve paths against options.baseUrl, else staging, as the #182 helpers do, instead of the origin of the open page, which can be a foreign host. readInertiaPage defaults path to the open page only when it is on the base; shot takes baseUrl for its banner's appVersion lookup. Signed-off-by: Aixle Flow <[email protected]>
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 28, 2026
* origin/develop: docs(workflows): describe workflows as sessions made of steps (AixleHQ#595) feat(workflows): open archived workflows read-only in the builder (AixleHQ#594) feat(task-comments): let authors delete their own recent comments (AixleHQ#593) feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592) fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591) feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590) feat(overview): show tokens used and session time instead of token cost (AixleHQ#589) fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587) test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586) test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584) feat(runners): add the runners table and the Runner model (AixleHQ#583) refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579) # Conflicts: # CHANGELOG.md
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 28, 2026
* origin/develop: docs(workflows): describe workflows as sessions made of steps (AixleHQ#595) feat(workflows): open archived workflows read-only in the builder (AixleHQ#594) feat(task-comments): let authors delete their own recent comments (AixleHQ#593) feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592) fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591) feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590) feat(overview): show tokens used and session time instead of token cost (AixleHQ#589) fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587) test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586) test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584) feat(runners): add the runners table and the Runner model (AixleHQ#583) refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579) # Conflicts: # CHANGELOG.md
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.
Board task #186. This builds on #584 (#182).
What changed
test/playwright/helpers/helpers.jsgets five new paste-in helpers forbrowser_run_code_unsafe.README.mddocuments each one with its arguments, return value and an example. It also adds a table of sandbox limits (norequire/import()/process/setTimeout/URL/URLSearchParams/Buffer) and a per-role table of baseline redirects.appRequest(page, { method, path, json, form, csrf, maxRedirects = 0, headers })returns{ status, location, contentType, json, text }throughpage.request, using the context's cookies. Where it gets the CSRF token, in order:XSRF-TOKENcookie, asapiFetch.tsdoes, because an Inertia visit after sign-in leaves a stale meta tag;meta[name="csrf-token"];input[name="authenticity_token"];/login.formis URL-encoded and carriesauthenticity_tokenplus_methodfor PATCH/PUT/DELETE.csrf: falsesends no token at all.textis capped bytextLimit(default 2000).readInertiaPage(page, { path, pick })fetches the HTML and parses<script data-page="app" type="application/json">. It returns{ url, status, component, version, appVersion, props }, andpicklimits the result to the dotted paths you ask for.shot(page, { round, name, banner })sets the viewport to 1920×1080 and writes/workspace/outputs/screenshots_<round>/<name>.png. It reads the size from the PNG header and throws unless it is 1920×1080. The optional banner overlay is removed after the capture.roundandnameare restricted to[A-Za-z0-9._-], so they cannot be used for path traversal.probeRoutes(page, { requests })returns one{ method, path, status, location }row per request, usingmaxRedirects: 0.signOut(page, { baseUrl })clears cookies and local/session storage, loads/login, and checks thatGET /company/projectsredirects to/login. It returns{ signedOut, landedOn }.How the base URL is chosen (the new helpers take a relative
path, notenv):options.baseUrlif given, otherwise the origin of the open page, otherwise staging.How it was tested
browser_run_code_unsafeat 1920×1080, as anonymous, CompanyEmployee and CompanyAdmin. The table is in the task comment.node --check,prettier --check(helpers.js + README.md) andeslint helpers.jsall exit 0.Nothing in the app changes. No workflow files are touched.