Migrate gallery/transitions_perf test to e2e (#62064)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user