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

Commit 95594f5

Browse files
Michael Klimushyncollinjackson
authored andcommitted
Fix testing instructions in CONTRIBUTING.md (#2222)
* Fix testing instructions in CONTRIBUTING.md
1 parent dc48e70 commit 95594f5

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,46 @@ USB and debugging enabled on that device.
4242

4343
## Running the tests
4444

45-
Flutter plugins have both unit tests of their Dart API and integration tests that run on a virtual or actual device.
45+
### Integration tests
4646

47-
To run the unit tests:
47+
To run the integration tests using Flutter driver:
4848

49-
```
50-
flutter test test/<name_of_plugin>_test.dart
49+
```console
50+
cd example
51+
flutter drive test_driver/<name_of_plugin_test>.dart
5152
```
5253

53-
To run the integration tests using Flutter driver:
54+
To run integration tests as instrumentation tests on a local Android device:
5455

55-
```
56+
```console
5657
cd example
57-
flutter drive test/<name_of_plugin>.dart
58+
flutter build apk
59+
cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/<name_of_plugin>_test.dart app:connectedAndroidTest
5860
```
5961

60-
To run integration tests as instrumentation tests on a local Android device:
62+
These tests may also be in folders just named "test," or have filenames ending
63+
with "e2e".
6164

65+
### Dart unit tests
66+
67+
To run the unit tests:
68+
69+
```console
70+
flutter test test/<name_of_plugin>_test.dart
6271
```
72+
73+
### Java unit tests
74+
75+
These can be ran through Android Studio once the example app is opened as an
76+
Android project.
77+
78+
Without Android Studio, they can be ran through the terminal.
79+
80+
```console
6381
cd example
64-
(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/<name_of_plugin>_test.dart connectedAndroidTest)
82+
flutter build apk
83+
cd android
84+
./gradlew test
6585
```
6686

6787
## Contributing code

0 commit comments

Comments
 (0)