-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsf: integration_testThe flutter/packages/integration_test pluginThe flutter/packages/integration_test pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test"flutter driver", flutter_drive, or a driver test
Milestone
Description
Right now it's pretty awkward to use a single example app for both E2E and Espresso tests running on the plugins CI.
gradle app:assembleDebug will try to include all the tests by default, pointing at a single Dart entry point file.
The E2E package's FlutterRunner expects the E2EWidgetsFlutterBinding while Espresso expects the Flutter driver extension's _DriverBinding.
Possible high-level approaches:
- Have multiple example apps, one for each type of test. This isn't very satisfying since an app developer probably wants to share the majority of their code in a single Android app project. One app could depend on the other, allowing to some code reuse. In the future, developers will want to run and debugging a single test, so it would be nice if our approach scales to that.
- Use test filtering to omit some tests from the app bundle. CI could point at a different test file depending on the type of test being run. This is a bit less efficient as you have to make an app bundle for each test you want to run, and it could be somewhat brittle.
- Combine
E2EWidgetsFlutterBindingand_DriverBindinginto a binding class that is compatible with the flutter_test package and can also receive commands from EspressoFlutter, FlutterDriver, etc. This is probably the right long term approach but it will require some refactoring of the class hierarchy. - @xster suggested passing arguments to the Flutter shell when it is created. https://github.com/flutter/engine/blob/master/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java
- Multiple entry points, using
getDartEntrypointFunctionName.
Related issues
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsf: integration_testThe flutter/packages/integration_test pluginThe flutter/packages/integration_test pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test"flutter driver", flutter_drive, or a driver test