Skip to content

Commit

Permalink
test(e2e, android): forward-port test app to targetSdkVersion 31
Browse files Browse the repository at this point in the history
Required a patch to Detox, tracked here:
wix/Detox#3055
  • Loading branch information
mikehardy committed Nov 5, 2021
1 parent 4871131 commit b2a8c15
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity
android:name="com.facebook.react.devsupport.DevSettingsActivity"
android:exported="true"
/>
</application>
</manifest>
1 change: 1 addition & 0 deletions tests/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize">
<intent-filter>
Expand Down
4 changes: 2 additions & 2 deletions tests/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext.buildToolsVersion = '31.0.0'
ext.minSdkVersion = 21
ext.compileSdkVersion = 30
ext.targetSdkVersion = 30
ext.compileSdkVersion = 31
ext.targetSdkVersion = 31
ext.ndkVersion = '21.4.7075529'

ext.kotlinVersion = '1.5.31' // https://kotlinlang.org/releases.html
Expand Down
21 changes: 21 additions & 0 deletions tests/patches/detox+18.23.1.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
diff --git a/node_modules/detox/android/detox/build.gradle b/node_modules/detox/android/detox/build.gradle
index 8bef864..3689459 100644
--- a/node_modules/detox/android/detox/build.gradle
+++ b/node_modules/detox/android/detox/build.gradle
@@ -86,12 +86,12 @@ dependencies {
// Versions are in-sync with the 'androidx-test-1.2.0' release/tag of the android-test github repo,
// used by the Detox generator. See https://github.com/android/android-test/releases/tag/androidx-test-1.2.0
// Important: Should remain so when generator tag is replaced!
- 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.
+ 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.
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
- api 'androidx.test.espresso:espresso-web:3.3.0' // Web-View testing
- api 'androidx.test:rules:1.2.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox.
- api 'androidx.test.ext:junit:1.1.1' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.
+ api 'androidx.test.espresso:espresso-web:3.4.0' // Web-View testing
+ api 'androidx.test:rules:1.4.0' // Needed because of ActivityTestRule. Needed by users *and* internally used by Detox.
+ api 'androidx.test.ext:junit:1.1.3' // Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.

// Version is the latest; Cannot sync with the Github repo (e.g. android/android-test) because the androidx
// packaging version of associated classes is simply not there...
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
index 2407926..65d17d8 100644
--- a/node_modules/detox/android/detox/src/full/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
Expand Down

1 comment on commit b2a8c15

@vercel
Copy link

@vercel vercel bot commented on b2a8c15 Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.