Compare commits

...

4 commits

Author SHA1 Message Date
Vadim
bed5c11d3e reverted pr-check 2024-03-13 13:04:27 +01:00
Vadim
4b8e5c2659 run e2e with all tests 2024-03-13 12:56:03 +01:00
Vadim
1f30c74d18 Delete run_integration_tests.sh 2024-03-13 12:50:04 +01:00
Vadim
143aca1053 restore firebase_app_id_file.json 2024-03-13 11:52:08 +01:00
7 changed files with 27 additions and 24 deletions

View file

@ -1,6 +0,0 @@
flutter drive \
--target=integration_test/e2e_test.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--no-dds \
--dart-define cameraStubImage=assets/camera_stub_image.jpg

View file

@ -6,7 +6,6 @@
name: PR check name: PR check
on: on:
workflow_dispatch:
push: push:
branches: ["main"] branches: ["main"]
pull_request: pull_request:
@ -63,7 +62,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

@ -26,8 +26,8 @@ jobs:
- name: Restore secrets - name: Restore secrets
run: | run: |
bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart" bash .github/scripts/restore_from_base64.sh "${{ secrets.CONSTANTS }}" "lib/constants.dart"
bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_ANDROID }}" "android/app/google-services.json"
bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_IOS }}" "ios/Runner/GoogleService-Info.plist" bash .github/scripts/restore_from_base64.sh "${{ secrets.GOOGLE_SERVICES_JSON_IOS }}" "ios/Runner/GoogleService-Info.plist"
bash .github/scripts/restore_from_base64.sh "${{ secrets.FIREBASE_APP_ID_FILE }}" "ios/firebase_app_id_file.json"
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
@ -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');
} }

View file

@ -1,5 +0,0 @@
flutter drive \
--target=integration_test/e2e_test.dart \
--driver=test_driver/integration_driver.dart \
--flavor=dev \
--dart-define cameraStubImage=assets/camera_stub_image.jpg