Add basic integration test
Summary: Just a quick startup test that can save you the time of manually opening the app. I don't have any plans of hooking this up in Circle, but it's still kinda useful to have. Reviewed By: jknoxville Differential Revision: D12901590 fbshipit-source-id: a16a1814574d9f27770dcf98c6b238517c589930
This commit is contained in:
committed by
Facebook Github Bot
parent
d54fb3a21a
commit
a7fd546f0e
@@ -5,7 +5,7 @@ android {
|
|||||||
buildToolsVersion rootProject.buildToolsVersion
|
buildToolsVersion rootProject.buildToolsVersion
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion rootProject.minSdkVersion
|
minSdkVersion rootProject.minSdkVersion
|
||||||
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
|
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||||
applicationId 'com.facebook.flipper.sample'
|
applicationId 'com.facebook.flipper.sample'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,5 +34,9 @@ dependencies {
|
|||||||
implementation deps.soloader
|
implementation deps.soloader
|
||||||
implementation deps.okhttp3
|
implementation deps.okhttp3
|
||||||
|
|
||||||
|
// Integration test
|
||||||
|
androidTestImplementation deps.testCore
|
||||||
|
androidTestImplementation deps.testRules
|
||||||
|
|
||||||
implementation project(':android')
|
implementation project(':android')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the LICENSE
|
||||||
|
* file in the root directory of this source tree.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package com.facebook.flipper.sample;
|
||||||
|
|
||||||
|
import androidx.test.filters.LargeTest;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
@LargeTest
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class MainActivityTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public final ActivityTestRule<MainActivity> mTestRule =
|
||||||
|
new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void activityStarts() {
|
||||||
|
final MainActivity activity = mTestRule.getActivity();
|
||||||
|
|
||||||
|
assert activity != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,6 +75,8 @@ ext.deps = [
|
|||||||
stetho : 'com.facebook.stetho:stetho:1.5.0',
|
stetho : 'com.facebook.stetho:stetho:1.5.0',
|
||||||
okhttp3 : 'com.squareup.okhttp3:okhttp:3.10.0',
|
okhttp3 : 'com.squareup.okhttp3:okhttp:3.10.0',
|
||||||
leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.6.1',
|
leakcanary : 'com.squareup.leakcanary:leakcanary-android:1.6.1',
|
||||||
|
testCore : 'androidx.test:core:1.0.0',
|
||||||
|
testRules : 'androidx.test:rules:1.1.0',
|
||||||
// Plugin dependencies
|
// Plugin dependencies
|
||||||
rhino : 'org.mozilla:rhino:1.7.10',
|
rhino : 'org.mozilla:rhino:1.7.10',
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user