run e2e with all tests

This commit is contained in:
Vadim 2024-03-13 12:56:03 +01:00
parent 1f30c74d18
commit 4b8e5c2659
5 changed files with 25 additions and 10 deletions

View file

@ -63,7 +63,3 @@ jobs:
bash ./.github/scripts/stub_iap.sh bash ./.github/scripts/stub_iap.sh
flutter pub get flutter pub get
flutter analyze lib --fatal-infos flutter analyze lib --fatal-infos
run-integration-tests:
uses: ./.github/workflows/run_integration_tests.yml
secrets: inherit

View file

@ -49,7 +49,7 @@ jobs:
- name: Run tests - name: Run tests
run: | run: |
flutter drive \ flutter drive \
--target=integration_test/e2e_test.dart \ --target=integration_test/run_all_tests.dart \
--driver=test_driver/integration_driver.dart \ --driver=test_driver/integration_driver.dart \
--flavor=dev \ --flavor=dev \
--no-dds \ --no-dds \

View file

@ -0,0 +1,18 @@
# M3 Lightmeter integration tests
### List of executed tests:
- [Purchases test](integration_test/purchases_test.dart)
- [Metering screen layout test](integration_test/metering_screen_layout_test.dart)
- [e2e](integration_test/e2e_test.dart)
### Run all tests
```console
flutter drive \
--target=integration_test/run_all_tests.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--no-dds \
--dart-define cameraStubImage=assets/camera_stub_image.jpg
```

View file

@ -2,7 +2,6 @@ import 'dart:convert';
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:lightmeter/data/models/ev_source_type.dart'; import 'package:lightmeter/data/models/ev_source_type.dart';
import 'package:lightmeter/data/models/metering_screen_layout_config.dart'; import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
import 'package:lightmeter/data/shared_prefs_service.dart'; import 'package:lightmeter/data/shared_prefs_service.dart';
@ -18,15 +17,15 @@ import 'package:lightmeter/screens/settings/components/shared/dialog_filter/widg
import 'package:lightmeter/screens/settings/components/shared/dialog_range_picker/widget_dialog_picker_range.dart'; import 'package:lightmeter/screens/settings/components/shared/dialog_range_picker/widget_dialog_picker_range.dart';
import 'package:lightmeter/screens/settings/screen_settings.dart'; import 'package:lightmeter/screens/settings/screen_settings.dart';
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
import 'package:meta/meta.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../integration_test/utils/widget_tester_actions.dart'; import '../integration_test/utils/widget_tester_actions.dart';
import 'mocks/paid_features_mock.dart'; import 'mocks/paid_features_mock.dart';
import 'utils/expectations.dart'; import 'utils/expectations.dart';
void main() { @isTest
IntegrationTestWidgetsFlutterBinding.ensureInitialized(); void testE2E(String description) {
setUp(() { setUp(() {
SharedPreferences.setMockInitialValues({ SharedPreferences.setMockInitialValues({
/// Metering values /// Metering values
@ -42,7 +41,7 @@ void main() {
}); });
testWidgets( testWidgets(
'e2e', description,
(tester) async { (tester) async {
await tester.pumpApplication(equipmentProfiles: [], films: []); await tester.pumpApplication(equipmentProfiles: [], films: []);

View file

@ -1,5 +1,6 @@
import 'package:integration_test/integration_test.dart'; import 'package:integration_test/integration_test.dart';
import 'e2e_test.dart';
import 'metering_screen_layout_test.dart'; import 'metering_screen_layout_test.dart';
import 'purchases_test.dart'; import 'purchases_test.dart';
@ -8,4 +9,5 @@ void main() {
testPurchases('Purchase & refund premium features'); testPurchases('Purchase & refund premium features');
testToggleLayoutFeatures('Toggle metering screen layout features'); testToggleLayoutFeatures('Toggle metering screen layout features');
testE2E('e2e');
} }