Repository navigation
Add basic support for golden image file testing - #17094
Merged
Merged
Conversation
Contributor
Author
|
This includes #17085, which should be reviewed first. |
* Add a `matchesGoldenFile()` async matcher that will match a finder's widget's rasterized image against a golden file. * Add support for pluggable image comparison backends * Add a default backend that does simplistic PNG byte comparison on locally stored golden files. * Add support for `flutter test --update-goldens`, which will treat the rasterized image bytes produced during the test as the new golden bytes and update the golden file accordingly Still TODO: * Add support for the `flutter_test_config.dart` test config hook * Utilize `flutter_test_config.dart` in `packages/flutter/test` to install a backend that retrieves golden files from a dedicated `flutter/goldens` repo #16859
gspencergoog
approved these changes
Apr 30, 2018
| import 'package:meta/meta.dart'; | ||
| import 'package:test/test.dart'; | ||
| import 'package:test/test.dart' hide TypeMatcher; | ||
| import 'package:test/src/frontend/async_matcher.dart'; // ignore: implementation_imports |
Contributor
There was a problem hiding this comment.
Is this the only way to define an AsyncMatcher subclass? Too bad we have to ignore lint for it to be possible.
Contributor
DaveShuckerow
pushed a commit
to DaveShuckerow/flutter
that referenced
this pull request
May 14, 2018
* Add a `matchesGoldenFile()` async matcher that will match a finder's widget's rasterized image against a golden file. * Add support for pluggable image comparison backends * Add a default backend that does simplistic PNG byte comparison on locally stored golden files. * Add support for `flutter test --update-goldens`, which will treat the rasterized image bytes produced during the test as the new golden bytes and update the golden file accordingly Still TODO: * Add support for the `flutter_test_config.dart` test config hook * Utilize `flutter_test_config.dart` in `packages/flutter/test` to install a backend that retrieves golden files from a dedicated `flutter/goldens` repo flutter#16859
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

matchesGoldenFile()async matcher that will matcha finder's widget's rasterized image against a golden file.
comparison on locally stored golden files.
flutter test --update-goldens, which willtreat the rasterized image bytes produced during the test
as the new golden bytes and update the golden file accordingly
Still TODO:
flutter_test_config.darttest config hookflutter_test_config.dartinpackages/flutter/testto install a backend that retrieves golden files from a dedicated
flutter/goldensrepo#16859