Skip to content

Commit 79f6565

Browse files
committed
Fix Android E2E tests
1 parent ecf1cd0 commit 79f6565

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

android/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.reactcommunity.rndatetimepicker">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
22
<application />
33
</manifest>

example/android/build.gradle

+33
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,40 @@ allprojects {
3737
throw new GradleException("Could not find `react-native`");
3838
}())
3939
}
40+
maven {
41+
// All of Detox' artifacts are provided via the npm module
42+
url "$rootDir/../../node_modules/detox/Detox-android"
43+
}
4044
mavenCentral()
4145
google()
4246
}
47+
afterEvaluate { project ->
48+
def androidExtension = project.extensions.findByName('android')
49+
if (androidExtension != null && project.name == 'app') {
50+
androidExtension.defaultConfig {
51+
ndk {
52+
abiFilters 'arm64-v8a', 'x86', 'x86_64'
53+
}
54+
}
55+
56+
androidExtension.signingConfigs {
57+
test {
58+
keyAlias "androiddebugkey"
59+
keyPassword "android"
60+
storeFile file("debug.keystore")
61+
storePassword "android"
62+
}
63+
}
64+
65+
androidExtension.buildTypes.debug.signingConfig = androidExtension.signingConfigs.test
66+
androidExtension.buildTypes.release.signingConfig = androidExtension.signingConfigs.test
67+
androidExtension.testBuildType = System.getProperty('testBuildType', 'debug')
68+
69+
androidExtension.sourceSets.androidTest.java.srcDirs += "$rootDir/app/src/androidTest/java"
70+
71+
project.dependencies {
72+
androidTestImplementation('com.wix:detox:+')
73+
}
74+
}
75+
}
4376
}

example/android/debug.keystore

2.2 KB
Binary file not shown.

example/app.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/microsoft/react-native-test-app/trunk/schema.json",
23
"name": "date-time-picker-example",
34
"displayName": "date-time-picker-example",
5+
"singleApp": "date-time-picker-example",
6+
"android": {
7+
"package": "com.datetimepickerexample"
8+
},
9+
"ios": {
10+
"bundleIdentifier": "com.datetimepickerexample",
11+
"developmentTeam": ""
12+
},
413
"components": [
514
{
615
"appKey": "date-time-picker-example",
7-
"displayName": "date-time-picker-example"
16+
"displayName": "date-time-picker-example",
17+
"slug": "date-time-picker-example"
818
}
919
],
1020
"resources": {

0 commit comments

Comments
 (0)