test_screenshot 0.0.2
test_screenshot: ^0.0.2 copied to clipboard
Take screenshots during your unit tests or integration tests
Take screenshots during your unit tests or integration tests.
usage #
- Wrap your widget tree with a
Screenshotterwidget - call
tester.screenshot() - profit
testWidgets('should create a screenshot', (tester) async {
await tester.pumpWidget(
Screenshotter(
child: MaterialApp(
home: Scaffold(body: Center(child: Icon(Icons.home))),
),
),
);
await tester.screenshot(path: file.path);
});