Skip to content

test(browser): keep every Playwright browser context off remote hosts - #9811

Merged
cixzhang merged 7 commits into
mainfrom
hermetic-browser-tests
Nov 4, 2026
Merged

cixzhang merged 7 commits into
mainfrom
hermetic-browser-tests

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Why. A browser spec can stall on a remote host. On 6690e33 the release check (run 41574627097) failed because AspectRatioFitLayers.a11y.browser.spec.ts hit its 60 s timeout in page.setContent: the story's placeholder photos from picsum.photos were still loading, and the load event waited for them. #9703 fixed that one spec with its own route. Carousel, Lightbox, Thumbnail, GridMasonry, Overlay and LayerDismissal stories load remote photos too, and nothing stopped any other spec from depending on a remote font, script or API. Each of these is a release failure that depends on someone else's server.

Intended invariant

A browser spec run by playwright.config.ts (accessibility contracts) or playwright.interaction.config.ts (interaction proofs and gesture proofs) never waits on a remote host. The DOM and behavior under test do not change: image elements stay and get local bytes, and local Storybook and fixture servers are untouched.

Change

What.

  • .github/scripts/lib/offline-media.js: routeRemoteImages(target, storyOrigin, {abortOther}). The route now matches only non-loopback http(s) URLs, so Playwright lets local Storybook and fixture requests through in the browser process with no round trip to the test process (this also helps the audit). A new abortOther: true option makes every remote request that is not an image fail at once (blockedbyclient). Remote images still get the local 400 × 400 stand-in. Local means the story origin, the loopback host (localhost, 127.0.0.1, [::1]), or a URL with no network (data:, blob:). New isRemoteNonImage export. Without the option, behavior is unchanged, so the accessibility audit is unchanged. offline-media.d.ts declares the exports for TypeScript callers.
  • internal/a11y-spec/src/playwright.ts (new, exported as @astryxdesign/a11y-spec/playwright): the one base test that both configs' specs use. It re-exports @playwright/test and replaces test with a version whose worker browser fixture makes every new context hermetic (abortOther: true, no story origin, so only loopback is local). Every context starts at browser.newContext: the context and page fixtures, browser.newPage, and the 47 specs that make their own contexts. So the rule is set at that one point. keepRequestsLocal(context) is exported for a browser the spec launches itself. Two specs do that, and both now call it: AppShell's full-Chromium window-switch test and the interaction harness's shader-cache self-test. The base test's source and the a11y-spec README say that such a spec must call it.
  • All 263 browser specs (including those added on main since this branch started) (*.a11y.chromium.spec.ts, *.a11y.browser.spec.ts, *.interaction.browser.spec.ts, the gesture proofs, the contract's own fixture specs) import from the base test instead of @playwright/test. This is a one-line import change per file.
  • eslint.config.js: no-restricted-imports forbids @playwright/test, playwright/test, playwright and playwright-core in *.browser.spec.ts and *.chromium.spec.ts, so a spec cannot import Playwright around the base test. Lint cannot see a browser that a spec launches from browser.browserType(); the rule above covers that case.
  • AspectRatioFitLayers.a11y.browser.spec.ts: test(AspectRatio): the fit-layer spec answers the story's remote photos locally #9703's per-test picsum route is removed. The base test now answers those photos.
  • Config headers and the a11y-spec README name the base test.
  • accessibility-audit.integration.test.mjs: its fake browser context accepts the new route pattern when it reaches remote hosts and skips loopback (it checked for the old '**/*' string).

Why a base test and not a config option. Playwright config cannot install routes, and globalSetup runs in another process. A shared test is Playwright's own mechanism for shared fixtures, and the lint rule keeps it complete.

Evidence

  • Failure before the change: release check run 41574627097 on 6690e33, AspectRatioFitLayers timed out in page.setContent while picsum.photos was loading.
  • Success after the change: see Testing.
  • Product/runtime behavior verified unchanged: no package source changes; only specs, the internal test package, lint config and a CI helper change.
  • CI impact: see below.

Risk

  • A spec that needs a remote non-image resource now fails at once instead of loading it. No spec in either suite does that today (see Testing). If one ever does, the right fix is a local fixture.
  • A remote web font in a story now falls back to a local font in these specs. No spec compares pixels against a committed baseline (pixel checks compare states within one run), so this changes no result.
  • Any route disables the browser HTTP cache for these contexts. All assets come from a local static server, and loopback requests skip the route handler, so the cost is small (see CI impact).
  • A spec's own page.route or later context.route still wins over the base route (Playwright tries the newest route first), so specs that fake a remote URL keep working (the interaction harness does this).

CI impact

  • Runner classes and jobs are unchanged. No workflow file changes. The only CI script change is the offline-media helper (the route pattern, plus an option that only the browser specs pass).
  • Runner-pool usage: no job is added or removed, and job time is unchanged (below), so runner-minutes a day and average concurrent jobs are unchanged. The audit's route now skips loopback requests, which can only shorten it.
  • Time to green: the last full run (ready at 03:35 UTC) finished CI in 18 min and Lint in 5 min, about the same as other PRs that run the interaction suites.
  • This PR changes every browser spec, so its own CI runs the interaction proofs (full Chromium suite) and the touched-specs accessibility check (first four changed specs, as for any PR). Both execute the new base test.
  • Wall time, interaction proofs (both run the full suite): this PR's first full run took 721 s in Chromium and 429 s in WebKit. Other PRs' full runs on the same day took 774 s and 551 s in Chromium and 378 s in WebKit. That is within run-to-run noise, so there is no measurable cost.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • vitest run .github/scripts/lib/offline-media.test.mjs: 24 passed, including real Chromium: with abortOther, a page whose script host never answers loads in under 5 s with the image drawn locally and the script request failed; without abortOther, the same page times out.
  • internal/a11y-spec/src/harness/hermetic.chromium.spec.ts (new): the page fixture, a context made by browser.newContext, and a page made by browser.newPage all draw a remote image at 400 px from the stand-in, fail a remote stylesheet with ERR_BLOCKED_BY_CLIENT, and load a local file. 3/3 pass.
  • pnpm -F @astryxdesign/a11y-spec typecheck, ESLint on all changed specs, and a lint probe spec that imports from @playwright/test, playwright/test and playwright (all three rejected).
  • AspectRatioFitLayers.a11y.browser.spec.ts without its own route: 6/6 pass in Chromium.
  • Local browser runs are Chromium only, in single-process mode, because the local machine's sandbox stops Chromium from starting its child processes and WebKit from opening a page. In that mode a worker's browser often dies when a test closes its context, so every run used --retries=2. A test that passes on a retry is a pass; it is not evidence of flakiness on CI.
    • Full Chromium accessibility-contract suite, 8 shards, 1 worker: about 1,890 tests passed, 73 failed, about 580 did not run behind those failures. Every failure is local-only: the single-process browser dying (this includes the 3 specs that launch their own browser), the evidence specs that need CI's Storybook source stamp, or the evidence guard refusing a working tree that I was editing during the run. To separate these from the change, I ran the 10 specs with non-trivial failures again on the same tree with the base route switched off. The same tests failed with the route off as with it on (17 of 79 shared tests, plus the Playground resize case, which uses a data: image). No test failed only with the route on.
    • Interaction proofs: the gesture proofs (esbuild fixtures on loopback) and the interaction-harness specs: 182 passed, 1 failed (a test that opens a second page, which the single-process browser cannot do), 1 skipped.
  • This PR's CI runs the full Chromium interaction suite against the PR's own Storybook build.

cixzhang and others added 2 commits November 3, 2026 10:33
Browser specs import test from @astryxdesign/a11y-spec/playwright. Its
contexts answer remote images with a local stand-in and block other
remote requests, so a slow remote host cannot stall a spec.
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 4, 2026 4:09am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 4:24 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · fb6ad46

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AlertDialog · Storybook 83.4 kB (0) · 13.1 kB CSS (0) 215 (0) — · — · —
AppShell · Storybook 70.4 kB (0) · 12.2 kB CSS (0) 1,096 (0) — · — · —
AspectRatio · Storybook 3.8 kB (0) · 3.6 kB CSS (0) 109 (0) — · — · —
142 more components
Component Size LoC Visual · A11y · RTL
Avatar 34.4 kB (0) · 6.5 kB CSS (0) — — · — · —
AvatarStatusDot 7.2 kB (0) · 3.6 kB CSS (0) — — · — · —
Badge · Storybook 4.0 kB (0) · 4.0 kB CSS (0) 227 (0) — · — · —
BaseTypeahead 54.8 kB (0) · 10.3 kB CSS (0) — — · — · —
BottomSheet 37.4 kB (0) · 7.5 kB CSS (0) — — · — · —
BottomSheetSwitcher 17.1 kB (0) · 3.4 kB CSS (0) — — · — · —
BreadcrumbItem 67.3 kB (0) · 11.5 kB CSS (0) — — · — · —
Breadcrumbs 16.0 kB (0) · 3.4 kB CSS (0) — — · — · —
Button · Storybook 44.8 kB (0) · 9.8 kB CSS (0) 628 (0) — · — · —
ButtonGroup · Storybook 9.0 kB (0) · 3.4 kB CSS (0) 128 (0) — · — · —
Calendar · Storybook 53.7 kB (0) · 10.4 kB CSS (0) 1,658 (0) — · — · —
Carousel · Storybook 50.2 kB (0) · 10.6 kB CSS (0) 493 (0) — · — · —
ChatComposer 60.9 kB (0) · 11.2 kB CSS (0) — — · — · —
ChatComposerDrawer 17.5 kB (0) · 4.7 kB CSS (0) — — · — · —
ChatComposerInput 58.9 kB (0) · 10.7 kB CSS (0) — — · — · —
ChatComposerTokenElement 58.9 kB (0) · 10.7 kB CSS (0) — — · — · —
ChatDictationButton 45.3 kB (0) · 9.9 kB CSS (0) — — · — · —
ChatLayout 48.0 kB (0) · 10.3 kB CSS (0) — — · — · —
ChatLayoutScrollButton 45.3 kB (0) · 10.0 kB CSS (0) — — · — · —
ChatMessage 16.7 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatMessageBubble 7.1 kB (0) · 3.7 kB CSS (0) — — · — · —
ChatMessageList 22.8 kB (0) · 8.0 kB CSS (0) — — · — · —
ChatMessageMetadata 19.6 kB (0) · 4.1 kB CSS (0) — — · — · —
ChatSendButton 45.2 kB (0) · 9.8 kB CSS (0) — — · — · —
ChatSystemMessage 6.8 kB (0) · 3.8 kB CSS (0) — — · — · —
ChatTokenizedText 7.1 kB (0) · 4.0 kB CSS (0) — — · — · —
ChatToolCalls 25.9 kB (0) · 9.3 kB CSS (0) — — · — · —
CheckboxInput · Storybook 48.1 kB (0) · 9.8 kB CSS (0) 372 (0) — · — · —
CheckboxList 42.7 kB (0) · 8.6 kB CSS (0) — — · — · —
CheckboxListItem 52.8 kB (0) · 11.1 kB CSS (0) — — · — · —
CodeBlock · Storybook 58.6 kB (0) · 11.1 kB CSS (0) 2,207 (0) — · — · —
Collapsible 23.1 kB (0) · 4.5 kB CSS (0) — — · — · —
CollapsibleGroup 6.5 kB (0) · 3.3 kB CSS (0) — — · — · —
CommandPalette 50.9 kB (0) · 12.3 kB CSS (0) — — · — · —
CommandPaletteEmpty 6.2 kB (0) · 3.5 kB CSS (0) — — · — · —
CommandPaletteFooter 17.0 kB (0) · 3.7 kB CSS (0) — — · — · —
CommandPaletteGroup 3.5 kB (0) · 3.5 kB CSS (0) — — · — · —
CommandPaletteInput 26.8 kB (0) · 8.5 kB CSS (0) — — · — · —
CommandPaletteItem 10.1 kB (0) · 3.6 kB CSS (0) — — · — · —
CommandPaletteList 16.0 kB (0) · 3.4 kB CSS (0) — — · — · —
ComplexSelector · Storybook 55.3 kB (0) · 11.1 kB CSS (0) 695 (0) — · — · —
ContextMenu · Storybook 74.9 kB (0) · 15.4 kB CSS (0) 693 (0) — · — · —
ContextMenuItem 25.0 kB (0) · 5.0 kB CSS (0) — — · — · —
DateInput · Storybook 146.9 kB (0) · 15.4 kB CSS (0) 5,010 (0) — · — · —
DateRangeInput · Storybook 71.2 kB (0) · 11.9 kB CSS (0) 666 (0) — · — · —
Dialog 19.1 kB (0) · 6.7 kB CSS (0) — — · — · —
DialogHeader 47.7 kB (0) · 10.2 kB CSS (0) — — · — · —
Drawer 38.4 kB (0) · 8.2 kB CSS (0) — — · — · —
DrawerHeader 47.8 kB (0) · 11.6 kB CSS (0) — — · — · —
DropdownMenu 73.1 kB (0) · 15.5 kB CSS (0) — — · — · —
DropdownMenuCheckboxItem 18.3 kB (0) · 5.9 kB CSS (0) — — · — · —
DropdownMenuDivider 5.2 kB (0) · 548 B CSS (0) — — · — · —
DropdownMenuGroup 6.2 kB (0) · 3.4 kB CSS (0) — — · — · —
DropdownMenuItem 17.5 kB (0) · 5.5 kB CSS (0) — — · — · —
DropdownMenuRadioGroup 6.1 kB (0) · 3.3 kB CSS (0) — — · — · —
DropdownMenuRadioItem 18.3 kB (0) · 5.9 kB CSS (0) — — · — · —
DropdownMenuSubMenu 56.4 kB (0) · 10.0 kB CSS (0) — — · — · —
Field 39.2 kB (0) · 7.4 kB CSS (0) — — · — · —
FieldLabel 35.3 kB (0) · 5.9 kB CSS (0) — — · — · —
FieldStatus · Storybook 9.4 kB (0) · 3.6 kB CSS (0) 164 (0) — · — · —
FileInput · Storybook 53.3 kB (0) · 10.8 kB CSS (0) 779 (0) — · — · —
Grid 4.4 kB (0) · 3.8 kB CSS (0) — — · — · —
GridSpan 3.5 kB (0) · 3.4 kB CSS (0) — — · — · —
Heading 7.9 kB (0) · 6.0 kB CSS (0) — — · — · —
HoverCard · Storybook 19.2 kB (0) · 5.0 kB CSS (0) 727 (0) — · — · —
HStack 5.9 kB (0) · 1.7 kB CSS (0) — — · — · —
Icon · Storybook 7.6 kB (0) · 681 B CSS (0) 701 (0) — · — · —
IconButton · Storybook 44.8 kB (0) · 9.8 kB CSS (0) 17 (0) — · — · —
InfoTip · Storybook 36.7 kB (0) · 6.1 kB CSS (0) 160 (0) — · — · —
Item · Storybook 13.3 kB (0) · 4.9 kB CSS (0) 1,599 (0) — · — · —
LayerProvider 62.6 kB (0) · 10.5 kB CSS (0) — — · — · —
Layout 6.8 kB (0) · 2.3 kB CSS (0) — — · — · —
LayoutContent 6.0 kB (0) · 1.8 kB CSS (0) — — · — · —
LayoutFooter 5.9 kB (0) · 1.7 kB CSS (0) — — · — · —
LayoutHeader 6.0 kB (0) · 1.7 kB CSS (0) — — · — · —
LayoutPanel 7.6 kB (0) · 5.0 kB CSS (0) — — · — · —
Lightbox · Storybook 51.9 kB (0) · 10.2 kB CSS (0) 833 (0) — · — · —
Link 42.3 kB (0) · 8.0 kB CSS (0) — — · — · —
LinkProvider 3.5 kB (0) · 20 B CSS (0) — — · — · —
List 5.4 kB (0) · 435 B CSS (0) — — · — · —
ListItem 52.2 kB (0) · 11.1 kB CSS (0) — — · — · —
Markdown · Storybook 145.4 kB (0) · 18.4 kB CSS (0) 8,706 (0) — · — · —
MobileNav 51.5 kB (0) · 10.4 kB CSS (0) — — · — · —
MobileNavToggle 45.1 kB (0) · 9.8 kB CSS (0) — — · — · —
MultiSelector · Storybook 72.7 kB (0) · 15.3 kB CSS (0) 2,707 (+5) — · — · —
NavHeadingMenu 14.8 kB (0) · 3.4 kB CSS (0) — — · — · —
NumberInput · Storybook 54.7 kB (0) · 11.3 kB CSS (0) 1,150 (0) — · — · —
Outline · Storybook 21.9 kB (0) · 4.2 kB CSS (0) 1,211 (+5) — · — · —
Popover · Storybook 52.2 kB (0) · 12.7 kB CSS (0) 1,038 (0) — · — · —
ProgressBar · Storybook 10.8 kB (0) · 7.3 kB CSS (0) 568 (0) — · — · —
RadioList 40.6 kB (0) · 7.4 kB CSS (0) — — · — · —
RadioListItem 50.7 kB (0) · 10.1 kB CSS (0) — — · — · —
ResizeHandle 19.5 kB (0) · 4.3 kB CSS (0) — — · — · —
SegmentedControl 81.5 kB (0) · 7.8 kB CSS (0) — — · — · —
SegmentedControlItem 10.4 kB (0) · 4.0 kB CSS (0) — — · — · —
Selector 77.4 kB (0) · 15.7 kB CSS (0) — — · — · —
SelectorOption 16.6 kB (0) · 5.4 kB CSS (0) — — · — · —
SideNav 69.9 kB (0) · 11.2 kB CSS (0) — — · — · —
SideNavCollapseButton 45.6 kB (0) · 9.9 kB CSS (0) — — · — · —
SideNavHeading 58.7 kB (0) · 10.6 kB CSS (0) — — · — · —
SideNavItem 54.3 kB (0) · 10.5 kB CSS (0) — — · — · —
SideNavSection 6.6 kB (0) · 3.7 kB CSS (0) — — · — · —
Slider · Storybook 88.4 kB (0) · 9.4 kB CSS (0) 2,326 (0) — · — · —
Spinner · Storybook 18.5 kB (0) · 6.8 kB CSS (0) 321 (0) — · — · —
Switch · Storybook 86.6 kB (0) · 10.6 kB CSS (0) 1,717 (0) — · — · —
Tab 11.4 kB (0) · 4.2 kB CSS (0) — — · — · —
Table 84.4 kB (0) · 16.1 kB CSS (0) — — · — · —
TableBody 3.4 kB (0) · 3.3 kB CSS (0) — — · — · —
TableCell 76.1 kB (0) · 15.9 kB CSS (0) — — · — · —
TableFooter 3.4 kB (0) · 3.3 kB CSS (0) — — · — · —
TableHeader 3.4 kB (0) · 3.3 kB CSS (0) — — · — · —
TableHeaderCell 75.7 kB (0) · 15.6 kB CSS (0) — — · — · —
TableRow 6.5 kB (0) · 4.0 kB CSS (0) — — · — · —
TableSelectionToolbar 54.6 kB (0) · 11.8 kB CSS (0) — — · — · —
TabList 35.4 kB (0) · 7.5 kB CSS (0) — — · — · —
TabMenu 55.3 kB (0) · 10.5 kB CSS (0) — — · — · —
Text · Storybook 7.4 kB (0) · 6.0 kB CSS (0) 544 (0) — · — · —
TextArea · Storybook 46.5 kB (0) · 9.9 kB CSS (0) 496 (0) — · — · —
TextInput · Storybook 52.5 kB (0) · 11.0 kB CSS (0) 420 (0) — · — · —
ToggleButton 45.6 kB (0) · 9.9 kB CSS (0) — — · — · —
ToggleButtonGroup 6.4 kB (0) · 3.4 kB CSS (0) — — · — · —
Token · Storybook 25.3 kB (0) · 4.8 kB CSS (0) 561 (0) — · — · —
Tokenizer · Storybook 70.3 kB (0) · 17.1 kB CSS (0) 2,114 (0) — · — · —
Toolbar · Storybook 34.7 kB (0) · 7.9 kB CSS (0) 269 (0) — · — · —
Tooltip · Storybook 20.2 kB (0) · 5.0 kB CSS (0) 735 (0) — · — · —
TopNav 53.1 kB (0) · 10.7 kB CSS (0) — — · — · —
TopNavHeading 58.1 kB (0) · 10.4 kB CSS (0) — — · — · —
TopNavItem 10.7 kB (0) · 4.0 kB CSS (0) — — · — · —
TopNavMegaMenu 53.7 kB (0) · 11.2 kB CSS (0) — — · — · —
TopNavMegaMenuFeaturedCard 6.9 kB (0) · 3.6 kB CSS (0) — — · — · —
TopNavMegaMenuItem 10.8 kB (0) · 4.2 kB CSS (0) — — · — · —
TopNavMenu 57.9 kB (0) · 10.5 kB CSS (0) — — · — · —
TreeList · Storybook 38.6 kB (0) · 5.0 kB CSS (0) 1,152 (0) — · — · —
Typeahead 62.6 kB (0) · 11.8 kB CSS (0) — — · — · —
TypeaheadItem 6.3 kB (0) · 3.6 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 66.0 kB (0) · 773 B CSS (0) — — · — · —
lab/ChatReactionBar 66.5 kB (0) · 1.1 kB CSS (0) — — · — · —
lab/ChatTypingIndicator 24.8 kB (0) · 612 B CSS (0) — — · — · —
lab/ChatUnreadDivider 3.6 kB (0) · 348 B CSS (0) — — · — · —
lab/CircularProgress · Storybook 8.5 kB (0) · 1.1 kB CSS (0) 597 (0) — · — · —
lab/Schedule · Storybook 61.0 kB (0) · 3.9 kB CSS (0) 4,750 (0) — · — · —
lab/SelectableCardGroup · Storybook 49.9 kB (0) · 162 B CSS (0) 242 (0) — · — · —

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: core 2 rows; run pnpm api:report.

Wide change (shared styles: packages/core/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.

CI impact: 0 job-min per update · pool 0% · time to green −2.5 min · standard runners · 4 CI action or script files changed (not measured)
Before After Change
Job-minutes per PR update 92.7 92.7 0
Runner pool, runner-minutes a day 32,717 32,717 0 (0%)
Average concurrent jobs 22.7 22.7 0
Time to green (median → this run) 18.9 min 16.4 min −2.5 min
Runs a day 353 353 0

Not measured (the jobs that use these keep their recent minutes above): .github/scripts/accessibility-audit.integration.test.mjs, .github/scripts/lib/offline-media.d.ts, .github/scripts/lib/offline-media.js, .github/scripts/lib/offline-media.test.mjs.

Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the shared base test works as described, but the branch needs a rebase and the guard has two gaps.

  • Two browser specs added to main after this branch forked, SelectorListboxName.a11y.chromium.spec.ts and SelectableCardGroupRadio.a11y.chromium.spec.ts, still import @playwright/test, so after merge the new lint rule fails on both and they run without hermetic contexts; rebase and switch their imports.
  • The title's "every Playwright browser context" and the description's "a new spec cannot skip the base test" overstate the guard, because import {test} from 'playwright/test' passes the new rule and the browser that harness.interaction.browser.spec.ts launches itself (line 1195) gets no route; add playwright/test to the rule and route that context with keepRequestsLocal, or narrow the wording.

The new hermetic spec passes on this head and fails against plain @playwright/test, and the internal contract and gesture suites pass under the base test.

[Automated review]

Comment thread eslint.config.js Outdated
{
paths: [
{
name: '@playwright/test',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playwright/test exports the same test and resolves through the root playwright devDependency, so a spec that imports it passes this rule. A probe spec with import {test} from 'playwright/test' got no no-restricted-imports error. Restrict it as well:

{
  name: 'playwright/test',
  message:
    "Import from '@astryxdesign/a11y-spec/playwright' instead: its `test` keeps every browser context off remote hosts.",
},

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the shared base test works as described, but the branch needs a rebase, the guard has two gaps, and the CI impact line is still a placeholder.

  • Four browser specs that landed on main after this branch forked (SelectorListboxName.a11y.chromium.spec.ts, SelectableCardGroupRadio.a11y.chromium.spec.ts, Wheel.interaction.browser.spec.ts and WheelActivation.interaction.browser.spec.ts) still import @playwright/test, so the new lint rule fails on them after merge and they run without hermetic contexts; rebase and switch their imports.
  • The title's "every Playwright browser context" and the description's "a new spec cannot skip the base test" overstate the guard, because import {test} from 'playwright/test' passes the new rule and the browser that harness.interaction.browser.spec.ts launches itself (line 1195) gets no route; add playwright/test to the rule and route that browser's context with keepRequestsLocal, or narrow the wording.
  • The CI impact section states the runner class only, and AST-030 FR19 asks a CI-script change for job-minutes per update before and after, runner-pool usage and time to green, so add them once this pull request's CI has run.

The new hermetic spec passes on this head and fails against plain @playwright/test, and the internal contract and gesture suites pass under the base test.

[Automated review]

Comment thread internal/a11y-spec/src/playwright.ts Outdated
Comment on lines +35 to +37
* Every context starts from `browser.newContext`: the `context` and `page`
* fixtures, `browser.newPage`, and a spec's own call. So the rule is set at
* that one point, once per worker.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A browser the spec launches itself is a different Browser, so its contexts skip this wrapper. harness.interaction.browser.spec.ts:1195 does that (browser.browserType().launch(), then own.newPage()), and a probe of the same shape on this head sent a remote stylesheet to the network (net::ERR_NAME_NOT_RESOLVED) instead of ERR_BLOCKED_BY_CLIENT. Either make that self-test's context with own.newContext() plus keepRequestsLocal, or say here that only contexts from the fixture's browser are covered.

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 00:59

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the four specs from main now use the base test and the audit fake accepts the new route, but two items from the last review still stand.

  • The title's "every Playwright browser context" and the description's "one spec" launching its own browser and "a new spec cannot skip the base test" overstate the guard, because import {test} from 'playwright/test' still passes the lint rule (eslint.config.js:925) and the browser that harness.interaction.browser.spec.ts launches itself (line 1197) still gets no route; add playwright/test to the rule and route that browser's context with keepRequestsLocal, or narrow the wording.
  • The CI impact section still gives only the runner class, and AST-030 FR19 asks a pull request that changes a CI script for job-minutes per update before and after, runner-pool usage and time to green, so add them from this pull request's CI run.

On this head the hermetic spec passes, offline-media.test.mjs and the audit integration test pass, and the four converted specs lint clean.

[Automated review]

@cixzhang
cixzhang marked this pull request as draft November 4, 2026 02:28

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: two items still stand.

  • The title's "every Playwright browser context" and the description's "one spec" launching its own browser and "a new spec cannot skip the base test" overstate the guard, because import {test} from 'playwright/test' still passes the lint rule (eslint.config.js:925) and the browser that harness.interaction.browser.spec.ts launches itself (line 1197) gets no route; add playwright/test to the rule and route that browser's context with keepRequestsLocal, or narrow the wording.
  • The CI impact section now gives the runner class and the interaction proofs' wall time, but AST-030 FR19 also asks a pull request that changes a CI script for its runner-pool usage (runner-minutes a day and average concurrent jobs) and time to green, so add them.

The hermetic spec, offline-media.test.mjs and the audit integration test pass with this patch.

[Automated review]

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 03:35
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 04:00

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and marking it ready for review starts the run.

The three items from the last review are fixed: the lint rule also rejects playwright/test, playwright and playwright-core, the interaction harness routes the browser it launches itself, and the CI impact section gives runner-pool usage and time to green. A wide change like this one runs the full accessibility-contract suite only behind ci:run-a11y, so adding that label before merge would run every spec under the new base test once.

  • Miss: (non-blocking) in Playwright's context-reuse mode (PW_TEST_REUSE_CONTEXT=1), the context fixture comes from browser._newContextForReuse() instead of newContext, so the page fixture gets no route; name that exception in the comment at internal/a11y-spec/src/playwright.ts:35-36 and in the README, or also route the context in a context fixture override.

[Automated review]

Comment on lines +35 to +36
* Every context starts from `browser.newContext`: the `context` and `page`
* fixtures, `browser.newPage`, and a spec's own call. So the rule is set at

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: with Playwright's context-reuse mode on (PW_TEST_REUSE_CONTEXT=1), the context fixture comes from browser._newContextForReuse(), not newContext, so the page fixture gets no route; the page-fixture test in hermetic.chromium.spec.ts fails in that mode. Name the exception here and in the README, or also route the context in a context fixture override.

@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 05:33
@cixzhang
cixzhang merged commit e390c3c into main Nov 4, 2026
111 checks passed
@github-actions
github-actions Bot deleted the hermetic-browser-tests branch November 4, 2026 06:04
cixzhang added a commit that referenced this pull request Nov 4, 2026
…ight test (#9888)

test(DateInput): the wheel contrast proof imports the hermetic Playwright test

#9853 added the spec with @playwright/test; #9811 made that import an
ESLint error. Each was green alone; together main Lint fails.
HelloOjasMutreja added a commit to HelloOjasMutreja/astryx that referenced this pull request Nov 4, 2026
…ough a11y-spec

main's no-restricted-imports rule (meta#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts.
HelloOjasMutreja added a commit to HelloOjasMutreja/astryx that referenced this pull request Nov 5, 2026
…ough a11y-spec

main's no-restricted-imports rule (meta#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts.
cixzhang added a commit that referenced this pull request Nov 8, 2026
…ore showing (#5398)

* fix(HoverCard,Tooltip): wait for the trigger to have a layout box before showing

* fix(Layer): treat an empty anchor box as ready; restore main's SheetWithHoverTip story

* fix(Layer): wait for the anchor through the shared resize and mutation observers

The anchor wait in show() created its own ResizeObserver and MutationObserver. Route it through observeResize and observeMutations, which architecture:react-component-runtime INV16 requires callers to use. The IntersectionObserver and the dialog toggle listener stay.

* test(Layer): the focus-return harness uses a stable trigger ref

The harness attached the trigger with an inline ref, which detaches and
reattaches it on every render. Each detach now defers its anchor-name removal
by a microtask, so the replay test, which holds the ledger's microtasks by
hand, held those too. A stable ref leaves it holding only the ledger's.

* fix(Layer): clear the strict-lint findings in the anchor-readiness comments and test harness

The new comments no longer cite an issue number or an invariant id, and the focus-return harness lists the two refs it reads in its callback's dependencies.

* test(Layer): the anchor-readiness browser spec imports Playwright through a11y-spec

main's no-restricted-imports rule (#9811) rejects @playwright/test in browser specs, so the spec imports expect, test and Page from @astryxdesign/a11y-spec/playwright, whose test keeps every browser context off remote hosts.

* test(Layer): the anchor-name churn cases show the layer first

main now gives a closed layer's trigger no anchor name (#9963), so a trigger is an anchor only while its layer is shown. The contextRef churn cases open the layer before checking the name.

* fix(Layer): the anchor settle waits only on document-timeline animations, through one shared predicate

A scroll- or view-driven animation finishes only when the person scrolls to the end of its range, so a controlled Tooltip inside such an ancestor stayed hidden. The settle wait now skips animations not on the document's timeline, and it shares the running-and-finite test with exitAnimations.

* docs(Layer): the anchor-wait changeset and comments describe the document-timeline wait

The changeset and the comments still described a wait on any running finite animation. They now say it waits on running animations on the document timeline that end on their own, and not on paused, infinite, or scroll- and view-driven ones.

* Merge branch 'main' into fix/hovercard-controlled-open-anchoring

* chore(lint): regenerate the comment-provenance baseline

The useLayer.tsx comments no longer cite INV6/FR4 or quote a requirement, so
the baseline drops those three sites.

* Merge main into fix/hovercard-controlled-open-anchoring

Resolves useLayer.tsx's imports: keeps both this branch's shared resize
and mutation observers and main's flat-tree, shadow-root and input-stream
helpers.

* review: comment wording and a churn guard that fails on main

- The churn test records every write to the trigger's style, so it fails
  when a null-then-same-element reattach removes and re-adds the anchor
  name (main) even though the name ends up present.
- The isAnchorReady doc sits on isAnchorReady; isShownAsPopover gets its
  own line. The anchor-wait comments say "no layout box" rather than 0x0,
  the unmount note names the released anchor wait, and the contextRef
  comment keeps its reason in a few sentences.

* Merge branch 'main' into fix/hovercard-controlled-open-anchoring

Co-authored-by: Cindy Zhang <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — fb6ad46f Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant