diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e6e3e957af29..493bf7f55c25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,26 +42,46 @@ USB and debugging enabled on that device. ## Running the tests -Flutter plugins have both unit tests of their Dart API and integration tests that run on a virtual or actual device. +### Integration tests -To run the unit tests: +To run the integration tests using Flutter driver: -``` -flutter test test/_test.dart +```console +cd example +flutter drive test_driver/.dart ``` -To run the integration tests using Flutter driver: +To run integration tests as instrumentation tests on a local Android device: -``` +```console cd example -flutter drive test/.dart +flutter build apk +cd android && ./gradlew -Ptarget=$(pwd)/../test_driver/_test.dart app:connectedAndroidTest ``` -To run integration tests as instrumentation tests on a local Android device: +These tests may also be in folders just named "test," or have filenames ending +with "e2e". +### Dart unit tests + +To run the unit tests: + +```console +flutter test test/_test.dart ``` + +### Java unit tests + +These can be ran through Android Studio once the example app is opened as an +Android project. + +Without Android Studio, they can be ran through the terminal. + +```console cd example -(cd android && ./gradlew -Ptarget=$(pwd)/../test_live/_test.dart connectedAndroidTest) +flutter build apk +cd android +./gradlew test ``` ## Contributing code