Repository navigation
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
Part of #191313
Problem
In the Flutter Web Engine (`lib/web_ui`), running screenshot tests locally with `felt test` bypasses comparison entirely. `image_compare.dart` stubs out golden fetching and unconditionally returns `'OK'`, deferring all visual regression testing to remote CI tryjobs.
Solution
- Fetch approved positive baselines from Skia Gold's REST API and cache them in `/.dart_tool/web_goldens_cache/baselines/`.
- Implement local in-memory pixel diffing (both precise and fuzzy 3x3 neighborhood matching).
- On comparison failure, save `actual.png`, `expected.png`, and `diff.png` (with highlighted differences in magenta) under `.dart_tool/web_goldens_cache/failures/<test_name>/`, and output clickable `file://` links.
- Support `--offline` to run against cached baselines and `--refresh-goldens` to force re-downloading.
Critical Edge Cases & Implementation Gotchas
- Device Pixel Ratio (DPR) Alignment ([web] Flutter test suite in the web needs love. #143124): Headless Chrome starts with default DPR = 1.0 unless explicitly passed `--force-device-scale-factor=X`. Local diffing must enforce matching DPR flags when launching Chrome to avoid false-positive diff failures against Skia Gold CI baselines.
Related Issues & Historical Context
- [web] download goldens from https for windows web engine unit tests #63710: [web] download goldens from https for windows web engine unit tests (Satisfied by REST baseline downloading; close on landing)
- [web] skipped image tests failing gold checks when enabled. #87933: [web] skipped image tests failing gold checks when enabled (Downstream validation target)
- [web] Flutter test suite in the web needs love. #143124: [web] Flutter test suite in the web needs love
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Activity
[web] Support local screenshot and golden testing in felt test (flutt…
github-actions commentedon Sep 23, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.