Repository navigation
test(gui): add Playwright screenshot harness - #619
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: LargeModGames/spotatui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAdds Playwright screenshot tests for three GUI scenes. The GUI workflow installs the required browsers, runs the tests, and uploads generated screenshots as an artifact. ChangesGUI Screenshot Testing
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Other Sequence Diagram(s)sequenceDiagram
participant SceneTests as scenes.shot.ts
participant BridgeHelper as openWith
participant GUIPage as GUI page
participant ScreenshotHelper as shot
SceneTests->>BridgeHelper: Supply server-message fixtures
BridgeHelper->>GUIPage: Route WebSocket and send messages
BridgeHelper->>GUIPage: Navigate to launch-code page
GUIPage-->>SceneTests: Render expected scene text
SceneTests->>ScreenshotHelper: Capture scene
ScreenshotHelper->>GUIPage: Wait for document.fonts.ready
ScreenshotHelper-->>SceneTests: Save PNG by browser project
Merge Risk: ⚪ Minimal · up to The screenshot harness and CI artifact workflow are ready to merge after normal checks. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Adds a Playwright screenshot harness for the browser frontend in
gui/, so the GUI screens can be checked as pictures without a Spotify session or a running spotatui.npm run shotsbuilds the page, servesdistwithvite preview, and fakes the bridge withpage.routeWebSocket. The page code is unchanged.gui/e2e/fixtures.tsare typed with the ts-rs bindings, so a protocol change breakstscinstead of silently breaking the pictures.gui/shots/: Chromium, Firefox and WebKit.spotatui-guiopens the user's default browser, and WebKit is the engine a desktop shell uses on Linux and macOS.npm run shotsand uploads the pictures as thegui-shotsartifact.*.shot.tsname so vitest does not pick them up.AGENTS.mddocuments the command.Testing
Run in
gui/on Windows:All nine pictures are 1440x900; I opened the Chromium, Firefox and WebKit ones and they show the page driven by the fake bridge. No Rust code changed; the slim
cargo test --no-default-features --features telemetry,tuipassed (1263 passed) before the push.Not run here: the workflow on
ubuntu-latest(npx playwright install --with-depspulls the browsers' system packages there).Additional notes
The pictures of this PR's CI run are in the
gui-shotsartifact of the GUI workflow.💬 Questions or want to chat with other contributors? Join the spotatui Discord.
Summary by CodeRabbit