1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-22 04:17:50 +00:00

Add an e2e (host-independent) test demo to testing_app (#515)

This commit is contained in:
Ming Lyu (CareF)
2020-08-13 18:00:22 -04:00
committed by GitHub
parent 437d1f620b
commit 824aeb5a16
11 changed files with 371 additions and 15 deletions

View File

@@ -43,6 +43,7 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -60,4 +61,10 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
// https://developer.android.com/jetpack/androidx/releases/test/#1.2.0
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

View File

@@ -0,0 +1,12 @@
package dev.flutter.testing_app;
import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.e2e.FlutterTestRunner;
import org.junit.Rule;
import org.junit.runner.RunWith;
@RunWith(FlutterTestRunner.class)
public class MainActivityTest {
@Rule
public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class, true, false);
}