mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
use flutter drive for integration tests
This commit is contained in:
parent
c79a578286
commit
ed45052317
5 changed files with 15 additions and 9 deletions
5
.github/scripts/run_integration_tests.sh
vendored
Normal file
5
.github/scripts/run_integration_tests.sh
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
flutter drive \
|
||||||
|
--target=integration_test/e2e_test.dart \
|
||||||
|
--driver=test_driver/integration_driver.dart \
|
||||||
|
--flavor=dev \
|
||||||
|
--dart-define cameraStubImage=assets/camera_stub_image.jpg
|
8
.github/workflows/run_integration_tests.yml
vendored
8
.github/workflows/run_integration_tests.yml
vendored
|
@ -9,10 +9,6 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_ARGS: --flavor dev --dart-define cameraStubImage=assets/camera_stub_image.jpg
|
|
||||||
TARGET: integration_test/run_all_tests.dart
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-integration-tests:
|
run-integration-tests:
|
||||||
name: Run integration tests
|
name: Run integration tests
|
||||||
|
@ -71,7 +67,7 @@ jobs:
|
||||||
target: default
|
target: default
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
profile: pixel_6
|
profile: pixel_6
|
||||||
script: flutter test $TARGET $BUILD_ARGS
|
script: bash .github/scripts/run_integration_tests.sh
|
||||||
|
|
||||||
- name: Launch iOS simulator
|
- name: Launch iOS simulator
|
||||||
uses: futureware-tech/simulator-action@v3
|
uses: futureware-tech/simulator-action@v3
|
||||||
|
@ -80,4 +76,4 @@ jobs:
|
||||||
model: "iPhone 15 Pro"
|
model: "iPhone 15 Pro"
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
if: ${{ matrix.os == 'macos-13' }}
|
if: ${{ matrix.os == 'macos-13' }}
|
||||||
run: flutter test $TARGET $BUILD_ARGS
|
run: bash .github/scripts/run_integration_tests.sh
|
||||||
|
|
|
@ -2,6 +2,7 @@ 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';
|
||||||
|
@ -24,6 +25,8 @@ import 'mocks/paid_features_mock.dart';
|
||||||
import 'utils/expectations.dart';
|
import 'utils/expectations.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
SharedPreferences.setMockInitialValues({
|
SharedPreferences.setMockInitialValues({
|
||||||
/// Metering values
|
/// Metering values
|
||||||
|
|
5
integration_test/run_integration_tests.sh
Normal file
5
integration_test/run_integration_tests.sh
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
flutter drive \
|
||||||
|
--target=integration_test/e2e_test.dart \
|
||||||
|
--driver=test_driver/integration_driver.dart \
|
||||||
|
--flavor=dev \
|
||||||
|
--dart-define cameraStubImage=assets/camera_stub_image.jpg
|
|
@ -1,8 +1,5 @@
|
||||||
import 'package:integration_test/integration_test_driver_extended.dart';
|
import 'package:integration_test/integration_test_driver_extended.dart';
|
||||||
|
|
||||||
import 'utils/grant_camera_permission.dart';
|
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
await grantCameraPermission();
|
|
||||||
await integrationDriver();
|
await integrationDriver();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue