-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Conversation
## Using Flutter driver to run tests | ||
|
||
`E2EWidgetsTestBinding` supports launching the on-device tests with `flutter drive`. | ||
Note that the tests don't use the `FlutterDriver` API, they use `testWidgets` instead. | ||
|
||
Put the a file named `<package_name>_test.dart` in the app' `test_driver` directory: | ||
Put the a file named `<package_name>_e2e_test.dart` in the app' `test_driver` directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does flutter test
scans _test.dart
in a directory and execute them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It only looks in the test/ directory by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then when executing flutter test
without an attached device, the _e2e_test.dart
will execute. Is it expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flutter test
only looks for tests in the test/ folder. test_driver/ is ignored.
@@ -106,22 +113,27 @@ dependencies { | |||
To e2e test on a local Android device (emulated or physical): | |||
|
|||
``` | |||
./gradlew connectedAndroidTest -Ptarget=`pwd`/../test_driver/<package_name>_e2e.dart | |||
./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/<package_name>_e2e.dart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suffix should be _e2e.dart
or _e2e_test.dart
as above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suffix here should be _e2e.dart. The _e2e_test.dart suffix is reserved for the driver runner (which I hope will be unnecessary in the future).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## Using Flutter driver to run tests | ||
|
||
`E2EWidgetsTestBinding` supports launching the on-device tests with `flutter drive`. | ||
Note that the tests don't use the `FlutterDriver` API, they use `testWidgets` instead. | ||
|
||
Put the a file named `<package_name>_test.dart` in the app' `test_driver` directory: | ||
Put the a file named `<package_name>_e2e_test.dart` in the app' `test_driver` directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then when executing flutter test
without an attached device, the _e2e_test.dart
will execute. Is it expected?
Merging this since you LGTM'd it but if you'd like to make more edits let me know. |
* Update README
* Update README
Updates README with some documentation updates.