Create screenshot_driver.dart

This commit is contained in:
Vadim 2023-09-25 12:10:51 +02:00
parent 5b1b0b0540
commit 447b9eddcc
2 changed files with 20 additions and 3 deletions

View file

@ -24,9 +24,7 @@ dependencies:
intl_utils: 2.8.2
light_sensor: 2.0.2
m3_lightmeter_iap:
git:
url: "https://github.com/vodemn/m3_lightmeter_iap"
ref: v0.4.0
path: iap
m3_lightmeter_resources:
git:
url: "https://github.com/vodemn/m3_lightmeter_resources"
@ -48,6 +46,8 @@ dev_dependencies:
flutter_test:
sdk: flutter
google_fonts: 3.0.1
integration_test:
sdk: flutter
lint: 2.1.2
mocktail: 0.3.0
test: 1.24.1

View file

@ -0,0 +1,17 @@
import 'dart:developer';
import 'dart:io';
import 'package:integration_test/integration_test_driver_extended.dart';
Future<void> main() async {
try {
await integrationDriver(
onScreenshot: (name, bytes, [args]) async {
final File image = await File('screenshots/$name.png').create(recursive: true);
image.writeAsBytesSync(bytes);
return true;
},
);
} catch (e) {
log('Error occured: $e');
}
}