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

Commit

Permalink
[instrumentation_adapter] Update README instructions (#2022)
Browse files Browse the repository at this point in the history
(documentation-only change)
  • Loading branch information
collinjackson committed Aug 27, 2019
1 parent f02aab8 commit 9a1a56f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/instrumentation_adapter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.2

* Document current usage instructions, which require adding a Java test file.

## 0.0.1

* Initial release
24 changes: 24 additions & 0 deletions packages/instrumentation_adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,30 @@ void main() {
}
```

Create an instrumentation test file in your application's
android/app/src/androidTest/java/com/example/myapp/ directory
(replacing com, example, and myapp with values from your app's
package name). You can name this test file MainActivityTest.java
or another name of your choice.

```
package com.example.myapp;
import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.instrumentationadapter.FlutterRunner;
import dev.flutter.plugins.instrumentationadapter.FlutterTest;
import java.lang.Override;
import org.junit.runner.RunWith;
@RunWith(FlutterRunner.class)
public class MainActivityTest extends FlutterTest {
@Override
public void launchActivity() {
ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);
rule.launchActivity(null);
}
}```

Use gradle commands to build an instrumentation test for Android.

```
Expand Down
4 changes: 2 additions & 2 deletions packages/instrumentation_adapter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: instrumentation_adapter
description: Runs tests that use the flutter_test API as platform native instrumentation tests.
version: 0.0.1
version: 0.0.2
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/instrumentation_adapter

Expand All @@ -16,4 +16,4 @@ dependencies:
flutter:
plugin:
androidPackage: dev.flutter.plugins.instrumentationadapter
pluginClass: InstrumentationAdapterPlugin
pluginClass: InstrumentationAdapterPlugin

0 comments on commit 9a1a56f

Please sign in to comment.