Skip to content

Broaden e2e coverage: pin 12 core behaviors (issue #112)#113

Merged
vchelaru merged 2 commits into
mainfrom
test/112-broaden-e2e-coverage
Jul 1, 2026
Merged

Broaden e2e coverage: pin 12 core behaviors (issue #112)#113
vchelaru merged 2 commits into
mainfrom
test/112-broaden-e2e-coverage

Conversation

@vchelaru

@vchelaru vchelaru commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

Widens the Playwright .NET e2e suite from 2 smoke tests to 14 in one PR, pinning the ~12 most important user-visible behaviors so a regression in any core path fails CI (issue #112). Not aiming for 100% coverage — "confident the basics work."

Tests added (CoreBehaviorsTest.cs)

  1. Compile error surfaces cleanly — no game starts, error banner stays hidden
  2. Stop clears the running game (status "Stopped.", button reverts to "Run")
  3. Edit-then-rerun: fresh compile vs cache-hit vs recompile (pins CompileFingerprint)
  4. Load a different example from the modal → code loads + runs
  5. Sample-switch A→B→A stays alive (full Mouse trail example broken on desktop (suspected #90/PR #93 regression) #95, asserted via the GetInputDebugState hook)
  6. Reach↔HiDef profile switch flips webglwebgl2 (issue Shared canvas can't change WebGL context type — switching between Reach and HiDef games in one session crashes #25 canvas-swap path)
  7. #code= Share URL round-trip (reload restores identical source + runs)
  8. #snippet= Share URL round-trip (through SnippetReverter/SnippetExpander)
  9. Cold-boot #code= deep link auto-runs (payload built with the real UrlCodec)
  10. Monaco boots with default code visible
  11. IntelliSense completion returns results (calls GetCompletionsAsync directly)
  12. ?embed=true hides the editor + runs the game

Harness

  • Extracted E2ETestBase: host + browser + one IBrowserContext shared in OneTimeSetUp; a fresh IPage per test so a running game / set _canvasContextType can't leak across tests (context shared so the WASM payload stays cached). SmokeTest now extends it.
  • E2E project gains a ProjectReference to XnaFiddle.Core for deterministic UrlCodec payloads.

App-code changes — test hooks only, no behavior change

  • data-testid on: Stop, Examples, Share, Assets buttons; example cards (+ data-example-name); the share URL input; snippet toggle; diagnostics pane; canvas.
  • One debug hook: GetInputDebugState JSInvokable ({ gameRunning, mouseX, mouseY, touchCount }) for the sample-switch aliveness assertion — the one hook the e2e-testing skill's boundary allows.

Cuts (no silent drops)

Notes

  • Mouse trail example broken on desktop (suspected #90/PR #93 regression) #95 folded in (tests 4/5) and closed as superseded.
  • CI stays windows-latest; dotnet test auto-discovers the new tests — no workflow edit.
  • Local run: 14/14 green in ~1.5 min (no shader test).
  • Skill e2e-testing updated: per-test isolation, the fragment-only-navigation no-reload gotcha, and the new test hooks.

Closes #112
Closes #95

🤖 Generated with Claude Code

vchelaru and others added 2 commits July 1, 2026 05:44
Adds 12 Playwright .NET e2e tests covering compile/run core, examples,
Reach<->HiDef profile switch, #code=/#snippet= URL round-trips, a cold-boot
deep link, Monaco boot, IntelliSense completion, and embed mode — so a
regression in any core path fails CI. Foundation smoke tests (#97/#90) are
kept.

Harness: extract E2ETestBase — host+browser+context shared in OneTimeSetUp,
a fresh IPage per [SetUp] so a running game / set _canvasContextType can't
leak across tests. SmokeTest now extends it.

App changes are test hooks only (no behavior): data-testid on the Stop,
Examples, Share, Assets buttons + example cards, share URL input, snippet
toggle, diagnostics pane, and canvas; plus one GetInputDebugState JSInvokable
debug hook for the sample-switch aliveness assertion.

Cuts (no silent drops): #13 file-input asset load (no file <input>; drag-drop
un-synthesizable), #14 shader compile (~17 MB DXC wasm, slow), #15 export zip
(lowest value). Supersedes #95 (folded in as tests 4/5).

Local run: 14/14 green in ~1.5 min.

Closes #112
Closes #95

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename the e2e.yml 'Publish Blazor WASM app' step and the deploy.yml 'Publish'
step so the overloaded word 'publish' can't be mistaken for a live deploy. The
E2E step produces static output served locally to headless Chromium (test
input, never leaves the runner); the deploy step is the real GitHub Pages
publish. Kept the dotnet 'publish' verb in the names because Blazor WASM
requires publish (not build) to lay out the _framework boot files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vchelaru
vchelaru merged commit 631db28 into main Jul 1, 2026
1 check passed
@vchelaru
vchelaru deleted the test/112-broaden-e2e-coverage branch July 1, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broaden e2e coverage: pin ~10-15 core behaviors in one PR Mouse trail example broken on desktop (suspected #90/PR #93 regression)

1 participant