Repository navigation
test(e2e): browser e2e tests for 2D and 3D games - #461
Merged
Merged
Conversation
Two small client-only test games (graphics-2d, graphics-3d forced on WebGL) run in Chromium through Playwright. Each is checked for: booting without errors, input changing game state, pixels at known spots, and a reference screenshot (compared on Linux only, 1% tolerance). Bumps the loader to 1.6.0: with 1.5.1 the loading screen stays on top of the running game.
josephinecr
approved these changes
Nov 6, 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.
What does this PR do?
Adds Playwright e2e tests that run a 2D and a 3D game in Chromium and check what the player sees.
e2e/game-2d(graphics-2d) ande2e/game-3d(graphics-3d withforceWebGL: true). Each setswindow.__e2e(tick count, player position or cube rotation, 3D backend) so the tests can wait on known ticks. Movement is a fixed step per tick, so pixels do not depend on frame timing.e2e/graphics/*.spec.ts):toHaveScreenshotwith a 1% tolerance plus antialiasing detection. Compared on Linux only (ignoreSnapshotselsewhere), because the reference images come from CI's Chromium.graphicsjob intests.ymlonubuntu-24.04, with one worker and a 30 s screenshot timeout (SwiftShader renders WebGL on the CPU there). The report and screenshots are uploaded as thegraphics-e2eartifact.display: flexoverrideshidden. The new tests caught this.To update the reference screenshots after an intended visual change: run Tests from the Actions tab with
update-snapshotschecked on your branch, download thegraphics-e2eartifact, and commite2e/graphics/*-snapshots/.How do you test this PR?
pnpm exec playwright install chromium, thenpnpm test:e2e:graphics. Locally on macOS, all 8 pass, with the screenshot comparisons skipped.