From 375d47054a45acb32da0c7655178d62ba6604a81 Mon Sep 17 00:00:00 2001 From: Georgy Date: Tue, 19 Dec 2023 12:34:39 +0200 Subject: [PATCH] fix(android): swipe is not working correctly on API 33-34 (#4299) * Upgraded espresso version to 3.5.1 in order to fix the issue with swipe on android 33/34 --- detox/android/detox/build.gradle | 8 ++++---- detox/android/detox/proguard-rules-app.pro | 3 +++ .../com/wix/detox/espresso/assertion/ViewAssertions.java | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/detox/android/detox/build.gradle b/detox/android/detox/build.gradle index 7ebad1f876..e2496e292c 100644 --- a/detox/android/detox/build.gradle +++ b/detox/android/detox/build.gradle @@ -101,13 +101,13 @@ dependencies { // Versions are in-sync with the 'androidx-test-1.4.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.4.0 // Important: Should remain so when generator tag is replaced! - api('androidx.test.espresso:espresso-core:3.4.0') { + api('androidx.test.espresso:espresso-core:3.5.1') { because 'Needed all across Detox but also makes Espresso seamlessly provided to Detox users with hybrid apps/E2E-tests.' } - api('androidx.test.espresso:espresso-web:3.4.0') { + api('androidx.test.espresso:espresso-web:3.5.1') { because 'Web-View testing' } - api('androidx.test.espresso:espresso-contrib:3.4.0') { + api('androidx.test.espresso:espresso-contrib:3.5.1') { because 'Android datepicker support' exclude group: "org.checkerframework", module: "checker" } @@ -150,7 +150,7 @@ dependencies { testImplementation "org.jetbrains.kotlin:kotlin-test:$_kotlinVersion" testImplementation 'org.apache.commons:commons-io:1.3.2' testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0' - testImplementation 'org.robolectric:robolectric:4.4' + testImplementation 'org.robolectric:robolectric:4.11.1' testImplementation("com.google.android.material:material:$_materialMinVersion") { because 'Material components are mentioned explicitly (e.g. Slider in get-attributes handler)' diff --git a/detox/android/detox/proguard-rules-app.pro b/detox/android/detox/proguard-rules-app.pro index f230633216..1932cf4105 100644 --- a/detox/android/detox/proguard-rules-app.pro +++ b/detox/android/detox/proguard-rules-app.pro @@ -19,3 +19,6 @@ -keep class kotlin.text.** { *; } -keep class kotlin.io.** { *; } -keep class okhttp3.** { *; } + +-keep class androidx.concurrent.futures.CallbackToFutureAdapter$* { *; } +-keep class androidx.concurrent.futures.CallbackToFutureAdapter { *; } diff --git a/detox/android/detox/src/full/java/com/wix/detox/espresso/assertion/ViewAssertions.java b/detox/android/detox/src/full/java/com/wix/detox/espresso/assertion/ViewAssertions.java index 7784de010f..7559232a12 100644 --- a/detox/android/detox/src/full/java/com/wix/detox/espresso/assertion/ViewAssertions.java +++ b/detox/android/detox/src/full/java/com/wix/detox/espresso/assertion/ViewAssertions.java @@ -24,8 +24,9 @@ public class ViewAssertions { * which is more suitable for Detox' separated interaction-matcher architecture. * See {@link MatchesViewAssertion} for more details. */ + @SuppressWarnings("unchecked") public static ViewAssertion matches(final Matcher viewMatcher) { - return new MatchesViewAssertion(checkNotNull(viewMatcher)); + return new MatchesViewAssertion((Matcher) checkNotNull(viewMatcher)); } /**