Skip to content

Commit b2a8c15

Browse files
committed
test(e2e, android): forward-port test app to targetSdkVersion 31
Required a patch to Detox, tracked here: wix/Detox#3055
1 parent 4871131 commit b2a8c15

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

tests/android/app/src/debug/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
android:usesCleartextTraffic="true"
99
tools:targetApi="28"
1010
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
11+
<activity
12+
android:name="com.facebook.react.devsupport.DevSettingsActivity"
13+
android:exported="true"
14+
/>
1215
</application>
1316
</manifest>

tests/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
android:name=".MainActivity"
2222
android:label="@string/app_name"
2323
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
24+
android:exported="true"
2425
android:launchMode="singleTask"
2526
android:windowSoftInputMode="adjustResize">
2627
<intent-filter>

tests/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
buildscript {
22
ext.buildToolsVersion = '31.0.0'
33
ext.minSdkVersion = 21
4-
ext.compileSdkVersion = 30
5-
ext.targetSdkVersion = 30
4+
ext.compileSdkVersion = 31
5+
ext.targetSdkVersion = 31
66
ext.ndkVersion = '21.4.7075529'
77

88
ext.kotlinVersion = '1.5.31' // https://kotlinlang.org/releases.html

tests/patches/detox+18.23.1.patch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
diff --git a/node_modules/detox/android/detox/build.gradle b/node_modules/detox/android/detox/build.gradle
2+
index 8bef864..3689459 100644
3+
--- a/node_modules/detox/android/detox/build.gradle
4+
+++ b/node_modules/detox/android/detox/build.gradle
5+
@@ -86,12 +86,12 @@ dependencies {
6+
// Versions are in-sync with the 'androidx-test-1.2.0' release/tag of the android-test github repo,
7+
// used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.2.0
8+
// Important: Should remain so when generator tag is replaced!
9+
- api('androidx.test.espresso:espresso-core:3.3.0') { // Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests.
10+
+ api('androidx.test.espresso:espresso-core:3.4.0') { // Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests.
11+
exclude group: 'com.google.code.findbugs', module: 'jsr305'
12+
}
13+
- api 'androidx.test.espresso:espresso-web:3.3.0' // Web-View testing
14+
- api 'androidx.test:rules:1.2.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox.
15+
- api 'androidx.test.ext:junit:1.1.1' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.
16+
+ api 'androidx.test.espresso:espresso-web:3.4.0' // Web-View testing
17+
+ api 'androidx.test:rules:1.4.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox.
18+
+ api 'androidx.test.ext:junit:1.1.3' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.
19+
20+
// Version is the latest; Cannot sync with the Github repo (e.g. android/android-test) because the androidx
21+
// packaging version of associated classes is simply not there...
122
diff --git a/node_modules/detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java b/node_modules/detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
223
index 2407926..65d17d8 100644
324
--- a/node_modules/detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java

0 commit comments

Comments
 (0)