@@ -17,6 +17,7 @@ android {
1717 targetSdkVersion 33
1818
1919 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
20+ testInstrumentationRunnerArguments useTestStorageService : ' true'
2021 }
2122
2223 buildFeatures {
@@ -38,7 +39,6 @@ android {
3839
3940 namespace ' info.hannes.logcat.sample'
4041 testNamespace ' info.hannes.logcat.sampletest'
41-
4242}
4343
4444dependencies {
@@ -51,49 +51,10 @@ dependencies {
5151 implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
5252 implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4"
5353
54- androidTestImplementation ' com.github.AppDevNext:Moka:1.4'
55- androidTestImplementation " androidx.test.espresso:espresso-core:$espresso_core "
56- androidTestImplementation ' androidx.test:rules:1.4.0'
57- androidTestImplementation " androidx.test:runner:$runnerVersion "
58- androidTestImplementation " androidx.test:core:$coreVersion "
59-
60- androidTestImplementation " androidx.test.ext:junit:$extJUnitVersion "
61- androidTestImplementation " androidx.test.ext:truth:1.4.0"
62- }
63-
64- def adbDirectory = ' /storage/emulated/0/Download'
65- def reportsDirectory = " $projectDir /../screenshots/adb"
66-
67- def clearScreenshotsTask = task(' clearScreenshots' , type : Exec ) {
68- executable " ${ android.getAdbExe().toString()} "
69- args ' shell' , ' rm' , ' -r' , adbDirectory
70- }
71-
72- def createScreenshotDirectoryTask = task(' createScreenshotDirectory' , type : Exec , group : ' reporting' ) {
73- executable " ${ android.getAdbExe().toString()} "
74- args ' shell' , ' mkdir' , ' -p' , adbDirectory
75- }
76-
77- def fetchScreenshotsTask = task(' fetchScreenshots' , type : Exec , group : ' reporting' ) {
78- executable " ${ android.getAdbExe().toString()} "
79- args ' pull' , adbDirectory + ' /.' , reportsDirectory
80-
81- dependsOn {
82- createScreenshotDirectoryTask
83- }
84-
85- doFirst {
86- new File (reportsDirectory). mkdirs()
87- }
88- }
89-
90- tasks. whenTaskAdded { task ->
91- if (task. name == ' connectedDebugAndroidTest' || task. name == ' cAT' ) {
92- task. mustRunAfter {
93- clearScreenshotsTask
94- }
95- task. finalizedBy {
96- fetchScreenshotsTask
97- }
98- }
54+ testImplementation ' junit:junit:4.13.2'
55+ androidTestImplementation ' com.github.AppDevNext:Moka:1.6'
56+ androidTestImplementation " androidx.test.ext:junit-ktx:1.1.4"
57+ androidTestUtil " androidx.test.services:test-services:1.4.2"
58+ androidTestImplementation " androidx.test.espresso:espresso-core:3.5.0"
59+ androidTestImplementation " androidx.test:rules:1.5.0" // GrantPermissionRule
9960}
0 commit comments