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
Screenshot taken with LiveTestWidgetsFlutterBinding is truncated #66006
Comments
/cc @Piinks |
What if we just have the binding throw a repaint boundary around the whole view? |
That's a great idea for a workaround! Sending #70368 |
The problem here is that |
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 |
This is roughly what happened for reference:
The next step would be for a Googler to debug this test and figure out why it the screenshots are inconsistent without the repaint boundary. |
This issue is marked P1 but has had no recent status updates. The P1 label indicates high-priority issues that are at the top of the work list. This is the highest priority level a bug can have if it isn't affecting a top-tier customer or breaking the build. Bugs marked P1 are generally actively being worked on unless the assignee is dealing with a P0 bug (or another P1 bug). Issues at this level should be resolved in a matter of months and should have monthly updates on GitHub. Please consider where this bug really falls in our current priorities, and label it or assign it accordingly. This allows people to have a clearer picture of what work is actually planned. Thanks! |
Internal: b/168776765
When using
LiveTestWidgetsFlutterBinding
, screenshots of top level widgets are truncated.Context: We're trying to support screenshot testing in g3 with
package:integration_test
, where the widgets binding inherits fromLiveTestWidgetsFlutterBinding
. The following is a minimal repro with justflutter test
.Steps to Reproduce
Run
flutter test
with the following test file:Expected behavior: Screenshot covers the full
MaterialApp
.Similar to this image from AutomatedTestWidgetsFlutterBinding (with L5 commented out)
Actual Image (which looks truncated)
When I added some instrumentation to the
renderObject
used for taking a screenshot atflutter/packages/flutter_test/lib/src/_matchers_io.dart
Line 32 in fa64633
The
renderObject
is aLiveTestRenderView
:_LiveTestRenderView#c6f40
.Adding a
RepaintBoundary
aroundMaterialApp
(the last second line of the snippet) fixes the issue.LiveTestWidgetsFlutterBinding with RepaintBoundary Image
#12994 looks like it could be related. It is pretty unexpected that a
RepaintBoundary
is needed just forLiveTestWidgetsFlutterBinding
, but not for the defaultAutomatedTestWidgetsFlutterBinding
, so this could be a bug. WithAutomatedTestWidgetsFlutterBinding
, therenderObject
used for the screenshot isRenderRepaintBoundary#1d14f
.Another thing I noticed is that if the following
flutter/packages/flutter_test/lib/src/binding.dart
Line 1674 in fa64633
the correct bounds are used for the image, though this probably isn't the correct fix.
Doctor Output
The text was updated successfully, but these errors were encountered: