Skip to content

[Web Engine] Support local screenshot and golden testing in felt test #191314

Closed

Description

@harryterkelsen

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

  1. Fetch approved positive baselines from Skia Gold's REST API and cache them in `/.dart_tool/web_goldens_cache/baselines/`.
  2. Implement local in-memory pixel diffing (both precise and fuzzy 3x3 neighborhood matching).
  3. 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.
  4. 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

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    platform-webWeb applications specifically
    team-webOwned by Web platform team
    on Aug 18, 2026
  2. added
    P1High-priority issues at the top of the work list
    triaged-webTriaged by Web platform team
    on Aug 19, 2026
  3. github-actions commented on Sep 23, 2026

    @github-actions

    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 -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions