From 65d9faa1b41dc3ba34863ab661915dbc36234dbb Mon Sep 17 00:00:00 2001 From: "Ming Lyu (CareF)" Date: Mon, 10 Aug 2020 14:01:02 -0400 Subject: [PATCH] Prepare macrobenchmarks' e2e tests for firebase test lab (#63197) --- .../macrobenchmarks/android/app/build.gradle | 9 +++++++++ .../macrobenchmarks/MainActivityTest.java | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java diff --git a/dev/benchmarks/macrobenchmarks/android/app/build.gradle b/dev/benchmarks/macrobenchmarks/android/app/build.gradle index caa5acfc5a..f4273a1d91 100644 --- a/dev/benchmarks/macrobenchmarks/android/app/build.gradle +++ b/dev/benchmarks/macrobenchmarks/android/app/build.gradle @@ -41,6 +41,7 @@ android { targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -54,3 +55,11 @@ android { flutter { source '../..' } + +dependencies { + 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' +} diff --git a/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java b/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java new file mode 100644 index 0000000000..568553827f --- /dev/null +++ b/dev/benchmarks/macrobenchmarks/android/app/src/androidTest/java/com/example/macrobenchmarks/MainActivityTest.java @@ -0,0 +1,16 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package com.example.macrobenchmarks; + +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 rule = new ActivityTestRule<>(MainActivity.class, true, false); +}