mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
19 lines
552 B
Dart
19 lines
552 B
Dart
import 'dart:io';
|
|
|
|
import 'package:integration_test/integration_test_driver_extended.dart';
|
|
|
|
// cf. https://dev.to/mjablecnik/take-screenshot-during-flutter-integration-tests-435k
|
|
Future<void> main() async {
|
|
try {
|
|
await integrationDriver(
|
|
onScreenshot: (String screenshotName, List<int> screenshotBytes, [_]) async {
|
|
final File image = await File(screenshotName).create(recursive: true);
|
|
image.writeAsBytesSync(screenshotBytes);
|
|
return true;
|
|
},
|
|
);
|
|
} catch (e) {
|
|
print('An error occurred: $e');
|
|
}
|
|
}
|