From 0cc3df37475d822d7dbdc094caa49ac7d7f598d9 Mon Sep 17 00:00:00 2001 From: filmaj Date: Thu, 25 May 2017 20:54:25 +0200 Subject: [PATCH] CB-12859: document how to run the native tests. add a README to the test/ project. --- README.md | 6 ++++++ test/README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 test/README.md diff --git a/README.md b/README.md index fec5f7d2..f01282fd 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,9 @@ These commands live in a generated Cordova Android project. Any interactions wit 1. Create a project 2. Import it via "Non-Android Studio Project" + +## Running the Native Tests + +The `test/` directory in this project contains an Android test project that can +be used to run different kinds of native tests. Check out the +[README contained therein](test/README.md) for more details! diff --git a/test/README.md b/test/README.md new file mode 100644 index 00000000..4cf0253f --- /dev/null +++ b/test/README.md @@ -0,0 +1,58 @@ + + +# Cordova Android Test Project + +The project in this directory is an Android Test project that enables those +interested in further developing cordova-android to validate their changes. + +## Requirements + +The requirements in the [top-level README](../README.md) still apply. In +addition, ensure you have installed Gradle, and that it is (at the time of this +writing) at least version 3.3 or newer. + +## Getting Started + +You can run this test project from both the command line as well as from +Android Studio. + +### Command Line + +Ensure you have the gradle wrapper script, `gradlew`, in this directory. If +you do not, you can run the following to generate it: + + $ cd cordova-android/test + $ gradle :wrapper -b build.gradle + +You can then see a list of all tasks available to run with `gradlew tasks`. + +The two different kinds of tests one typically wants to run are unit tests and +end-to-end, or instrumented, tests. Unit tests do not require any particular +environment to run in, but the instrumented tests, however, require a connected +Android device or emulator to run in. + +To run the unit tests, run: `gradlew test`. +To run the instrumented tests, run: `gradlew connectedAndroidTest`. + +### Android Studio + +Import this `test/` directory into Android Studio, and hit the Play button.