Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
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