Integration test not running with flavor
812
Because you are using flavors, you need to specify which flavor you want to run your app:
flutter drive \
--driver=test_driver/integration_test.dart \
--target=integration_test/main_functions_test.dart --flavor development
Author by
Khamidjon Khamidov
Loves Coding. Problem Solver, Android and Flutter Developer, Linux enthusiast
Updated on November 23, 2022Comments
-
Khamidjon Khamidov over 1 year
I am running integration tests with Flutter application. I am also using
Flavors
in Flutter. The problem is it is giving me this error:Gradle build failed to produce an .apk file. It's likely that this file was generated under /home/khamidjon/Desktop/android_flutter_projects/my-project/build, but the tool couldn't find it.
- I have put all the dependencies inside
pubspec.yaml
. - created 3 directories as docs mentioned: integration_test/, test_driver/, test/
test_driver/integration_test.dart:
import 'package:integration_test/integration_test_driver.dart'; Future<void> main() => integrationDriver();
integration_test/main_functions_test.dart:
import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); testWidgets("failing test example", (WidgetTester tester) async { expect(2 + 2, equals(5)); }); }
Then run following command in terminal:
flutter drive \ --driver=test_driver/integration_test.dart \ --target=integration_test/main_functions_test.dart
- I have put all the dependencies inside