m3_lightmeter/test_driver/screenshot_driver.dart

17 lines
461 B
Dart
Raw Normal View History

import 'dart:io';
2024-05-11 12:59:28 +00:00
import 'package:integration_test/integration_test_driver_extended.dart';
2024-05-14 12:57:08 +00:00
import '../screenshots/models/screenshot_args.dart';
Future<void> main() async {
await integrationDriver(
2024-05-11 12:59:28 +00:00
onScreenshot: (name, bytes, [_]) async {
final screenshotArgs = ScreenshotArgs.fromString(name);
2024-05-14 12:57:08 +00:00
final file = await File(screenshotArgs.toPathRaw()).create(recursive: true);
2024-05-14 14:15:19 +00:00
file.writeAsBytesSync(bytes);
return true;
},
);
}