-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add back screenshot extension that was temporarily disabled. #21828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add back screenshot extension that was temporarily disabled. #21828
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was previously reviewed just without the outer assert block to avoid the code from being included in release builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed when I re-applied this that I was missing a test that actually tested end to end instead of just testing the
InspectorService.screenshot method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If desired I can simplify so that this matcher only works for
ui.Image and Future<ui.Image> and not for Finder.
4029372 to
47cb257
Compare
Add matchesReferenceImage matcher to test that the screenshot extension generates equivalent images to InspectorService.instance.screenshot.
47cb257 to
9227c68
Compare
| /// ```dart | ||
| /// await expectLater(find.text('Save'), matchesReferenceImage(referenceImage)); | ||
| /// await expectLater(image, matchesReferenceImage(referenceImage); | ||
| /// await expectLater(imageFuture, matchesReferenceImage(referenceImage)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sample code should explain how to get a referenceImage in the first place
| import 'dart:ui' as ui; | ||
|
|
||
| import 'package:flutter_test/flutter_test.dart'; | ||
| import 'package:test/src/frontend/async_matcher.dart'; // ignore: implementation_imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we shouldn't import test directly... can you elaborate on why you need this?
7e023c9 to
343d253
Compare
…dle-fix * commit '3c22d7b025642abd865160970d39f8c5ba7d3162': clarify how to display an image with a specific density (flutter#21152) Roll engine 9e315e6..2e8e96f (2 commits) (flutter#22005) Make helper and error text separate widgets, make error and counter live region (flutter#21752) Use Xcode legacy build system for iOS builds (flutter#21901) (flutter#21994) Run logcat through shell (flutter#21977) Add back screenshot extension that was temporarily disabled. (flutter#21828)
Add matchesReferenceImage matcher to test that the screenshot extension
generates equivalent images to InspectorService.instance.screenshot.