Migrate gallery/transitions_perf test to e2e (#62064)

This commit is contained in:
Ming Lyu (CareF)
2020-08-12 16:36:07 -04:00
committed by GitHub
parent cea055ef00
commit 2384376f64
13 changed files with 339 additions and 250 deletions

View File

@@ -1,38 +0,0 @@
// 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 io.flutter.demo.gallery;
import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class FlutterGalleryInstrumentationTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule =
new ActivityTestRule<>(MainActivity.class);
private MainActivity activity;
@Before
public void setUp() {
activity = mActivityRule.getActivity();
}
@Test
public void activityLoaded() throws Exception {
FlutterGalleryInstrumentation instrumentation = activity.getInstrumentation();
instrumentation.waitForTestToFinish();
assertThat(instrumentation.isTestSuccessful(), is(true));
}
}

View File

@@ -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 io.flutter.demo.gallery;
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);
}