diff --git a/tests/android/app/build.gradle b/tests/android/app/build.gradle index 2a880c3a..d663cc3d 100644 --- a/tests/android/app/build.gradle +++ b/tests/android/app/build.gradle @@ -1,15 +1,8 @@ -// Add the Firebase Crashlytics plugin. - apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' apply plugin: 'com.google.firebase.crashlytics' - - - - apply plugin: "com.google.firebase.firebase-perf" - import com.android.build.OutputFile project.ext.react = [ @@ -140,7 +133,7 @@ dependencies { /* ------------------------ * TESTING SDKS/LIBRARIES * ------------------------ */ - androidTestImplementation('com.wix:detox:+') + androidTestImplementation(project(path: ":detox")) } // Run this once to be able to run the application with BUCK diff --git a/tests/android/build.gradle b/tests/android/build.gradle index 709975be..3c693640 100644 --- a/tests/android/build.gradle +++ b/tests/android/build.gradle @@ -29,10 +29,10 @@ allprojects { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } - maven { - // Detox - url "$rootDir/../node_modules/detox/Detox-android" - } + // maven { + // // Detox as an .aar file (we're going to use it as a compile dependency though, to patch it) + // url "$rootDir/../node_modules/detox/Detox-android" + // } jcenter() } diff --git a/tests/android/settings.gradle b/tests/android/settings.gradle index 2165ed80..ae0c0346 100644 --- a/tests/android/settings.gradle +++ b/tests/android/settings.gradle @@ -1,4 +1,5 @@ rootProject.name = '@react-native-firebase_tests' - +include ':detox' +project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' diff --git a/tests/patches/detox+16.7.2.patch b/tests/patches/detox+16.7.2.patch new file mode 100644 index 00000000..b4b61763 --- /dev/null +++ b/tests/patches/detox+16.7.2.patch @@ -0,0 +1,29 @@ +diff --git a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java +index 181233a..f834f6b 100644 +--- a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java ++++ b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java +@@ -100,18 +100,21 @@ public class UIModuleIdlingResource implements IdlingResource, Choreographer.Fra + } + + boolean isOperationQueueEmpty = (Boolean) Reflect.on(uiOperationQueue).call(METHOD_IS_EMPTY).get(); ++ Log.d(LOG_TAG, "UIManagerModule queue status: runnables? / nonBatchesOps? / operationQueue? - " + runnablesAreEmpty + " / " + nonBatchesOpsEmpty + " / " + isOperationQueueEmpty); + + if (runnablesAreEmpty && nonBatchesOpsEmpty && isOperationQueueEmpty) { + if (callback != null) { + callback.onTransitionToIdle(); + } +- // Log.i(LOG_TAG, "UIManagerModule is idle."); ++ Log.d(LOG_TAG, "UIManagerModule is idle."); + return true; + } + + Log.i(LOG_TAG, "UIManagerModule is busy."); +- Choreographer.getInstance().postFrameCallback(this); +- return false; ++ Log.w(LOG_TAG, "UIManagerModule is busy but damn the torpedoes!"); ++ return true; ++ // Choreographer.getInstance().postFrameCallback(this); ++ // return false; + } catch (ReflectException e) { + Log.e(LOG_TAG, "Can't set up RN UIModule listener", e.getCause()); + }