This repository was archived by the owner on Feb 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +29
-9
lines changed Expand file tree Collapse file tree 1 file changed +29
-9
lines changed Original file line number Diff line number Diff line change @@ -42,26 +42,46 @@ USB and debugging enabled on that device.
42
42
43
43
## Running the tests
44
44
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
46
46
47
- To run the unit tests:
47
+ To run the integration tests using Flutter driver :
48
48
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
51
52
```
52
53
53
- To run the integration tests using Flutter driver :
54
+ To run integration tests as instrumentation tests on a local Android device :
54
55
55
- ```
56
+ ``` console
56
57
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
58
60
```
59
61
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".
61
64
65
+ ### Dart unit tests
66
+
67
+ To run the unit tests:
68
+
69
+ ``` console
70
+ flutter test test/<name_of_plugin>_test.dart
62
71
```
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
63
81
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
65
85
```
66
86
67
87
## Contributing code
You can’t perform that action at this time.
0 commit comments