The screenshot image that i received, does not include the status bar portion of the app. As you can see below(the first image), the very upper part of the app is being cut off.
The 2nd image is the kind of image i am expecting but failed to obtained.
// My screenshot_test.dart
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:end_point/main.dart' as app;
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('App test', () {
testWidgets("test infinite pagination", (tester) async {
app.main();
await tester.pumpAndSettle();
await binding.convertFlutterSurfaceToImage();
await tester.pumpAndSettle();
await binding.takeScreenshot('screenshot-home');
await tester.pumpAndSettle();
});
});
}
// my integration_test.dart
import 'dart:io';
import 'package:integration_test/integration_test_driver_extended.dart';
Future<void> main() async {
await integrationDriver(
onScreenshot: (String screenshotName, List<int> screenshotBytes) async {
final File image = File('ss/$screenshotName.png');
image.writeAsBytesSync(screenshotBytes);
// Return false if the screenshot is invalid.
return true;
},
);
}
I run the code using
"flutter drive
--driver=test_driver/integration_test.dart
--target=integration_test/screenshot_test.dart
-d iPhone SE"