File tree Expand file tree Collapse file tree 4 files changed +52
-1
lines changed
src/androidTest/java/com/instabugsample Expand file tree Collapse file tree 4 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ android {
119
119
targetSdkVersion rootProject. ext. targetSdkVersion
120
120
versionCode 1
121
121
versionName " 1.0"
122
+ testBuildType System . getProperty(' testBuildType' , ' debug' ) // This will later be used to control the test apk build type
123
+ testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
122
124
}
123
125
splits {
124
126
abi {
@@ -173,6 +175,11 @@ dependencies {
173
175
} else {
174
176
implementation ' org.webkit:android-jsc:+'
175
177
}
178
+
179
+ // androidTestImplementation(project(path: ":detox"))
180
+ implementation " androidx.annotation:annotation:1.1.0"
181
+ androidTestImplementation(' com.wix:detox:+' ) { transitive = true }
182
+ androidTestImplementation ' junit:junit:4.12'
176
183
}
177
184
178
185
// Run this once to be able to run the application with BUCK
Original file line number Diff line number Diff line change
1
+ package com .instabugsample ;
2
+
3
+ import com .wix .detox .Detox ;
4
+
5
+ import org .junit .Rule ;
6
+ import org .junit .Test ;
7
+ import org .junit .runner .RunWith ;
8
+
9
+ import androidx .test .ext .junit .runners .AndroidJUnit4 ;
10
+ import androidx .test .filters .LargeTest ;
11
+ import androidx .test .rule .ActivityTestRule ;
12
+
13
+ @ RunWith (AndroidJUnit4 .class )
14
+ @ LargeTest
15
+ public class DetoxTest {
16
+
17
+ @ Rule
18
+ public ActivityTestRule <MainActivity > mActivityRule = new ActivityTestRule <>(MainActivity .class , false , false );
19
+
20
+ @ Test
21
+ public void runDetoxTests () {
22
+ Detox .runTests (mActivityRule );
23
+ }
24
+ }
Original file line number Diff line number Diff line change 3
3
buildscript {
4
4
ext {
5
5
buildToolsVersion = " 28.0.3"
6
- minSdkVersion = 16
6
+ minSdkVersion = 18
7
7
compileSdkVersion = 28
8
8
targetSdkVersion = 28
9
9
supportLibVersion = " 28.0.0"
10
+ kotlinVersion = ' 1.3.10'
10
11
}
11
12
repositories {
12
13
google()
13
14
jcenter()
14
15
}
15
16
dependencies {
16
17
classpath(" com.android.tools.build:gradle:3.4.1" )
18
+ classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
17
19
18
20
// NOTE: Do not place your application dependencies here; they belong
19
21
// in the individual module build.gradle files
@@ -31,6 +33,10 @@ allprojects {
31
33
// Android JSC is installed from npm
32
34
url(" $rootDir /../node_modules/jsc-android/dist" )
33
35
}
36
+ maven {
37
+ // All of Detox' artifacts are provided via the npm module
38
+ url " $rootDir /../node_modules/detox/Detox-android"
39
+ }
34
40
35
41
google()
36
42
jcenter()
Original file line number Diff line number Diff line change 44
44
"build" : " xcodebuild -workspace ios/InstabugSample.xcworkspace -scheme InstabugSample -configuration Release -sdk iphonesimulator -derivedDataPath ios/build" ,
45
45
"type" : " ios.simulator" ,
46
46
"name" : " iPhone X"
47
+ },
48
+ "android.emu.debug" : {
49
+ "binaryPath" : " android/app/build/outputs/apk/debug/app-debug.apk" ,
50
+ "build" :
51
+ " cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .." ,
52
+ "type" : " android.emulator" ,
53
+ "name" : " Pixel_3_API_28"
54
+ },
55
+ "android.emu.release" : {
56
+ "binaryPath" : " android/app/build/outputs/apk/release/app-release.apk" ,
57
+ "build" :
58
+ " cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd .." ,
59
+ "type" : " android.emulator" ,
60
+ "name" : " Pixel_3_API_28"
47
61
}
48
62
}
49
63
}
You can’t perform that action at this time.
0 commit comments