Skip to content

Commit f6ffe00

Browse files
committed
Introduce TestButler
1 parent ac14015 commit f6ffe00

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
targetSdkVersion 25
1313
versionCode 1
1414
versionName "1.0.0"
15-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15+
testInstrumentationRunner "com.hana053.micropost.testing.AppTestRunner"
1616
multiDexEnabled = true
1717
buildConfigField('String', 'API_URL', getProperty("micropost.apiUrl"))
1818
}
@@ -95,6 +95,7 @@ dependencies {
9595
androidTestCompile "com.nhaarman:mockito-kotlin:$mockito_kotlin_version"
9696
androidTestCompile "com.linkedin.dexmaker:dexmaker-mockito:$dexmaker_mockito_version"
9797
androidTestCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
98+
androidTestCompile "com.linkedin.testbutler:test-butler-library:1.2.0"
9899
}
99100
repositories {
100101
mavenCentral()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.hana053.micropost.testing
2+
3+
import android.os.Bundle
4+
import android.support.test.InstrumentationRegistry
5+
import android.support.test.runner.AndroidJUnitRunner
6+
import com.linkedin.android.testbutler.TestButler
7+
8+
9+
class AppTestRunner : AndroidJUnitRunner() {
10+
11+
override fun onStart() {
12+
TestButler.setup(InstrumentationRegistry.getTargetContext())
13+
super.onStart()
14+
}
15+
16+
override fun finish(resultCode: Int, results: Bundle) {
17+
TestButler.teardown(InstrumentationRegistry.getTargetContext())
18+
super.finish(resultCode, results)
19+
}
20+
21+
}

0 commit comments

Comments
 (0)