wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.24k stars 1.92k forks source link

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)' #1782

Closed compojoom closed 4 years ago

compojoom commented 4 years ago

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:

    it("clicking on signUp should start registration flow", async () => {
      // open Modal
      await element(by.id("registration")).tap()
      // hit confirm
      await element(by.id("confirm")).tap()

      // Disable automatic synchronization as our wallet is very CPU intensive
      // and that somehow screws up the automatic detox synchronization
      await device.disableSynchronization()

      await waitFor(element(by.id("signUpWelcome")))
        .toExist()
        .withTimeout(120000)
      await waitFor(element(by.id("singUpCongratulations")))
        .toExist()
        .withTimeout(60000)
      await waitFor(element(by.id("signUpUsername")))
        .toExist()
        .withTimeout(60000)

      await device.enableSynchronization()
    })

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 the await 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:

    Caused by: androidx.test.espresso.PerformException: 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)'.
        at androidx.test.espresso.PerformException$Builder.build(PerformException.java:86)
        at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:87)
        at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:59)
        at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:322)
        at androidx.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:178)
        at androidx.test.espresso.ViewInteraction.perform(ViewInteraction.java:119)
        at com.wix.detox.espresso.EspressoDetox.perform(EspressoDetox.java:40)
        at java.lang.reflect.Method.invoke(Native Method) 
        at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:443) 
        at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:405) 
        at com.wix.invoke.types.ClassTarget.execute(ClassTarget.java:23) 
        at com.wix.invoke.types.Target.invoke(Target.java:59) 
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:35) 
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:26) 
        at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:20) 
        at com.wix.detox.InvokeActionHandler.handle(DetoxActionHandlers.kt:49) 
        at com.wix.detox.DetoxManager$2.run(DetoxManager.java:105) 
        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 com.wix.detox.Detox$1.run(Detox.java:134) 
        at java.lang.Thread.run(Thread.java:761) 

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:

      await expect(element(by.id("confirmBox"))).toBeVisible()
      await element(by.id("confirm")).tap()
      await expect(element(by.id("confirmBox"))).toBeNotVisible()

To Reproduce

Here is a video of the test: fail

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

$ detox test -c android.emu.debug -n Pixel_3_API_24 --loglevel trace  --record-videos all
detox[50479] INFO:  [test.js] configuration="android.emu.debug" loglevel="trace" recordVideos="all" deviceName="Pixel_3_API_24" reportSpecs=true readOnlyEmu=false DETOX_START_TIMESTAMP=1574768354009 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
detox[50480] INFO:  [DetoxServer.js] server listening on localhost:52498...
detox[50480] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:52498
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"2d93b64f-fbb5-843d-b097-a991d79a6ad7","role":"tester"},"messageId":0}
detox[50480] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"2d93b64f-fbb5-843d-b097-a991d79a6ad7","role":"tester"},"messageId":0}

