fixed screenshot generator

This commit is contained in:
Vadim 2025-05-12 00:31:20 +02:00
parent ffac40fc1f
commit b16b75bf44
2 changed files with 18 additions and 1 deletions

View file

@ -52,7 +52,7 @@ Apple requires screenshots a specific list of devices, so we can implement a cus
Can be run on Simulator. Can be run on Simulator.
```console ```console
sh screenshots/generate_ios_screenshots.sh sh screenshots/scripts/generate_ios_screenshots.sh
``` ```
### Apply store constraints and text data ### Apply store constraints and text data

View file

@ -6,6 +6,7 @@ import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'package:lightmeter/data/camera_info_service.dart';
import 'package:lightmeter/data/models/camera_feature.dart'; import 'package:lightmeter/data/models/camera_feature.dart';
import 'package:lightmeter/data/models/ev_source_type.dart'; import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/data/models/exposure_pair.dart'; import 'package:lightmeter/data/models/exposure_pair.dart';
@ -95,6 +96,19 @@ void main() {
setUpAll(() async { setUpAll(() async {
if (Platform.isAndroid) await binding.convertFlutterSurfaceToImage(); if (Platform.isAndroid) await binding.convertFlutterSurfaceToImage();
TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(
CameraInfoService.cameraInfoPlatformChannel,
(methodCall) async {
switch (methodCall.method) {
case "mainCameraEfl":
return Platform.isAndroid
? 24.0 // Pixel 6
: 26.0; // iPhone 13 Pro
default:
return null;
}
},
);
}); });
/// Generates several screenshots with the light theme /// Generates several screenshots with the light theme
@ -128,6 +142,9 @@ void main() {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tester.tap(find.byIcon(Icons.edit_outlined).first); await tester.tap(find.byIcon(Icons.edit_outlined).first);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tester.tap(find.text(S.current.isoValues)); // open and close a dialog to hide keyboard
await tester.pumpAndSettle();
await tester.tapCancelButton();
await tester.takeScreenshotLight(binding, 'equipment-profiles'); await tester.takeScreenshotLight(binding, 'equipment-profiles');
}); });