mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-26 17:30:41 +00:00
generate single dark screenshots
This commit is contained in:
parent
e231e09929
commit
4890eea1b7
1 changed files with 52 additions and 30 deletions
|
@ -82,6 +82,7 @@ void main() {
|
||||||
|
|
||||||
mockCaffeineService = _MockCaffeineService();
|
mockCaffeineService = _MockCaffeineService();
|
||||||
when(() => mockCaffeineService.isKeepScreenOn()).thenAnswer((_) async => false);
|
when(() => mockCaffeineService.isKeepScreenOn()).thenAnswer((_) async => false);
|
||||||
|
when(() => mockCaffeineService.keepScreenOn(true)).thenAnswer((_) async => true);
|
||||||
when(() => mockCaffeineService.keepScreenOn(false)).thenAnswer((_) async => false);
|
when(() => mockCaffeineService.keepScreenOn(false)).thenAnswer((_) async => false);
|
||||||
|
|
||||||
mockHapticsService = _MockHapticsService();
|
mockHapticsService = _MockHapticsService();
|
||||||
|
@ -109,12 +110,7 @@ void main() {
|
||||||
when(() => mockHapticsService.responseVibration()).thenAnswer((_) async {});
|
when(() => mockHapticsService.responseVibration()).thenAnswer((_) async {});
|
||||||
});
|
});
|
||||||
|
|
||||||
void generateScreenshots(Color color) {
|
Future<void> pumpApplication(WidgetTester tester) async {
|
||||||
testWidgets(
|
|
||||||
'${color.value}',
|
|
||||||
(tester) async {
|
|
||||||
when(() => mockUserPreferencesService.primaryColor).thenReturn(color);
|
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
IAPProviders(
|
IAPProviders(
|
||||||
sharedPreferences: _MockSharedPreferences(),
|
sharedPreferences: _MockSharedPreferences(),
|
||||||
|
@ -142,6 +138,16 @@ void main() {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Generates several screenshots with the light theme
|
||||||
|
/// and the additionally the first one with the dark theme
|
||||||
|
void generateScreenshots(Color color) {
|
||||||
|
testWidgets(
|
||||||
|
'${color.value}_light',
|
||||||
|
(tester) async {
|
||||||
|
when(() => mockUserPreferencesService.primaryColor).thenReturn(color);
|
||||||
|
await pumpApplication(tester);
|
||||||
|
|
||||||
//await tester.takeScreenshot(binding, '${color.value}-metering-reflected');
|
//await tester.takeScreenshot(binding, '${color.value}-metering-reflected');
|
||||||
|
|
||||||
|
@ -177,6 +183,22 @@ void main() {
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
await tester.takeScreenshot(binding, '${color.value}-equipment_profiles-iso_picker');
|
await tester.takeScreenshot(binding, '${color.value}-equipment_profiles-iso_picker');
|
||||||
},
|
},
|
||||||
|
skip: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
testWidgets(
|
||||||
|
'${color.value}_dark',
|
||||||
|
(tester) async {
|
||||||
|
when(() => mockUserPreferencesService.themeType).thenReturn(ThemeType.dark);
|
||||||
|
when(() => mockUserPreferencesService.primaryColor).thenReturn(color);
|
||||||
|
await pumpApplication(tester);
|
||||||
|
|
||||||
|
//await tester.takeScreenshot(binding, '${color.value}-metering-reflected');
|
||||||
|
|
||||||
|
await tester.tap(find.byType(MeteringMeasureButton));
|
||||||
|
await tester.tap(find.byType(MeteringMeasureButton));
|
||||||
|
await tester.takeScreenshot(binding, '${color.value}-metering-incident_dark');
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue