File tree 2 files changed +23
-1
lines changed
src/androidTest/kotlin/com/hana053/micropost/testing
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ android {
12
12
targetSdkVersion 25
13
13
versionCode 1
14
14
versionName " 1.0.0"
15
- testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner "
15
+ testInstrumentationRunner " com.hana053.micropost.testing.AppTestRunner "
16
16
multiDexEnabled = true
17
17
buildConfigField(' String' , ' API_URL' , getProperty(" micropost.apiUrl" ))
18
18
}
@@ -95,6 +95,7 @@ dependencies {
95
95
androidTestCompile " com.nhaarman:mockito-kotlin:$mockito_kotlin_version "
96
96
androidTestCompile " com.linkedin.dexmaker:dexmaker-mockito:$dexmaker_mockito_version "
97
97
androidTestCompile " com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version "
98
+ androidTestCompile " com.linkedin.testbutler:test-butler-library:1.2.0"
98
99
}
99
100
repositories {
100
101
mavenCentral()
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments