This commit is contained in:
Vadim 2025-03-31 10:17:23 +02:00
parent 4da29f4569
commit 92910990d1

View file

@ -2,7 +2,6 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
import 'package:lightmeter/data/shared_prefs_service.dart';
@ -54,7 +53,6 @@ void testE2E(String description) {
customFilms: {},
);
try {
/// Create Praktica + Zenitar profile from scratch
await tester.openSettings();
await tester.tapDescendantTextOf<SettingsScreen>(S.current.equipmentProfiles);
@ -116,7 +114,7 @@ void testE2E(String description) {
tester,
equipmentProfile: mockEquipmentProfiles[0],
film: mockFilms[0],
fastest: 'f/1.8 - 1/200',
fastest: 'f/1.8 - 1/20',
slowest: 'f/16 - 1/2.5',
iso: '400',
nd: '2',
@ -159,10 +157,6 @@ void testE2E(String description) {
await tester.deleteEdits();
expect(find.text(mockEquipmentProfiles[0].name), findsNothing);
expect(find.text(mockEquipmentProfiles[1].name), findsOneWidget);
} on TestFailure catch (_) {
await tester._takeScreenshot('screenshot_e2e');
rethrow;
}
},
);
}
@ -355,10 +349,3 @@ void expectMeasureButton(double ev) {
matching: find.text('${ev.toStringAsFixed(1)}\n${S.current.ev}'),
);
}
extension on WidgetTester {
Future<void> _takeScreenshot(String name) async {
await IntegrationTestWidgetsFlutterBinding.instance.takeScreenshot(name);
await pumpAndSettle();
}
}