4

I need to run my app with build variants config. Like this

flutter run --flavor dev

I've added some integration_tests, for running those I tried to use this command

flutter test integration_test/login_test.dart 

How can I specify my build variants here while running tests?

Shahrear Bin Amin
  • 1,075
  • 13
  • 31

2 Answers2

1

I recently migrated my integration_test to the "new version" with the next dependencies:

dev_dependencies:
   integration_test:
      sdk: flutter
   flutter_test:
    sdk: flutter

It was very frustrating to have flavours enabled but not be able to run the integration test as the oficial documentation says (by using the command:

flutter test test/counter_test.dart

The only way i found to "run" the test with the --flavor thing was by running:

flutter run --flavor production integration_test/app_test.dart
0

Unfortunately, the flutter test does not support the flavor(build variant).

for this flutter, the driver is used, which allow us to mention flavor

flutter drive --driver=test_driver/driver.dart --target=integration_test/sample.dart --flavor dev
Jitesh Mohite
  • 31,138
  • 12
  • 157
  • 147