Skip to content

Commit

Permalink
Add note about requiring an <instrumentation> tag in a test app's And…
Browse files Browse the repository at this point in the history
…roidManifest.xml

RELNOTES: None.
PiperOrigin-RevId: 208725953
  • Loading branch information
jin authored and Copybara-Service committed Aug 14, 2018
1 parent 2c13e3f commit 2734ceb
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions site/docs/android-instrumentation-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,36 @@ The main attributes of the rule `android_instrumentation_test` are:
run the tests. See the [section on choosing an Android
device](#choosing-an-android_device) for more information.

The test app's `AndroidManifest.xml` must include
[an `<instrumentation>` tag](https://developer.android.com/studio/test/#configure_instrumentation_manifest_settings).
This tag must specify the attributes for the **package of the target app** and
the **fully qualified class name of the instrumentation test runner**,
`android.support.test.runner.AndroidJUnitRunner`.

Here is an example `AndroidTestManifest.xml` for the test app:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.android.app.test"
android:versionCode="1"
android:versionName="1.0">

<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
android:targetPackage="com.example.android.app" />

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="27" />

<application >
<!-- ... -->
</application>
</manifest>
```

## `WORKSPACE` dependencies

In order to use this rule, your project needs to depend on these external
Expand Down

0 comments on commit 2734ceb

Please sign in to comment.