Closed compojoom closed 4 years ago
I'm starting to think that the error is actually in the activityIndicator and not in the click. I was missing the following error in logcat:
Caused by: androidx.test.espresso.AppNotIdleException: Looped for 7038 iterations over 60 SECONDS. The following Idle Conditions failed .
at androidx.test.espresso.IdlingPolicy.handleTimeout(IdlingPolicy.java:59)
at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:541)
at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:447)
at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent(UiControllerImpl.java:252)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:162)
at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:139)
at androidx.test.espresso.action.Tap.sendSingleTap(Tap.java:170)
at androidx.test.espresso.action.Tap.access$100(Tap.java:31)
at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:47)
at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:137)
at com.wix.detox.espresso.action.RNClickAction.perform(RNClickAction.java:43)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:366)
at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:255)
at androidx.test.espresso.ViewInteraction.access$100(ViewInteraction.java:65)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:158)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:155)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Maybe this here is the problem: https://github.com/wix/Detox/issues/1513
I mocked the activityIndicator in the test as a static view and it's now working even without disabling sync.
So since disableSynchronization on iOS also disables waiting for the animations it's working properly on ios.
@rotemmiz @LeoNatan shall we close this, or do you think that there is really a bug in the library?
well, sadly the test still fails sometimes. here is a log a failure on circleci
--------- beginning of main
11-29 11:03:13.095 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:13.106 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:13.471 6533 6609 I WebSocketClient: At sendAction
11-29 11:03:13.471 6533 6609 D WebSocketClient: Detox Action Sent: invokeResult
11-29 11:03:13.477 6533 6625 I WebSocketClient: At onMessage
11-29 11:03:13.477 6533 6625 I WebSocketClient: At receiveAction
11-29 11:03:13.478 6533 6625 D WebSocketClient: Detox Action Received: invoke
11-29 11:03:13.479 6533 6625 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertNotVisible","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"androidx.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["confirmBox"]}}]}}]}
11-29 11:03:13.482 6533 6609 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [confirmBox]
11-29 11:03:13.482 6533 6609 D Detox : class androidx.test.espresso.Espresso, onView, [(with tag value: is "confirmBox" and view has effective visibility=VISIBLE)]
11-29 11:03:13.482 6533 6609 D Detox : class com.wix.detox.espresso.DetoxAssertion, assertNotVisible, [androidx.test.espresso.ViewInteraction@f9ef86]
11-29 11:03:13.544 6533 6533 I ViewInteraction: Checking 'androidx.test.espresso.assertion.ViewAssertions$DoesNotExistViewAssertion@1cb7ae9' assertion on view (with tag value: is "confirmBox" and view has effective visibility=VISIBLE)
11-29 11:03:13.544 6533 6609 I WebSocketClient: At sendAction
11-29 11:03:13.544 6533 6609 D WebSocketClient: Detox Action Sent: invokeResult
11-29 11:03:14.372 6533 6625 I WebSocketClient: At onMessage
11-29 11:03:14.373 6533 6625 I WebSocketClient: At receiveAction
11-29 11:03:14.373 6533 6625 D WebSocketClient: Detox Action Received: invoke
11-29 11:03:14.373 6533 6625 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.EspressoDetox"},"method":"perform","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"androidx.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["registration"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxViewActions"},"method":"click","args":[]}}]}
11-29 11:03:14.373 6533 6609 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [registration]
11-29 11:03:14.373 6533 6609 D Detox : class androidx.test.espresso.Espresso, onView, [(with tag value: is "registration" and view has effective visibility=VISIBLE)]
11-29 11:03:14.374 6533 6609 D Detox : class com.wix.detox.espresso.DetoxViewActions, click, []
11-29 11:03:14.374 6533 6609 D Detox : class com.wix.detox.espresso.EspressoDetox, perform, [androidx.test.espresso.ViewInteraction@c4c836e, com.wix.detox.espresso.action.RNClickAction@1b3aa0f]
11-29 11:03:14.388 6533 6533 I ViewInteraction: Performing 'single click' action on view (with tag value: is "registration" and view has effective visibility=VISIBLE)
11-29 11:03:14.496 6533 6533 I Detox : UIManagerModule is busy.
11-29 11:03:14.803 6533 6533 I Detox : UIManagerModule is busy.
11-29 11:03:14.987 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:14.999 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:15.100 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:15.162 6533 6589 I chatty : uid=10133(xyz.mobileapp) RenderThread identical 2 lines
11-29 11:03:15.174 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:15.455 6533 6609 I WebSocketClient: At sendAction
11-29 11:03:15.455 6533 6609 D WebSocketClient: Detox Action Sent: invokeResult
11-29 11:03:15.461 6533 6625 I WebSocketClient: At onMessage
11-29 11:03:15.461 6533 6625 I WebSocketClient: At receiveAction
11-29 11:03:15.463 6533 6625 D WebSocketClient: Detox Action Received: invoke
11-29 11:03:15.463 6533 6625 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.EspressoDetox"},"method":"perform","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"androidx.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["confirm"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxViewActions"},"method":"click","args":[]}}]}
11-29 11:03:15.464 6533 6609 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [confirm]
11-29 11:03:15.464 6533 6609 D Detox : class androidx.test.espresso.Espresso, onView, [(with tag value: is "confirm" and view has effective visibility=VISIBLE)]
11-29 11:03:15.465 6533 6609 D Detox : class com.wix.detox.espresso.DetoxViewActions, click, []
11-29 11:03:15.465 6533 6609 D Detox : class com.wix.detox.espresso.EspressoDetox, perform, [androidx.test.espresso.ViewInteraction@2c44a56, com.wix.detox.espresso.action.RNClickAction@be0ad7]
11-29 11:03:15.469 6533 6533 I ViewInteraction: Performing 'single click' action on view (with tag value: is "confirm" and view has effective visibility=VISIBLE)
11-29 11:03:15.508 6533 6533 I Detox : UIManagerModule is busy.
11-29 11:03:15.527 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:15.695 6533 6644 I CrashlyticsCore: Initializing Crashlytics 2.6.8.32
11-29 11:03:15.782 6533 7347 W lines.mobileap: JNI critical lock held for 22.456ms on Thread[39,tid=7347,Runnable,Thread*=0xe0ad3000,peer=0x1337f770,"Measurement Worker"]
11-29 11:03:15.902 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:15.934 6533 6589 D EGL_emulation: eglMakeCurrent: 0xd891a780: ver 3 0 (tinfo 0xd890f880)
11-29 11:03:16.091 6533 7363 D SoLoader: About to load: libimagepipeline.so
11-29 11:03:16.092 6533 7363 D SoLoader: libimagepipeline.so not found on /data/data/xyz.mobileapp/lib-main
11-29 11:03:16.216 6533 7363 D SoLoader: libimagepipeline.so found on /data/app/xyz.mobileapp-onXLEl2DjhD-jrgI87NXsg==/lib/x86
11-29 11:03:16.216 6533 7363 D SoLoader: Not resolving dependencies for libimagepipeline.so
11-29 11:03:16.236 6533 7363 D SoLoader: Loaded: libimagepipeline.so
11-29 11:03:16.471 6533 7348 W lines.mobileap: Long monitor contention with owner Answers Events Handler1 (7354) at boolean android.os.BinderProxy.transactNative(int, android.os.Parcel, android.os.Parcel, int)(BinderProxy.java:-2) waiters=0 in io.fabric.sdk.android.services.common.AdvertisingInfo io.fabric.sdk.android.services.common.IdManager.getAdvertisingInfo() for 618ms
11-29 11:03:16.481 6533 7358 W lines.mobileap: Long monitor contention with owner Answers Events Handler1 (7354) at boolean android.os.BinderProxy.transactNative(int, android.os.Parcel, android.os.Parcel, int)(BinderProxy.java:-2) waiters=1 in io.fabric.sdk.android.services.common.AdvertisingInfo io.fabric.sdk.android.services.common.IdManager.getAdvertisingInfo() for 619ms
11-29 11:03:16.940 6533 6545 I lines.mobileap: Background young concurrent copying GC freed 69380(3648KB) AllocSpace objects, 16(672KB) LOS objects, 46% free, 4895KB/9092KB, paused 1.625ms total 370.234ms
11-29 11:03:17.198 6533 7348 D skia : --- Failed to create image decoder with message 'unimplemented'
11-29 11:03:19.137 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 100 iterations.
11-29 11:03:21.522 6533 6533 W IdlingPolicy: These resources are not idle: [LooperIdlingResource-536-mqt_js]
11-29 11:03:22.039 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 200 iterations.
11-29 11:03:24.873 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 300 iterations.
11-29 11:03:26.526 6533 6533 W IdlingPolicy: These resources are not idle: [LooperIdlingResource-536-mqt_js]
11-29 11:03:27.944 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 400 iterations.
11-29 11:03:31.532 6533 6533 W IdlingPolicy: These resources are not idle: [LooperIdlingResource-536-mqt_js]
11-29 11:03:33.058 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 500 iterations.
11-29 11:03:35.711 6533 6533 I Detox : Network is busy
11-29 11:03:35.730 6533 7473 I WebViewFactory: Loading com.google.android.webview version 74.0.3729.185 (code 373018518)
11-29 11:03:35.734 6533 7473 I lines.mobileap: The ClassLoaderContext is a special shared library.
11-29 11:03:35.737 6533 7473 I lines.mobileap: The ClassLoaderContext is a special shared library.
11-29 11:03:35.755 6533 6533 I Detox : Network is busy
11-29 11:03:35.820 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 2 lines
11-29 11:03:35.861 6533 6533 I Detox : Network is busy
11-29 11:03:35.897 6533 7473 I cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 8953-8955)
11-29 11:03:35.903 6533 6533 I Detox : Network is busy
11-29 11:03:35.910 6533 7473 I chromium: [INFO:library_loader_hooks.cc(50)] Chromium logging enabled: level = 0, default verbosity = 0
11-29 11:03:35.911 6533 7473 I cr_LibraryLoader: Expected native library version number "74.0.3729.185", actual native library version number "74.0.3729.185"
11-29 11:03:35.945 6533 6533 I Detox : Network is busy
11-29 11:03:35.980 6533 6533 I Detox : Network is busy
11-29 11:03:36.038 6533 6533 I Detox : Network is busy
11-29 11:03:36.060 6533 6533 I Detox : Network is busy
11-29 11:03:36.099 6533 6533 I Detox : Network is busy
11-29 11:03:36.135 6533 6533 I Detox : Network is busy
11-29 11:03:36.207 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 1 line
11-29 11:03:36.251 6533 6533 I Detox : Network is busy
11-29 11:03:36.287 6533 6533 I Detox : Network is busy
11-29 11:03:40.643 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 79 lines
11-29 11:03:40.743 6533 6533 I Detox : Network is busy
11-29 11:03:40.744 6533 6533 W IdlingPolicy: These resources are not idle: [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource]
11-29 11:03:40.746 6533 6533 I Detox : Network is busy
11-29 11:03:42.797 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 68 lines
11-29 11:03:42.797 6533 6533 I Detox : Network is busy
11-29 11:03:42.834 6533 6533 I Detox : Network is busy
11-29 11:03:42.834 6533 6533 I Detox : Network is busy
11-29 11:03:42.931 6533 6533 I Detox : Network is busy
11-29 11:03:42.932 6533 6533 I Detox : Network is busy
11-29 11:03:43.015 6533 6533 I Detox : Network is busy
11-29 11:03:43.566 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 20 lines
11-29 11:03:43.566 6533 6533 I Detox : Network is busy
11-29 11:03:43.566 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 300 iterations.
11-29 11:03:43.653 6533 6533 I Detox : Network is busy
11-29 11:03:43.840 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 6 lines
11-29 11:03:43.840 6533 6533 I Detox : Network is busy
11-29 11:03:43.914 6533 6533 I Detox : Network is busy
11-29 11:03:43.915 6533 6533 I Detox : Network is busy
11-29 11:03:43.996 6533 6533 I Detox : Network is busy
11-29 11:03:44.031 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 2 lines
11-29 11:03:44.032 6533 6533 I Detox : Network is busy
11-29 11:03:44.093 6533 6533 I Detox : Network is busy
11-29 11:03:44.093 6533 6533 I Detox : Network is busy
11-29 11:03:44.119 6533 6533 I Detox : Network is busy
11-29 11:03:44.220 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 4 lines
11-29 11:03:44.220 6533 6533 I Detox : Network is busy
11-29 11:03:44.283 6533 6533 I Detox : Network is busy
11-29 11:03:44.659 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 14 lines
11-29 11:03:44.659 6533 6533 I Detox : Network is busy
11-29 11:03:44.689 6533 6533 I Detox : Network is busy
11-29 11:03:45.684 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 35 lines
11-29 11:03:45.751 6533 6533 I Detox : Network is busy
11-29 11:03:45.751 6533 6533 W IdlingPolicy: These resources are not idle: [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource]
11-29 11:03:45.757 6533 6533 I Detox : Network is busy
11-29 11:03:46.386 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 25 lines
11-29 11:03:46.387 6533 6533 I Detox : Network is busy
11-29 11:03:46.473 6533 6533 I Detox : Network is busy
11-29 11:03:50.747 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 212 lines
11-29 11:03:50.806 6533 6533 I Detox : Network is busy
11-29 11:03:50.806 6533 6533 W IdlingPolicy: These resources are not idle: [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource]
11-29 11:03:50.808 6533 6533 I Detox : Network is busy
11-29 11:03:51.119 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 22 lines
11-29 11:03:51.119 6533 6533 I Detox : Network is busy
11-29 11:03:51.158 6533 6533 I Detox : Network is busy
11-29 11:03:52.277 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 82 lines
11-29 11:03:52.277 6533 6533 I Detox : Network is busy
11-29 11:03:52.338 6533 6533 I Detox : Network is busy
11-29 11:03:52.578 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 18 lines
11-29 11:03:52.579 6533 6533 I Detox : Network is busy
11-29 11:03:52.579 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 600 iterations.
11-29 11:03:52.666 6533 6533 I Detox : Network is busy
11-29 11:03:54.834 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 154 lines
11-29 11:03:54.834 6533 6533 I Detox : Network is busy
11-29 11:03:54.881 6533 6533 I Detox : Network is busy
11-29 11:03:55.396 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 42 lines
11-29 11:03:55.397 6533 6533 I Detox : Network is busy
11-29 11:03:55.397 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 700 iterations.
11-29 11:03:55.420 6533 6533 I Detox : Network is busy
11-29 11:03:55.834 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 27 lines
11-29 11:03:55.839 6533 6533 I Detox : Network is busy
11-29 11:03:55.839 6533 6533 W IdlingPolicy: These resources are not idle: [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource]
11-29 11:03:55.903 6533 6533 I Detox : Network is busy
11-29 11:03:59.598 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 313 lines
11-29 11:03:59.598 6533 6533 I Detox : Network is busy
11-29 11:03:59.651 6533 6533 I Detox : Network is busy
11-29 11:04:00.056 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 33 lines
11-29 11:04:00.056 6533 6533 I Detox : Network is busy
11-29 11:04:00.135 6533 6533 I Detox : Network is busy
11-29 11:04:00.209 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 8 lines
11-29 11:04:00.209 6533 6533 I Detox : Network is busy
11-29 11:04:00.269 6533 6533 I Detox : Network is busy
11-29 11:04:00.269 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 3 lines
11-29 11:04:00.270 6533 6533 I Detox : Network is busy
11-29 11:04:00.293 6533 6533 I Detox : Network is busy
11-29 11:04:00.835 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 39 lines
11-29 11:04:00.853 6533 6533 I Detox : Network is busy
11-29 11:04:00.854 6533 6533 W IdlingPolicy: These resources are not idle: [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource]
11-29 11:04:00.916 6533 6533 I Detox : Network is busy
11-29 11:04:01.518 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 64 lines
11-29 11:04:01.518 6533 6533 I Detox : Network is busy
11-29 11:04:01.519 6533 6533 W UiControllerImpl: Waiting for: DYNAMIC_TASKS_HAVE_IDLED for 900 iterations.
11-29 11:04:01.554 6533 6533 I Detox : Network is busy
11-29 11:04:01.793 6533 6533 I chatty : uid=10133(xyz.mobileapp) identical 24 lines
11-29 11:04:01.793 6533 6533 I Detox : Network is busy
11-29 11:04:01.797 6533 6609 E DetoxManager: Exception
11-29 11:04:01.797 6533 6609 E DetoxManager: java.lang.reflect.InvocationTargetException
11-29 11:04:01.797 6533 6609 E DetoxManager: at java.lang.reflect.Method.invoke(Native Method)
11-29 11:04:01.797 6533 6609 E DetoxManager: at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:443)
11-29 11:04:01.797 6533 6609 E DetoxManager: at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:405)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.invoke.types.ClassTarget.execute(ClassTarget.java:23)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.invoke.types.Target.invoke(Target.java:59)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:35)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:26)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:20)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.detox.InvokeActionHandler.handle(DetoxActionHandlers.kt:49)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.detox.DetoxManager$2.run(DetoxManager.java:105)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Handler.handleCallback(Handler.java:883)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Handler.dispatchMessage(Handler.java:100)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Looper.loop(Looper.java:214)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.detox.Detox$1.run(Detox.java:134)
11-29 11:04:01.797 6533 6609 E DetoxManager: at java.lang.Thread.run(Thread.java:919)
11-29 11:04:01.797 6533 6609 E DetoxManager: Caused by: androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 345, 670 and precision: 16, 16' on view '(with tag value: is "confirm" and view has effective visibility=VISIBLE)'.
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.PerformException$Builder.build(PerformException.java:86)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:87)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:322)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:178)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:119)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.detox.espresso.EspressoDetox.perform(EspressoDetox.java:40)
11-29 11:04:01.797 6533 6609 E DetoxManager: ... 15 more
11-29 11:04:01.797 6533 6609 E DetoxManager: Caused by: androidx.test.espresso.IdlingResourceTimeoutException: Wait for [com.wix.detox.reactnative.idlingresources.NetworkIdlingResource] to become idle timed out
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.IdlingPolicy.handleTimeout(IdlingPolicy.java:61)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.UiControllerImpl$5.resourcesHaveTimedOut(UiControllerImpl.java:434)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.IdlingResourceRegistry$Dispatcher.handleTimeout(IdlingResourceRegistry.java:481)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.IdlingResourceRegistry$Dispatcher.handleMessage(IdlingResourceRegistry.java:414)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Handler.dispatchMessage(Handler.java:103)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:148)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:525)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:447)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.base.UiControllerImpl.injectMotionEvent(UiControllerImpl.java:252)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:162)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.MotionEvents.sendUp(MotionEvents.java:139)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.Tap.sendSingleTap(Tap.java:170)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.Tap.access$100(Tap.java:31)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.Tap$1.sendTap(Tap.java:47)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.action.GeneralClickAction.perform(GeneralClickAction.java:137)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.wix.detox.espresso.action.RNClickAction.perform(RNClickAction.java:43)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:366)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:255)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction.access$100(ViewInteraction.java:65)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:158)
11-29 11:04:01.797 6533 6609 E DetoxManager: at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:155)
11-29 11:04:01.797 6533 6609 E DetoxManager: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Handler.handleCallback(Handler.java:883)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Handler.dispatchMessage(Handler.java:100)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.os.Looper.loop(Looper.java:214)
11-29 11:04:01.797 6533 6609 E DetoxManager: at android.app.ActivityThread.main(ActivityThread.java:7356)
11-29 11:04:01.797 6533 6609 E DetoxManager: at java.lang.reflect.Method.invoke(Native Method)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
11-29 11:04:01.797 6533 6609 E DetoxManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
11-29 11:04:01.797 6533 6609 I WebSocketClient: At sendAction
11-29 11:04:01.815 6533 6609 D WebSocketClient: Detox Action Sent: error
11-29 11:04:01.861 6533 6533 I Detox : Network is busy
I re-run the test after the failure and it went fine.
It seems like the test execution is racing with the devices' network usage, probably due to the wallet generation as you explained.
I can advise applying usage of IdlingPolicies.setIdlingResourceTimeout()
(and maybe IdlingPolicies.setMasterPolicyTimeout()
) in your native-test implementation (typically DetoxTest.java
). According to the sourcecode, Espresso's default is 26 seconds, perhaps you could use more. Do note, however, that this would effect all of the tests in your test suite.
How does that sound, overall?
@d4vidi thanks for the reply!
So you are talking about this here: https://android.googlesource.com/platform/frameworks/testing/+/android-support-test/espresso/core/src/main/java/android/support/test/espresso/IdlingPolicies.java and the docs: https://developer.android.com/reference/android/support/test/espresso/IdlingPolicies
I'm not really sure I understand idling resources correctly. I checked the above source code and modified the detoxTest.java file as follow:
package network.trustlines.mobileapp;
import com.wix.detox.Detox;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.espresso.IdlingPolicies;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import java.util.concurrent.TimeUnit;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class DetoxTest {
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
@Test
public void runDetoxTests() {
IdlingPolicies.setMasterPolicyTimeout(120, TimeUnit.SECONDS);
IdlingPolicies.setIdlingResourceTimeout(60, TimeUnit.SECONDS);
Detox.runTests(mActivityRule);
}
}
is this the correct way to tell espresso to wait for a up to 120s before triggering an Exception?
Also why do I have to set this? Shouldn't detox automatically control this when one uses withTimeout? shouldn't the idlingPolicy be automatically moved to whatever time setTimeout specifies?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this reporsitory, read this discussion.
@d4vidi - with the above changes our circleci tests are running stable. If you don't have another improvement suggestion you can close the issue.
@compojoom great to hear!
Describe the bug I have a test suite that runs fine on iOS, but fails on Android. Actually it doesn't fail on all emulators. for example Pixel_2 with API 29 works, but Pixel_3 with API 24 fails and Pixel_3 with API 29 sometimes succeeds and sometimes fails.
The test I'm trying to run is this one:
The error that we get is this:
Error performing 'single click - At Coordinates: 732, 1535 and precision: 16, 16' on view '(with tag value: is "confirm" and view has effective visibility=VISIBLE)'
It fails before the disableSynchronization() call. However sometimes on Pixel_3_API_29 it passes and sometimes it fails. If I move theawait device.disableSynchronization()
line to the top of the test, then it succeeds all the time.The signUpWelcome screen starts an ether wallet generation and is very CPU intensive. Detox was having troubles with this, so I opted for manual sync there. Once the wallet generation is done, we move the user to a congratulations screen - he stays there for 3s and then we auto move the user to the SingUpUsername screen.
I'm seeing the following log in logcat:
The error is obviously coming from esspresso, but I'm not sure why. I don't have a keyboard on the screen and when I watch the test I see that the confirm button is tapped. I tried to add a expect call before the confirm tap and after like this:
To Reproduce
Here is a video of the test:
Expected behavior I would expect the test not to fail as the correct button is clicked.
Environment (please complete the following information):
Device and Verbose Detox Logs