detox[50480] DEBUG: [exec.js/EXEC_CMD, #0] "/usr/local/share/android-sdk/emulator/emulator" -list-avds --verbose
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #0] 7.3_Foldable_API_29
8_Foldable_API_29
Nexus_5X_API_27
Nexus_5_API_29
Nexus_S_API_29
Pixel_2_API_26
Pixel_2_API_28
Pixel_2_API_29
Pixel_3_API_24
Pixel_3_API_29

detox[50480] DEBUG: [exec.js/EXEC_CMD, #1] "/usr/local/share/android-sdk/platform-tools/adb"  devices
detox[50480] DEBUG: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-12950  device
emulator-19076  device
emulator-19976  device

detox[50480] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 12950, host: localhost
detox[50480] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 19076, host: localhost
detox[50480] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 19976, host: localhost
detox[50480] DEBUG: [exec.js/EXEC_CMD, #2] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "getprop dev.bootcomplete"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #2] 1

detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-19976' })
detox[50480] DEBUG: [exec.js/EXEC_CMD, #3] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "getprop ro.build.version.sdk"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #3] 24

detox[50480] DEBUG: [exec.js/EXEC_CMD, #4] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #4]   mWakefulness=Awake
  mWakefulnessChanging=false
  mWakeLockSummary=0x0
  mUserActivitySummary=0x1
  mWakeUpWhenPluggedOrUnpluggedConfig=false
  mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
  mUserActivityTimeoutOverrideFromWindowManager=-1
  mUserInactiveOverrideFromWindowManager=false

detox[50480] DEBUG: [exec.js/EXEC_CMD, #5] "/usr/local/share/android-sdk/build-tools/29.0.2/aapt" dump badging "/Users/zyx/Development/abc/mobileapp/android/app/build/outputs/apk/production/debug/app-production-debug.apk" | grep -e "package: name="
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='network.trustlines.mobileapp.debug' versionCode='1574766797' versionName='1.4.1-beta.1' compileSdkVersion='28' compileSdkVersionCodename='9'

detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeUninstallApp({
  deviceId: 'emulator-19976',
  bundleId: 'network.trustlines.mobileapp.debug'
})
detox[50480] DEBUG: [exec.js/EXEC_CMD, #6] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "pm list packages network.trustlines.mobileapp.debug"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #6] package:network.trustlines.mobileapp.debug.test

detox[50480] DEBUG: [exec.js/EXEC_CMD, #7] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "pm list packages network.trustlines.mobileapp.debug.test"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #7] package:network.trustlines.mobileapp.debug.test

detox[50480] DEBUG: [exec.js/EXEC_CMD, #8] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 uninstall network.trustlines.mobileapp.debug.test
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #8] Success

detox[50480] DEBUG: [exec.js/EXEC_CMD, #9] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 install -r -g -t "/Users/zyx/Development/abc/mobileapp/android/app/build/outputs/apk/production/debug/app-production-debug.apk"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #9] Performing Streamed Install
Success

detox[50480] DEBUG: [exec.js/EXEC_CMD, #10] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 install -r -g -t "/Users/zyx/Development/abc/mobileapp/android/app/build/outputs/apk/androidTest/production/debug/app-production-debug-androidTest.apk"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #10] Performing Streamed Install
Success

detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeAll()
detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({
  deviceId: 'emulator-19976',
  bundleId: 'network.trustlines.mobileapp.debug',
  launchArgs: {
    detoxServer: 'ws://localhost:52498',
    detoxSessionId: '2d93b64f-fbb5-843d-b097-a991d79a6ad7'
  }
})
detox[50480] DEBUG: [exec.js/EXEC_CMD, #11] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "date +\"%m-%d %T.000\""
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #11] 11-26 12:39:17.000

detox[50480] DEBUG: [exec.js/EXEC_CMD, #12] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 reverse tcp:52498 tcp:52498
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #12]
detox[50480] DEBUG: [exec.js/EXEC_CMD, #13] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "pm list instrumentation"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #13] instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
instrumentation:com.android.smoketest.tests/com.android.smoketest.SmokeTestRunner (target=com.android.smoketest)
instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis)
instrumentation:network.trustlines.mobileapp.debug.test/androidx.test.runner.AndroidJUnitRunner (target=network.trustlines.mobileapp.debug)
instrumentation:org.chromium.webview_shell/.WebViewLayoutTestRunner (target=org.chromium.webview_shell)

detox[50480] DEBUG: [exec.js/SPAWN_CMD, #14] [pid=50499] /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell am instrument -w -r -e detoxServer ws://localhost:52498 -e detoxSessionId 2d93b64f-fbb5-843d-b097-a991d79a6ad7 -e debug ZmFsc2U= network.trustlines.mobileapp.debug.test/androidx.test.runner.AndroidJUnitRunner
detox[50480] TRACE: [exec.js/SPAWN_STDOUT, #14] INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
network.trustlines.mobileapp.DetoxTest:
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS: class=network.trustlines.mobileapp.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS_CODE: 1

detox[50480] DEBUG: [exec.js/EXEC_CMD, #15] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "ps | grep \"network\.trustlines\.mobileapp\.debug$\""
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #15] u0_a102   13680 1409  1450308 73424 SyS_epoll_ 00000000 S network.trustlines.mobileapp.debug

detox[13680] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({
  deviceId: 'emulator-19976',
  bundleId: 'network.trustlines.mobileapp.debug',
  launchArgs: {
    detoxServer: 'ws://localhost:52498',
    detoxSessionId: '2d93b64f-fbb5-843d-b097-a991d79a6ad7'
  },
  pid: 13680
})
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","params":{},"messageId":-1000}

detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"reactNativeReload","params":{},"messageId":-1000}
MobileApp assigned to emulator-19976 (Pixel_3_API_24)

detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=reactNativeReload (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","params":{},"messageId":-1000}

detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"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":["accountless"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxViewActions"},"method":"click","args":[]}}]},"messageId":1}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=invokeResult (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"invokeResult","params":{"result":null},"messageId":1}

MobileApp > Login: user should see login and sing up screen
MobileApp > Login: user should see login and sing up screen [SKIPPED]
MobileApp > Login: navigating to login screen should display import account
MobileApp > Login: navigating to login screen should display import account [SKIPPED]
MobileApp > Login: clicking on sign up should display modal screen with agree and disagree buttons
MobileApp > Login: clicking on sign up should display modal screen with agree and disagree buttons [SKIPPED]
MobileApp > Login: clicking on disagree should close modal screen
MobileApp > Login: clicking on disagree should close modal screen [SKIPPED]
MobileApp > Login: clicking on signUp should start registration flow
detox[50480] TRACE: [Detox.js/DETOX_BEFORE_EACH] running test: "MobileApp Login clicking on signUp should start registration flow"
detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeEach({
  title: 'clicking on signUp should start registration flow',
  fullName: 'MobileApp Login clicking on signUp should start registration flow',
  status: 'running'
})
detox[50480] TRACE: [Artifact.js/START] starting ADBVideoRecording
detox[50480] DEBUG: [exec.js/SPAWN_CMD, #16] [pid=50519] /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell screenrecord /sdcard/123915216_0.mp4
detox[50480] ERROR: [exec.js/SPAWN_STDERR, #16] Unable to get output buffers (err=-38)
Encoder failed (err=-38)

detox[50480] TRACE: [exec.js/SPAWN_END, #16] /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell screenrecord /sdcard/123915216_0.mp4 finished with code = 218
detox[50480] DEBUG: [exec.js/EXEC_CMD, #17] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell du /sdcard/123915216_0.mp4
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #17] 0   /sdcard/123915216_0.mp4

detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"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":[]}}]},"messageId":2}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=invokeResult (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"invokeResult","params":{"result":null},"messageId":2}

detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"invoke","params":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertMatcher","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"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]},"messageId":3}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=invokeResult (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"invokeResult","params":{"result":null},"messageId":3}

detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"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":[]}}]},"messageId":4}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=invoke (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=error (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"error","params":{"error":"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)'."},"messageId":4}

MobileApp > Login: clicking on signUp should start registration flow [FAIL]
MobileApp > Login: submit without username should display invalid username
MobileApp > Login: submit without username should display invalid username [SKIPPED]
MobileApp > Login: entering a name and clicking lets go should bring backup screen
MobileApp > Login: entering a name and clicking lets go should bring backup screen [SKIPPED]
MobileApp > Login: trying to skip the backup shouldn't work if the user hasn't clicked the confirm button
MobileApp > Login: trying to skip the backup shouldn't work if the user hasn't clicked the confirm button [SKIPPED]
MobileApp > Login: hitting confirm button & backup later should bring you to tutorial page
MobileApp > Login: hitting confirm button & backup later should bring you to tutorial page [SKIPPED]
MobileApp > Login: pressing skip should bring you to home screen
MobileApp > Login: pressing skip should bring you to home screen [SKIPPED]
detox[50480] TRACE: [Detox.js/DETOX_AFTER_EACH] failed test: "MobileApp Login clicking on signUp should start registration flow"
detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterEach({
  title: 'clicking on signUp should start registration flow',
  fullName: 'MobileApp Login clicking on signUp should start registration flow',
  status: 'failed',
  timedOut: false
})

detox[50480] TRACE: [Artifact.js/STOP] stopping ADBVideoRecording
detox[50480] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 50519]: /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell screenrecord /sdcard/123915216_0.mp4
detox[50480] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onAfterAll()
detox[50480] TRACE: [Artifact.js/SAVE] saving ADBVideoRecording to: artifacts/android.emu.debug.2019-11-26 11-39-14Z/✗ MobileApp Login clicking on signUp should start registration flow/test.mp4
detox[50480] DEBUG: [exec.js/EXEC_CMD, #18] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell du /sdcard/123915216_0.mp4
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #18] 0   /sdcard/123915216_0.mp4

detox[50480] DEBUG: [exec.js/EXEC_CMD, #19] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 pull "/sdcard/123915216_0.mp4" "artifacts/android.emu.debug.2019-11-26 11-39-14Z/✗ MobileApp Login clicking on signUp should start registration flow/test.mp4"
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #19] /sdcard/123915216_0.mp4: 1 file pulled.

detox[50480] DEBUG: [exec.js/EXEC_CMD, #20] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 shell "rm  \"/sdcard/123915216_0.mp4\""
detox[50480] TRACE: [exec.js/EXEC_SUCCESS, #20]
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"cleanup","params":{"stopRunner":false},"messageId":-49642}
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=tester action=cleanup (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [DetoxServer.js/MESSAGE] role=testee action=cleanupDone (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"cleanupDone","params":{},"messageId":-49642}

detox[50480] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 50499]: /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell am instrument -w -r -e detoxServer ws://localhost:52498 -e detoxSessionId 2d93b64f-fbb5-843d-b097-a991d79a6ad7 -e debug ZmFsc2U= network.trustlines.mobileapp.debug.test/androidx.test.runner.AndroidJUnitRunner
detox[50480] DEBUG: [DetoxServer.js/DISCONNECT] role=tester, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 50499]: /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell am instrument -w -r -e detoxServer ws://localhost:52498 -e detoxSessionId 2d93b64f-fbb5-843d-b097-a991d79a6ad7 -e debug ZmFsc2U= network.trustlines.mobileapp.debug.test/androidx.test.runner.AndroidJUnitRunner
detox[50480] TRACE: [exec.js/SPAWN_END, #14] /usr/local/share/android-sdk/platform-tools/adb -s emulator-19976 shell am instrument -w -r -e detoxServer ws://localhost:52498 -e detoxSessionId 2d93b64f-fbb5-843d-b097-a991d79a6ad7 -e debug ZmFsc2U= network.trustlines.mobileapp.debug.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT
detox[50480] DEBUG: [exec.js/EXEC_CMD, #21] "/usr/local/share/android-sdk/platform-tools/adb" -s emulator-19976 reverse --remove tcp:52498
detox[50480] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7
detox[50480] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=tester not connected, cannot fw action (sessionId=2d93b64f-fbb5-843d-b097-a991d79a6ad7)
detox[50480] DEBUG: [DetoxServer.js/WS_CLOSE] Detox server connections terminated gracefully
 FAIL  e2e/start.spec.js (70.442s)
  MobileApp
    Login
      ✕ clicking on signUp should start registration flow (60907ms)
      ○ skipped user should see login and sing up screen
      ○ skipped navigating to login screen should display import account
      ○ skipped clicking on sign up should display modal screen with agree and disagree buttons
      ○ skipped clicking on disagree should close modal screen
      ○ skipped submit without username should display invalid username
      ○ skipped entering a name and clicking lets go should bring backup screen
      ○ skipped trying to skip the backup shouldn't work if the user hasn't clicked the confirm button
      ○ skipped hitting confirm button & backup later should bring you to tutorial page
      ○ skipped pressing skip should bring you to home screen

  ● MobileApp › Login › clicking on signUp should start registration flow

    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)'.

      41 |       // hit confirm
      42 |       await expect(element(by.id("confirmBox"))).toBeVisible()
    > 43 |       await element(by.id("confirm")).tap()
         |                                       ^
      44 |       await expect(element(by.id("confirmBox"))).toBeNotVisible()
      45 |
      46 |       // Disable automatic synchronization as our wallet is very CPU intensive

      at Client.execute (../node_modules/detox/src/client/Client.js:92:28)
      at InvocationManager.execute (../node_modules/detox/src/invoke.js:11:39)
      at ActionInteraction.execute (../node_modules/detox/src/android/expect.js:128:35)
      at Element.tap (../node_modules/detox/src/android/expect.js:220:88)
      at tap (start.spec.js:43:39)
      at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
      at Generator.invoke [as _invoke] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:271:22)
      at Generator.prototype.<computed> [as next] (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:97:21)
      at tryCatch (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:45:40)
      at invoke (../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:135:20)
      at ../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js:145:13
compojoom commented 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?

compojoom commented 4 years ago

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.

d4vidi commented 4 years ago

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?

compojoom commented 4 years ago

@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?

stale[bot] commented 4 years ago

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.

compojoom commented 4 years ago

@d4vidi - with the above changes our circleci tests are running stable. If you don't have another improvement suggestion you can close the issue.

d4vidi commented 4 years ago

@compojoom great to hear!