[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[e2e] update README #2233

Merged
merged 2 commits into from
Oct 28, 2019
Merged

[e2e] update README #2233

merged 2 commits into from
Oct 28, 2019

Conversation

collinjackson
Copy link
Contributor
@collinjackson collinjackson commented Oct 25, 2019

Updates README with some documentation updates.

@collinjackson collinjackson changed the title ## Description [e2e] update README Oct 25, 2019
## 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:
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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).

Copy link
Contributor
@digiter digiter left a 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:
Copy link
Contributor

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?

@collinjackson
Copy link
Contributor Author

Merging this since you LGTM'd it but if you'd like to make more edits let me know.

@collinjackson collinjackson merged commit fe49a79 into flutter:master Oct 28, 2019
mormih pushed a commit to mormih/plugins that referenced this pull request Nov 17, 2019
sungmin-park pushed a commit to sungmin-park/flutter-plugins that referenced this pull request Dec 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants