more diagnostic screenshots

This commit is contained in:
Vadim 2025-03-31 13:01:15 +02:00
parent 568a82128f
commit 224bb9659b
2 changed files with 12 additions and 2 deletions

View file

@ -27,7 +27,7 @@ import 'mocks/paid_features_mock.dart';
import 'utils/expectations.dart';
@isTest
void testE2E(String description) {
void testE2E(String description, {required Future<void> Function() screenshotCallback}) {
setUp(() async {
SharedPreferences.setMockInitialValues({
/// Metering values
@ -76,6 +76,7 @@ void testE2E(String description) {
await tester.pumpAndSettle();
await tester.enterProfileName(mockEquipmentProfiles[1].name);
await tester.setApertureValues(mockEquipmentProfiles[1].apertureValues);
await screenshotCallback();
await tester.setZoomValue(mockEquipmentProfiles[1].lensZoom);
expect(find.text('x5.02'), findsOneWidget);
expect(find.text('f/3.5 - f/22'), findsOneWidget);
@ -97,6 +98,7 @@ void testE2E(String description) {
expectPickerTitle<FilmPicker>(mockFilms[0].name);
expectPickerTitle<IsoValuePicker>('400');
await tester.takePhoto();
await screenshotCallback();
await _expectMeteringState(
tester,
equipmentProfile: mockEquipmentProfiles[0],
@ -110,6 +112,7 @@ void testE2E(String description) {
/// Add ND to shoot another scene
await tester.openPickerAndSelect<NdValuePicker, NdValue>('2');
await screenshotCallback();
await _expectMeteringStateAndMeasure(
tester,
equipmentProfile: mockEquipmentProfiles[0],
@ -124,6 +127,7 @@ void testE2E(String description) {
/// Select another lens without ND
await tester.openPickerAndSelect<EquipmentProfilePicker, EquipmentProfile>(mockEquipmentProfiles[1].name);
await tester.openPickerAndSelect<NdValuePicker, NdValue>('None');
await screenshotCallback();
await _expectMeteringStateAndMeasure(
tester,
equipmentProfile: mockEquipmentProfiles[1],
@ -138,6 +142,7 @@ void testE2E(String description) {
/// Set another film and another ISO
await tester.openPickerAndSelect<IsoValuePicker, IsoValue>('200');
await tester.openPickerAndSelect<FilmPicker, Film>(mockFilms[1].name);
await screenshotCallback();
await _expectMeteringStateAndMeasure(
tester,
equipmentProfile: mockEquipmentProfiles[1],

View file

@ -9,5 +9,10 @@ void main() {
testPurchases('Purchase & refund premium features');
testToggleLayoutFeatures('Toggle metering screen layout features');
testE2E('e2e');
testE2E(
'e2e',
screenshotCallback: () async {
await IntegrationTestWidgetsFlutterBinding.instance.takeScreenshot('screenshot_e2e');
},
);
}