You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
More details for "Running Flutter Driver tests with Web" can be found in [wiki](https://github.com/flutter/flutter/wiki/Running-Flutter-Driver-tests-with-Web).
40
+
41
+
## Adding screenshot tests
42
+
43
+
In order to test screenshot tests the tests on the driver side needs to call the `integration_test` package with an `onScreenshot` callback which can do a comparison between the `screenshotBytes` taken during the test and a golden file. We added a utility method that can do this comparison by using a golden in `flutter/goldens` repository. In order to use screenshot testing follow these steps:
44
+
45
+
1. Call `screenshot_support.dart` from the driver side test (example: text_editing_integration_test.dart). Default value for `diffRateFailure` is 0.5 .
46
+
47
+
```
48
+
import 'package:regular_integration_tests/screenshot_support.dart' as test;
4. The golden will be under `engine/src/flutter/lib/web_ui/.dart_tool/goldens/engine/web/` directory, you should create a PR for that file and merge it to `flutter/goldens`.
73
+
74
+
5. Get the commit no and replace the `revision` in this file: `engine/src/flutter/lib/web_ui/dev/goldens_lock.yaml`
75
+
76
+
6. Don't forget to rechange the flag to switch goldens from update mode to comparison mode.
0 commit comments