File tree Expand file tree Collapse file tree
packages/instrumentation_adapter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 0.0.2
2+
3+ * Document current usage instructions, which require adding a Java test file.
4+
15## 0.0.1
26
37* Initial release
Original file line number Diff line number Diff line change @@ -22,6 +22,30 @@ void main() {
2222}
2323```
2424
25+ Create an instrumentation test file in your application's
26+ android/app/src/androidTest/java/com/example/myapp/ directory
27+ (replacing com, example, and myapp with values from your app's
28+ package name). You can name this test file MainActivityTest.java
29+ or another name of your choice.
30+
31+ ```
32+ package com.example.myapp;
33+
34+ import androidx.test.rule.ActivityTestRule;
35+ import dev.flutter.plugins.instrumentationadapter.FlutterRunner;
36+ import dev.flutter.plugins.instrumentationadapter.FlutterTest;
37+ import java.lang.Override;
38+ import org.junit.runner.RunWith;
39+
40+ @RunWith(FlutterRunner.class)
41+ public class MainActivityTest extends FlutterTest {
42+ @Override
43+ public void launchActivity() {
44+ ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);
45+ rule.launchActivity(null);
46+ }
47+ }```
48+
2549Use gradle commands to build an instrumentation test for Android.
2650
2751```
Original file line number Diff line number Diff line change 11name : instrumentation_adapter
22description : Runs tests that use the flutter_test API as platform native instrumentation tests.
3- version : 0.0.1
3+ version : 0.0.2
44author : Flutter Team <flutter-dev@googlegroups.com>
55homepage : https://github.com/flutter/plugins/tree/master/packages/instrumentation_adapter
66
@@ -16,4 +16,4 @@ dependencies:
1616flutter :
1717 plugin :
1818 androidPackage : dev.flutter.plugins.instrumentationadapter
19- pluginClass : InstrumentationAdapterPlugin
19+ pluginClass : InstrumentationAdapterPlugin
You can’t perform that action at this time.
0 commit comments