Repository navigation
[integration_test] Wrap pumped widgets with a RepaintBoundary - #70368
Conversation
| // TODO(jiahaog): Remove when https://github.com/flutter/flutter/issues/66006 is fixed. | ||
| testWidgets('root widgets are wrapped with a RepaintBoundary', (WidgetTester tester) async { | ||
| await tester.pumpWidget(const Placeholder()); | ||
|
|
||
| expect(find.byType(RepaintBoundary), findsOneWidget); | ||
| }); |
There was a problem hiding this comment.
Rather than this test, can we just add a golden test for this?
Just pump a simple/hello world app, use the screenshot method, and use the Skia gold comparison logic to compare it.
There was a problem hiding this comment.
Sure, I can do that. Wouldn't it be clearer that we're specifically asserting for the RepaintBoundary by doing it in code here though?
There was a problem hiding this comment.
Sure, but I think the idea is that we care if the screen shot works, and we don't particularly care where a repaint boundary is :)
There was a problem hiding this comment.
That makes sense. I couldn't quite figure out how to get matchesGoldenFile to work with Skia gold though (following https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter). cc @Piinks - is the Skia golden integration supported for non-package:flutter packages like this? If not I can just check in the png into the tests/ directory alongside this test, but not sure if that's the best practice for this repo.
There was a problem hiding this comment.
The Skia Gold integration does not currently work outside of the flutter package, no. It is set up with the flutter_test_config.dart in flutter/test. Maybe we can expand it? Not sure if there will be more integration tests requiring Skia support.
|
(PR triage) Are there still plans for this PR? |
|
Let's land this as is for now and have a bug to track getting golden image support for it. |
dnfield
left a comment
There was a problem hiding this comment.
LGTM. An actual gold test would be good, but let's not block the functionality in the meantime.
|
Sorry, I wasn't able to find time to figure out the Skia Gold integration, filed #72045 for that, thanks! |
Description
Workaround for #66006, where screenshots have incorrect bounds. Let me know if otherwise, but adding it here instead of
LiveTestWidgetsFlutterBindingsince taking screenshots doesn't seem like a common use case for that.Tests
I added the following tests:
Test that widgets are wrapped by the
RepaintBoundaryBreaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.