wix / Detox

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

Detox can't seem to tell when the app is ready on Android #3650

Closed johnnywang closed 1 year ago

johnnywang commented 1 year ago

What happened?

I wrote a basic smoke test to make sure my app (an ejected Expo app that still uses it for certain build features) opens and a user can log in (among other tests). These all work fine in the iOS flow, while, on Android, the app does get properly installed and even started up, but Detox seems to hang on launchApp and eventually times out, seemingly on:

23:49:27.964 detox[62313] DEBUG: [WSS_CONNECTION, #50342] registered a new connection.
23:49:33.485 detox[62313] DEBUG: [APP_STATUS] Failed to execute the current status query.
23:49:36.365 detox[62313] WARN:  [PENDING_REQUESTS] The app has not responded to the network requests below:
  (id = 1) currentStatus: {}
  (id = -1000) isReady: {}

That might be the reason why the test "Smoke: App should start and top-level tabs should be accessible" has timed out.

What was the expected behaviour?

Android tests should also work and Detox should not hang

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

Unable to get the DetoxTemplate app to run in debug mode on Android right now, so unable to repro w/ the template: https://github.com/wix-incubator/DetoxTemplate/issues/3

In what environment did this happen?

Detox version: 19.12.6 React Native version: 0.69.6 Node version: 16.14.2 Device model: Pixel 5 Android version: API 31 Test-runner (select one): jest-circus

Detox logs

Detox logs ``` $ TEST_PLATFORM=android yarn test-e2e:run dev:android12Sim --verbose=true --debug-synchronization 500 --loglevel trace --artifacts-location /Users/johnny/Desktop/detox_artifacts smoke $ detox test --configuration dev:android12Sim --verbose=true --debug-synchronization 500 --loglevel trace --artifacts-location /Users/johnny/Desktop/detox_artifacts smoke 21:59:56.442 detox[28775] INFO: [test.js] DETOX_ARTIFACTS_LOCATION="/Users/johnny/Desktop/detox_artifacts" DETOX_CONFIGURATION="dev:android12Sim" DETOX_DEBUG_SYNCHRONIZATION=500 DETOX_LOGLEVEL="trace" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1666760396437 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --verbose true smoke watchman warning: Recrawled this watch 91 times, most recently because: MustScanSubDirs UserDroppedTo resolve, please review the information on https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl To clear this warning, run: `watchman watch-del '/Users/johnny/Development/app' ; watchman watch-project '/Users/johnny/Development/app'` 21:59:57.282 detox[28776] TRACE: [DETOX_CREATE] created a Detox instance with config: { appsConfig: { default: { binaryPath: 'android/app/build/outputs/apk/development/debug/app-development-debug.apk', build: 'yarn test-e2e:build:android && yarn test-e2e:init:android', type: 'android.apk' } }, artifactsConfig: { rootDir: '/Users/johnny/Desktop/detox_artifacts/dev:android12Sim.2022-10-26 04-59-56Z', plugins: { log: { enabled: false, keepOnlyFailedTestsArtifacts: false }, screenshot: { enabled: true, shouldTakeAutomaticSnapshots: false, keepOnlyFailedTestsArtifacts: false }, video: { enabled: false, keepOnlyFailedTestsArtifacts: false }, instruments: { enabled: false, keepOnlyFailedTestsArtifacts: false }, timeline: { enabled: false }, uiHierarchy: { enabled: false, keepOnlyFailedTestsArtifacts: false } }, pathBuilder: ArtifactPathBuilder { _rootDir: '/Users/johnny/Desktop/detox_artifacts/dev:android12Sim.2022-10-26 04-59-56Z' } }, behaviorConfig: { init: { reinstallApp: true, exposeGlobals: true }, cleanup: { shutdownDevice: false }, launchApp: 'auto' }, cliConfig: { artifactsLocation: '/Users/johnny/Desktop/detox_artifacts', configuration: 'dev:android12Sim', debugSynchronization: 500, loglevel: 'trace', useCustomLogger: true }, configurationName: 'dev:android12Sim', deviceConfig: { device: { avdName: 'Pixel_5_API_31' }, type: 'android.emulator', utilBinaryPaths: [ 'e2e/setup/test-butler-app-2.2.1.apk' ] }, runnerConfig: { testRunner: 'jest', runnerConfig: 'e2e/config.json', specs: 'e2e', skipLegacyWorkersInjection: true }, sessionConfig: { autoStart: true, sessionId: '47a7a0bf-3746-c882-4cf0-06e5ce8aba2e', debugSynchronization: 500 } } 21:59:57.284 detox[28776] DEBUG: [WSS_CREATE] Detox server listening on localhost:56527... 21:59:57.292 detox[28776] DEBUG: [WSS_CONNECTION, #56528] registered a new connection. 21:59:57.293 detox[28776] TRACE: [WS_OPEN] opened web socket to: ws://localhost:56527 21:59:57.294 detox[28776] TRACE: [WS_SEND] {"type":"login","params":{"sessionId":"47a7a0bf-3746-c882-4cf0-06e5ce8aba2e","role":"tester"},"messageId":0} 21:59:57.295 detox[28776] TRACE: [WSS_GET_FROM, #56528] {"type":"login","params":{"sessionId":"47a7a0bf-3746-c882-4cf0-06e5ce8aba2e","role":"tester"},"messageId":0} 21:59:57.295 detox[28776] TRACE: [SESSION_CREATED] created session 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e 21:59:57.295 detox[28776] TRACE: [WSS_SEND_TO, #tester] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0} 21:59:57.295 detox[28776] TRACE: [SESSION_JOINED] tester joined session 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e 21:59:57.296 detox[28776] TRACE: [WS_MESSAGE] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0} 21:59:57.322 detox[28776] DEBUG: [EXEC_CMD, #0] "/Users/johnny/Library/Android/sdk/emulator/emulator" -list-avds --verbose 21:59:57.338 detox[28776] TRACE: [EXEC_SUCCESS, #0] Pixel_5_API_31 Pixel_5_API_33 21:59:57.339 detox[28776] DEBUG: [EXEC_CMD, #1] "/Users/johnny/Library/Android/sdk/emulator/emulator" -version 21:59:57.404 detox[28776] TRACE: [EXEC_SUCCESS, #1] INFO | Duplicate loglines will be removed, if you wish to see each indiviudal line launch with the -log-nofilter flag. Android emulator version 31.3.10.0 (build_id 8807927) (CL:N/A) Copyright (C) 2006-2017 The Android Open Source Project and many others. This program is a derivative of the QEMU CPU emulator (www.qemu.org). This software is licensed under the terms of the GNU General Public License version 2, as published by the Free Software Foundation, and may be copied, distributed, and modified under those terms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 21:59:57.404 detox[28776] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 3, patch: 10, toString: [Function: toString] } 21:59:57.405 detox[28776] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_5_API_31" 21:59:57.406 detox[28776] DEBUG: [EXEC_CMD, #2] "/Users/johnny/Library/Android/sdk/platform-tools/adb" devices 21:59:57.421 detox[28776] DEBUG: [EXEC_SUCCESS, #2] List of devices attached emulator-18636 device 21:59:57.422 detox[28776] TRACE: [TELNET_CONNECTING] port: 18636, host: localhost 21:59:57.425 detox[28776] DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-18636 21:59:57.426 detox[28776] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-18636 21:59:57.426 detox[28776] DEBUG: [EXEC_CMD, #3] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "getprop dev.bootcomplete" 21:59:57.457 detox[28776] TRACE: [EXEC_SUCCESS, #3] 1 21:59:57.458 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBootDevice({ deviceId: 'emulator-18636', type: 'Pixel_5_API_31', coldBoot: false }) 21:59:57.458 detox[28776] DEBUG: [EXEC_CMD, #4] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "getprop ro.build.version.sdk" 21:59:57.482 detox[28776] TRACE: [EXEC_SUCCESS, #4] 31 21:59:57.483 detox[28776] DEBUG: [EXEC_CMD, #5] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "settings put global animator_duration_scale 0" 21:59:57.509 detox[28776] TRACE: [EXEC_SUCCESS, #5] 21:59:57.510 detox[28776] DEBUG: [EXEC_CMD, #6] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "settings put global window_animation_scale 0" 21:59:57.536 detox[28776] TRACE: [EXEC_SUCCESS, #6] 21:59:57.536 detox[28776] DEBUG: [EXEC_CMD, #7] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "settings put global transition_animation_scale 0" 21:59:57.570 detox[28776] TRACE: [EXEC_SUCCESS, #7] 21:59:57.571 detox[28776] DEBUG: [EXEC_CMD, #8] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "dumpsys power | grep \"^[ ]*m[UW].*=\"" 21:59:57.600 detox[28776] TRACE: [EXEC_SUCCESS, #8] mWakefulness=Awake mWakefulnessChanging=false mWakeLockSummary=0x2b mWakeUpWhenPluggedOrUnpluggedConfig=false mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false mUserActivityTimeoutOverrideFromWindowManager=-1 mUserInactiveOverrideFromWindowManager=false mUserId=0 mWakeLockSummary=0x2b mUserInteractionBackoffMillis=60000 21:59:57.609 detox[28776] DEBUG: [EXEC_CMD, #9] "/Users/johnny/Library/Android/sdk/build-tools/33.0.0/aapt" dump badging "/Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/development/debug/app-development-debug.apk" 21:59:57.624 detox[28776] TRACE: [EXEC_SUCCESS, #9] package: name='com.myapp.app' versionCode='2790' versionName='3.63.0' platformBuildVersionName='12' platformBuildVersionCode='31' compileSdkVersion='31' compileSdkVersionCodename='12' sdkVersion:'21' targetSdkVersion:'31' uses-permission: name='android.permission.CAMERA' uses-permission: name='android.permission.INTERNET' uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS' uses-permission: name='android.permission.READ_EXTERNAL_STORAGE' uses-permission: name='android.permission.RECORD_AUDIO' uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW' uses-permission: name='android.permission.VIBRATE' uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE' uses-permission: name='android.permission.ACCESS_NETWORK_STATE' uses-permission: name='android.permission.WAKE_LOCK' uses-permission: name='android.permission.NFC' uses-permission: name='android.permission.ACCESS_WIFI_STATE' uses-permission: name='com.myapp.app.permission.C2D_MESSAGE' uses-permission: name='android.permission.POST_NOTIFICATIONS' uses-permission: name='com.google.android.c2dm.permission.RECEIVE' uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED' uses-permission: name='com.sec.android.provider.badge.permission.READ' uses-permission: name='com.sec.android.provider.badge.permission.WRITE' uses-permission: name='com.htc.launcher.permission.READ_SETTINGS' uses-permission: name='com.htc.launcher.permission.UPDATE_SHORTCUT' uses-permission: name='com.sonyericsson.home.permission.BROADCAST_BADGE' uses-permission: name='com.sonymobile.home.permission.PROVIDER_INSERT_BADGE' uses-permission: name='com.anddoes.launcher.permission.UPDATE_COUNT' uses-permission: name='com.majeur.launcher.permission.UPDATE_BADGE' uses-permission: name='com.huawei.android.launcher.permission.CHANGE_BADGE' uses-permission: name='com.huawei.android.launcher.permission.READ_SETTINGS' uses-permission: name='com.huawei.android.launcher.permission.WRITE_SETTINGS' uses-permission: name='android.permission.READ_APP_BADGE' uses-permission: name='com.oppo.launcher.permission.READ_SETTINGS' uses-permission: name='com.oppo.launcher.permission.WRITE_SETTINGS' uses-permission: name='me.everything.badger.permission.BADGE_COUNT_READ' uses-permission: name='me.everything.badger.permission.BADGE_COUNT_WRITE' uses-permission: name='android.permission.FOREGROUND_SERVICE' uses-permission: name='com.google.android.gms.permission.AD_ID' uses-permission: name='com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE' application-label:'App Debug' application-label-af:'App Debug' application-label-am:'App Debug' application-label-ar:'App Debug' application-label-as:'App Debug' application-label-az:'App Debug' application-label-be:'App Debug' application-label-bg:'App Debug' application-label-bn:'App Debug' application-label-bs:'App Debug' application-label-ca:'App Debug' application-label-cs:'App Debug' application-label-da:'App Debug' application-label-de:'App Debug' application-label-de-FO:'App Debug' application-label-el:'App Debug' application-label-en-AU:'App Debug' application-label-en-CA:'App Debug' application-label-en-GB:'App Debug' application-label-en-IN:'App Debug' application-label-en-XC:'App Debug' application-label-es:'App Debug' application-label-es-419:'App Debug' application-label-es-GT:'App Debug' application-label-es-US:'App Debug' application-label-et:'App Debug' application-label-eu:'App Debug' application-label-fa:'App Debug' application-label-fi:'App Debug' application-label-fr:'App Debug' application-label-fr-CA:'App Debug' application-label-gl:'App Debug' application-label-gu:'App Debug' application-label-he:'App Debug' application-label-hi:'App Debug' application-label-hr:'App Debug' application-label-hu:'App Debug' application-label-hy:'App Debug' application-label-id:'App Debug' application-label-in:'App Debug' application-label-is:'App Debug' application-label-it:'App Debug' application-label-iw:'App Debug' application-label-ja:'App Debug' application-label-ka:'App Debug' application-label-kk:'App Debug' application-label-km:'App Debug' application-label-kn:'App Debug' application-label-ko:'App Debug' application-label-ky:'App Debug' application-label-lo:'App Debug' application-label-lt:'App Debug' application-label-lv:'App Debug' application-label-mk:'App Debug' application-label-ml:'App Debug' application-label-mn:'App Debug' application-label-mr:'App Debug' application-label-ms:'App Debug' application-label-my:'App Debug' application-label-nb:'App Debug' application-label-ne:'App Debug' application-label-nl:'App Debug' application-label-or:'App Debug' application-label-pa:'App Debug' application-label-pl:'App Debug' application-label-pt:'App Debug' application-label-pt-BR:'App Debug' application-label-pt-PT:'App Debug' application-label-ro:'App Debug' application-label-ru:'App Debug' application-label-ru-RU:'App Debug' application-label-si:'App Debug' application-label-sk:'App Debug' application-label-sl:'App Debug' application-label-sq:'App Debug' application-label-sr:'App Debug' application-label-sr-Latn:'App Debug' application-label-sv:'App Debug' application-label-sw:'App Debug' application-label-ta:'App Debug' application-label-te:'App Debug' application-label-th:'App Debug' application-label-tl:'App Debug' application-label-tr:'App Debug' application-label-uk:'App Debug' application-label-ur:'App Debug' application-label-uz:'App Debug' application-label-vi:'App Debug' application-label-zh:'App Debug' application-label-zh-CN:'App Debug' application-label-zh-HK:'App Debug' application-label-zh-TW:'App Debug' application-label-zu:'App Debug' application-icon-120:'res/mipmap-mdpi-v4/ic_launcher.png' application-icon-160:'res/mipmap-mdpi-v4/ic_launcher.png' application-icon-240:'res/mipmap-hdpi-v4/ic_launcher.png' application-icon-320:'res/mipmap-xhdpi-v4/ic_launcher.png' application-icon-480:'res/mipmap-xxhdpi-v4/ic_launcher.png' application-icon-640:'res/mipmap-xxxhdpi-v4/ic_launcher.png' application-icon-65534:'res/mipmap-mdpi-v4/ic_launcher.png' application: label='App Debug' icon='res/mipmap-mdpi-v4/ic_launcher.png' application-debuggable launchable-activity: name='com.myapp.app.MainActivity' label='App Debug' icon='' uses-library-not-required:'androidx.camera.extensions.impl' feature-group: label='' uses-feature-not-required: name='android.hardware.screen.landscape' uses-feature-not-required: name='android.hardware.screen.portrait' uses-feature: name='android.hardware.camera' uses-implied-feature: name='android.hardware.camera' reason='requested android.permission.CAMERA permission' uses-feature: name='android.hardware.faketouch' uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps' uses-feature: name='android.hardware.microphone' uses-implied-feature: name='android.hardware.microphone' reason='requested android.permission.RECORD_AUDIO permission' uses-feature: name='android.hardware.wifi' uses-implied-feature: name='android.hardware.wifi' reason='requested android.permission.ACCESS_WIFI_STATE permission' main other-activities other-receivers other-services supports-screens: 'small' 'normal' 'large' 'xlarge' supports-any-density: 'true' locales: '--_--' 'af' 'am' 'ar' 'as' 'az' 'be' 'bg' 'bn' 'bs' 'ca' 'cs' 'da' 'de' 'de-FO' 'el' 'en-AU' 'en-CA' 'en-GB' 'en-IN' 'en-XC' 'es' 'es-419' 'es-GT' 'es-US' 'et' 'eu' 'fa' 'fi' 'fr' 'fr-CA' 'gl' 'gu' 'he' 'hi' 'hr' 'hu' 'hy' 'id' 'in' 'is' 'it' 'iw' 'ja' 'ka' 'kk' 'km' 'kn' 'ko' 'ky' 'lo' 'lt' 'lv' 'mk' 'ml' 'mn' 'mr' 'ms' 'my' 'nb' 'ne' 'nl' 'or' 'pa' 'pl' 'pt' 'pt-BR' 'pt-PT' 'ro' 'ru' 'ru-RU' 'si' 'sk' 'sl' 'sq' 'sr' 'sr-Latn' 'sv' 'sw' 'ta' 'te' 'th' 'tl' 'tr' 'uk' 'ur' 'uz' 'vi' 'zh' 'zh-CN' 'zh-HK' 'zh-TW' 'zu' densities: '120' '160' '240' '320' '480' '640' '65534' native-code: 'arm64-v8a' 'armeabi-v7a' 'x86' 'x86_64' 21:59:57.632 detox[28776] DEBUG: [EXEC_CMD, #10] "/Users/johnny/Library/Android/sdk/build-tools/33.0.0/aapt" dump badging "/Users/johnny/Development/app/js/projects/platform-mobile/e2e/setup/test-butler-app-2.2.1.apk" 21:59:57.647 detox[28776] TRACE: [EXEC_SUCCESS, #10] package: name='com.linkedin.android.testbutler' versionCode='1' versionName='2.2.1' platformBuildVersionName='10' platformBuildVersionCode='29' compileSdkVersion='29' compileSdkVersionCodename='10' sdkVersion:'14' targetSdkVersion:'29' uses-permission: name='android.permission.SET_ACTIVITY_WATCHER' uses-permission: name='android.permission.GRANT_REVOKE_PERMISSIONS' uses-permission: name='android.permission.SET_ANIMATION_SCALE' uses-permission: name='android.permission.CHANGE_CONFIGURATION' uses-permission: name='android.permission.WRITE_SECURE_SETTINGS' uses-permission: name='android.permission.DISABLE_KEYGUARD' uses-permission: name='android.permission.WAKE_LOCK' uses-permission: name='android.permission.ACCESS_WIFI_STATE' uses-permission: name='android.permission.CHANGE_WIFI_STATE' uses-permission: name='android.permission.WRITE_SETTINGS' application-label:'Test Butler' application: label='Test Butler' icon='' feature-group: label='' uses-feature: name='android.hardware.faketouch' uses-implied-feature: name='android.hardware.faketouch' reason='default feature for all apps' uses-feature: name='android.hardware.wifi' uses-implied-feature: name='android.hardware.wifi' reason='requested android.permission.ACCESS_WIFI_STATE permission, and requested android.permission.CHANGE_WIFI_STATE permission' provides-component:'accessibility' other-services supports-screens: 'small' 'normal' 'large' 'xlarge' supports-any-density: 'true' locales: '--_--' densities: '160' 21:59:57.647 detox[28776] DEBUG: [EXEC_CMD, #11] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "pm list packages com.linkedin.android.testbutler" 21:59:57.676 detox[28776] TRACE: [EXEC_SUCCESS, #11] package:com.linkedin.android.testbutler 21:59:57.677 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:57.677 detox[28776] DEBUG: [EXEC_CMD, #12] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "am force-stop com.myapp.app" 21:59:57.714 detox[28776] TRACE: [EXEC_SUCCESS, #12] 21:59:57.715 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:57.715 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:57.715 detox[28776] DEBUG: [EXEC_CMD, #13] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "pm list packages com.myapp.app" 21:59:57.761 detox[28776] TRACE: [EXEC_SUCCESS, #13] package:com.myapp.app package:com.myapp.app.test 21:59:57.761 detox[28776] DEBUG: [EXEC_CMD, #14] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 uninstall com.myapp.app 21:59:57.834 detox[28776] TRACE: [EXEC_SUCCESS, #14] Success 21:59:57.835 detox[28776] DEBUG: [EXEC_CMD, #15] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "pm list packages com.myapp.app.test" 21:59:57.871 detox[28776] TRACE: [EXEC_SUCCESS, #15] package:com.myapp.app.test 21:59:57.872 detox[28776] DEBUG: [EXEC_CMD, #16] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 uninstall com.myapp.app.test 21:59:57.930 detox[28776] TRACE: [EXEC_SUCCESS, #16] Success 21:59:57.931 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:57.931 detox[28776] DEBUG: [EXEC_CMD, #17] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "am force-stop com.myapp.app" 21:59:57.976 detox[28776] TRACE: [EXEC_SUCCESS, #17] 21:59:57.976 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:57.977 detox[28776] DEBUG: [EXEC_CMD, #18] "/Users/johnny/Library/Android/sdk/build-tools/33.0.0/aapt" dump xmlstrings "/Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/development/debug/app-development-debug.apk" AndroidManifest.xml 21:59:57.994 detox[28776] TRACE: [EXEC_SUCCESS, #18] String pool of 346 unique UTF-16 non-sorted strings, 346 entries and 0 styles using 28556 bytes: String #0: theme String #1: label String #2: icon String #3: name String #4: permission String #5: protectionLevel String #6: enabled String #7: debuggable String #8: exported String #9: process String #10: taskAffinity String #11: stateNotNeeded String #12: excludeFromRecents String #13: authorities String #14: initOrder String #15: grantUriPermissions String #16: priority String #17: launchMode String #18: screenOrientation String #19: configChanges String #20: value String #21: resource String #22: mimeType String #23: scheme String #24: host String #25: pathPattern String #26: minSdkVersion String #27: versionCode String #28: versionName String #29: windowSoftInputMode String #30: noHistory String #31: targetSdkVersion String #32: allowBackup String #33: required String #34: hardwareAccelerated String #35: stopWithTask String #36: usesCleartextTraffic String #37: autoVerify String #38: directBootAware String #39: roundIcon String #40: visibleToInstantApps String #41: compileSdkVersion String #42: compileSdkVersionCodename String #43: appComponentFactory String #44: String #45: */* String #46: /.* String #47: 12 String #48: 3.57.0 String #49: 3.63.0 String #50: 7.4.0 String #51: :playcore_missing_splits_activity String #52: ALWAYS String #53: GlideModule String #54: action String #55: activity String #56: app String #57: app-alternate.app.link String #58: app-alternate.test-app.link String #59: app.app.link String #60: app.test-app.link String #61: android String #62: android.hardware.screen.landscape String #63: android.hardware.screen.portrait String #64: android.intent.action.ACTION_POWER_CONNECTED String #65: android.intent.action.ACTION_POWER_DISCONNECTED String #66: android.intent.action.BATTERY_LOW String #67: android.intent.action.BATTERY_OKAY String #68: android.intent.action.BOOT_COMPLETED String #69: android.intent.action.DEVICE_STORAGE_LOW String #70: android.intent.action.DEVICE_STORAGE_OK String #71: android.intent.action.GET_CONTENT String #72: android.intent.action.MAIN String #73: android.intent.action.MY_PACKAGE_REPLACED String #74: android.intent.action.OPEN_DOCUMENT_TREE String #75: android.intent.action.QUICKBOOT_POWERON String #76: android.intent.action.TIMEZONE_CHANGED String #77: android.intent.action.TIME_SET String #78: android.intent.action.VIEW String #79: android.intent.category.BROWSABLE String #80: android.intent.category.DEFAULT String #81: android.intent.category.LAUNCHER String #82: android.intent.category.OPENABLE String #83: android.media.action.ACTION_VIDEO_CAPTURE String #84: android.media.action.IMAGE_CAPTURE String #85: android.net.conn.CONNECTIVITY_CHANGE String #86: android.nfc.action.NDEF_DISCOVERED String #87: android.permission.ACCESS_NETWORK_STATE String #88: android.permission.ACCESS_WIFI_STATE String #89: android.permission.BIND_JOB_SERVICE String #90: android.permission.CAMERA String #91: android.permission.DUMP String #92: android.permission.FOREGROUND_SERVICE String #93: android.permission.INTERNET String #94: android.permission.MODIFY_AUDIO_SETTINGS String #95: android.permission.NFC String #96: android.permission.POST_NOTIFICATIONS String #97: android.permission.READ_APP_BADGE String #98: android.permission.READ_EXTERNAL_STORAGE String #99: android.permission.RECEIVE_BOOT_COMPLETED String #100: android.permission.RECORD_AUDIO String #101: android.permission.SYSTEM_ALERT_WINDOW String #102: android.permission.VIBRATE String #103: android.permission.WAKE_LOCK String #104: android.permission.WRITE_EXTERNAL_STORAGE String #105: android.support.FILE_PROVIDER_PATHS String #106: androidx.camera.camera2.Camera2Config$DefaultProvider String #107: androidx.camera.core.impl.MetadataHolderService String #108: androidx.camera.core.impl.MetadataHolderService.DEFAULT_CONFIG_PROVIDER String #109: androidx.camera.extensions.action.VENDOR_ACTION String #110: androidx.camera.extensions.impl String #111: androidx.compose.ui.tooling.PreviewActivity String #112: androidx.core.app.CoreComponentFactory String #113: androidx.emoji2.text.EmojiCompatInitializer String #114: androidx.lifecycle.ProcessLifecycleInitializer String #115: androidx.profileinstaller.ProfileInstallReceiver String #116: androidx.profileinstaller.ProfileInstallerInitializer String #117: androidx.profileinstaller.action.INSTALL_PROFILE String #118: androidx.room.MultiInstanceInvalidationService String #119: androidx.startup String #120: androidx.startup.InitializationProvider String #121: androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity String #122: androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity String #123: androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity String #124: androidx.work.WorkManagerInitializer String #125: androidx.work.diagnostics.REQUEST_DIAGNOSTICS String #126: androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryChargingProxy String #127: androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryNotLowProxy String #128: androidx.work.impl.background.systemalarm.ConstraintProxy$NetworkStateProxy String #129: androidx.work.impl.background.systemalarm.ConstraintProxy$StorageNotLowProxy String #130: androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver String #131: androidx.work.impl.background.systemalarm.RescheduleReceiver String #132: androidx.work.impl.background.systemalarm.SystemAlarmService String #133: androidx.work.impl.background.systemalarm.UpdateProxies String #134: androidx.work.impl.background.systemjob.SystemJobService String #135: androidx.work.impl.diagnostics.DiagnosticsReceiver String #136: androidx.work.impl.foreground.SystemForegroundService String #137: androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver String #138: app.app.xyz String #139: app.myapp.com String #140: app_data_collection_default_enabled String #141: application String #142: backend:com.google.android.datatransport.cct.CctBackendFactory String #143: category String #144: cct String #145: cl.json.RNShareFileProvider String #146: com.anddoes.launcher.permission.UPDATE_COUNT String #147: com.bumptech.glide.integration.okhttp3.OkHttpGlideModule String #148: com.canhub.cropper.CropFileProvider String #149: com.canhub.cropper.CropImageActivity String #150: com.facebook.katana String #151: com.facebook.react.devsupport.DevSettingsActivity String #152: com.google.android.c2dm.intent.RECEIVE String #153: com.google.android.c2dm.permission.RECEIVE String #154: com.google.android.c2dm.permission.SEND String #155: com.google.android.datatransport.runtime.backends.TransportBackendDiscovery String #156: com.google.android.datatransport.runtime.scheduling.jobscheduling.AlarmManagerSchedulerBroadcastReceiver String #157: com.google.android.datatransport.runtime.scheduling.jobscheduling.JobInfoSchedulerService String #158: com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE String #159: com.google.android.gms.auth.api.signin.RevocationBoundService String #160: com.google.android.gms.auth.api.signin.internal.SignInHubActivity String #161: com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION String #162: com.google.android.gms.common.api.GoogleApiActivity String #163: com.google.android.gms.measurement.AppMeasurementJobService String #164: com.google.android.gms.measurement.AppMeasurementReceiver String #165: com.google.android.gms.measurement.AppMeasurementService String #166: com.google.android.gms.permission.AD_ID String #167: com.google.android.gms.version String #168: com.google.android.play.core.assetpacks.AssetPackExtractionService String #169: com.google.android.play.core.common.PlayCoreDialogWrapperActivity String #170: com.google.android.play.core.missingsplits.PlayCoreMissingSplitsActivity String #171: com.google.firebase.INSTANCE_ID_EVENT String #172: com.google.firebase.MESSAGING_EVENT String #173: com.google.firebase.components.ComponentDiscoveryService String #174: com.google.firebase.components.ComponentRegistrar String #175: com.google.firebase.components:com.google.firebase.abt.component.AbtRegistrar String #176: com.google.firebase.components:com.google.firebase.analytics.connector.internal.AnalyticsConnectorRegistrar String #177: com.google.firebase.components:com.google.firebase.datatransport.TransportRegistrar String #178: com.google.firebase.components:com.google.firebase.inappmessaging.FirebaseInAppMessagingRegistrar String #179: com.google.firebase.components:com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplayRegistrar String #180: com.google.firebase.components:com.google.firebase.installations.FirebaseInstallationsRegistrar String #181: com.google.firebase.components:com.google.firebase.messaging.FirebaseMessagingRegistrar String #182: com.google.firebase.components:com.google.firebase.perf.FirebasePerfRegistrar String #183: com.google.firebase.components:com.google.firebase.remoteconfig.RemoteConfigRegistrar String #184: com.google.firebase.components:com.google.mlkit.common.internal.CommonComponentRegistrar String #185: com.google.firebase.components:com.google.mlkit.vision.barcode.internal.BarcodeRegistrar String #186: com.google.firebase.components:com.google.mlkit.vision.common.internal.VisionCommonRegistrar String #187: com.google.firebase.components:com.google.mlkit.vision.face.internal.FaceRegistrar String #188: com.google.firebase.components:com.google.mlkit.vision.text.internal.TextRegistrar String #189: com.google.firebase.components:io.invertase.firebase.app.ReactNativeFirebaseAppRegistrar String #190: com.google.firebase.iid.FirebaseInstanceIdReceiver String #191: com.google.firebase.messaging.FirebaseMessagingService String #192: com.google.firebase.perf.provider.FirebasePerfProvider String #193: com.google.firebase.provider.FirebaseInitProvider String #194: com.google.mlkit.common.internal.MlKitComponentDiscoveryService String #195: com.google.mlkit.common.internal.MlKitInitProvider String #196: com.google.mlkit.vision.DEPENDENCIES String #197: com.htc.launcher.permission.READ_SETTINGS String #198: com.htc.launcher.permission.UPDATE_SHORTCUT String #199: com.huawei.android.launcher.permission.CHANGE_BADGE String #200: com.huawei.android.launcher.permission.READ_SETTINGS String #201: com.huawei.android.launcher.permission.WRITE_SETTINGS String #202: com.huawei.push.action.MESSAGING_EVENT String #203: com.imagepicker.ImagePickerProvider String #204: com.instagram.android String #205: com.intercom.input.gallery.GalleryInputFullScreenActivity String #206: com.intercom.input.gallery.GalleryLightBoxActivity String #207: com.iterable.iterableapi.IterableFirebaseMessagingService String #208: com.iterable.iterableapi.IterablePushActionReceiver String #209: com.iterable.iterableapi.IterableTrampolineActivity String #210: com.iterable.push.ACTION_PUSH_ACTION String #211: com.majeur.launcher.permission.UPDATE_BADGE String #212: com.onesignal.BootUpReceiver String #213: com.onesignal.FCMBroadcastReceiver String #214: com.onesignal.FCMIntentJobService String #215: com.onesignal.FCMIntentService String #216: com.onesignal.HmsMessageServiceOneSignal String #217: com.onesignal.NotificationDismissReceiver String #218: com.onesignal.NotificationOpenedActivityHMS String #219: com.onesignal.NotificationOpenedReceiver String #220: com.onesignal.NotificationOpenedReceiverAndroid22AndOlder String #221: com.onesignal.PermissionsActivity String #222: com.onesignal.SyncJobService String #223: com.onesignal.SyncService String #224: com.onesignal.UpgradeReceiver String #225: com.myapp.app String #226: com.myapp.app.FileSystemFileProvider String #227: com.myapp.app.ImagePickerFileProvider String #228: com.myapp.app.IntercomInitializeContentProvider String #229: com.myapp.app.MainActivity String #230: com.myapp.app.MainApplication String #231: com.myapp.app.SentryInitProvider String #232: com.myapp.app.SentryPerformanceProvider String #233: com.myapp.app.androidx-startup String #234: com.myapp.app.cropper.fileprovider String #235: com.myapp.app.fileprovider String #236: com.myapp.app.firebaseinitprovider String #237: com.myapp.app.firebaseperfprovider String #238: com.myapp.app.imagepickerprovider String #239: com.myapp.app.mlkitinitprovider String #240: com.myapp.app.permission.C2D_MESSAGE String #241: com.myapp.app.persona.provider String #242: com.myapp.app.reactnativefirebaseappinitprovider String #243: com.myapp.app.rnshare.fileprovider String #244: com.oppo.launcher.permission.READ_SETTINGS String #245: com.oppo.launcher.permission.WRITE_SETTINGS String #246: com.plaid.internal.LinkRedirectActivity String #247: com.plaid.internal.link.LinkActivity String #248: com.plaid.internal.link.TransparentLinkActivity String #249: com.plaid.link.react_native String #250: com.reactnativecommunity.webview.RNCWebViewFileProvider String #251: com.sec.android.provider.badge.permission.READ String #252: com.sec.android.provider.badge.permission.WRITE String #253: com.sonyericsson.home.permission.BROADCAST_BADGE String #254: com.sonymobile.home.permission.PROVIDER_INSERT_BADGE String #255: com.theartofdev.edmodo.cropper.CropImageActivity String #256: com.twitter.android String #257: com.withpersona.sdk2.inquiry.document.DocumentFileProvider String #258: com.withpersona.sdk2.inquiry.internal.InquiryActivity String #259: com.withpersona.sdk2.inquiry.nfc.PASSPORT_NFC String #260: com.withpersona.sdk2.inquiry.nfc.impl.PassportNfcReaderActivity String #261: data String #262: expo-dev-launcher String #263: expo-dev-menu String #264: expo.modules.adapters.react.apploader.RNHeadlessAppLoader String #265: expo.modules.devlauncher.launcher.DevLauncherActivity String #266: expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity String #267: expo.modules.devmenu.DevMenuActivity String #268: expo.modules.filesystem.FileSystemFileProvider String #269: expo.modules.imagepicker.fileprovider.ImagePickerFileProvider String #270: expo.modules.updates.AUTO_SETUP String #271: expo.modules.updates.ENABLED String #272: expo.modules.updates.EXPO_RUNTIME_VERSION String #273: expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH String #274: expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS String #275: expo.modules.updates.EXPO_UPDATE_URL String #276: firebase_analytics_collection_deactivated String #277: firebase_analytics_collection_enabled String #278: firebase_performance_collection_deactivated String #279: firebase_performance_collection_enabled String #280: google_analytics_adid_collection_enabled String #281: google_analytics_automatic_screen_reporting_enabled String #282: google_analytics_default_allow_ad_personalization_signals String #283: google_analytics_ssaid_collection_enabled String #284: host.exp.exponent String #285: http String #286: http://schemas.android.com/apk/res/android String #287: https String #288: https://u.expo.dev/ef4214ab-56a6-4361-8d50-19a954177414 String #289: in_app_messaging_auto_collection_enabled String #290: intent String #291: intent-filter String #292: io.branch.sdk.BranchKey String #293: io.branch.sdk.BranchKey.test String #294: io.intercom.android.sdk.INTERCOM_PUSH_DISMISSED String #295: io.intercom.android.sdk.IntercomInitializeContentProvider String #296: io.intercom.android.sdk.activities.IntercomCarouselActivity String #297: io.intercom.android.sdk.activities.IntercomMessengerActivity String #298: io.intercom.android.sdk.activities.IntercomNoteActivity String #299: io.intercom.android.sdk.activities.IntercomPostActivity String #300: io.intercom.android.sdk.activities.IntercomSheetActivity String #301: io.intercom.android.sdk.activities.IntercomVideoActivity String #302: io.intercom.android.sdk.fcm.IntercomFcmMessengerService String #303: io.intercom.android.sdk.helpcenter.articles.ArticleActivity String #304: io.intercom.android.sdk.helpcenter.collections.IntercomHelpCenterActivity String #305: io.intercom.android.sdk.helpcenter.search.IntercomArticleSearchActivity String #306: io.intercom.android.sdk.lightbox.LightBoxActivity String #307: io.intercom.android.sdk.post.PostActivityV2 String #308: io.intercom.android.sdk.push.IntercomPushBroadcastReceiver String #309: io.intercom.android.sdk.push.IntercomPushTrampolineActivity String #310: io.intercom.android.sdk.survey.ui.IntercomSurveyActivity String #311: io.invertase.firebase.app.ReactNativeFirebaseAppInitProvider String #312: io.sentry.android.core.SentryInitProvider String #313: io.sentry.android.core.SentryPerformanceProvider String #314: io.sentry.auto-init String #315: iterable_notification_icon String #316: key_live_onYuzEr8AG8I3PqLY95lNmicstlIS2Rr String #317: key_test_ldZBtEz0BQ8S5KuOYY1FhogmEDhTO1IR String #318: links.app.xyz String #319: links.myapp.com String #320: mailto String #321: manifest String #322: me.everything.badger.permission.BADGE_COUNT_READ String #323: me.everything.badger.permission.BADGE_COUNT_WRITE String #324: meta-data String #325: net.gotev.uploadservice.UploadService String #326: ocr,face,barcode String #327: open String #328: org.unimodules.core.AppLoader#react-native-headless String #329: package String #330: permission String #331: plaid String #332: platformBuildVersionCode String #333: platformBuildVersionName String #334: provider String #335: queries String #336: receiver String #337: redirect String #338: service String #339: staging.app.app.xyz String #340: staging.myapp.com String #341: text/plain String #342: uses-feature String #343: uses-library String #344: uses-permission String #345: uses-sdk 21:59:57.995 detox[28776] DEBUG: [EXEC_CMD, #19] "/Users/johnny/Library/Android/sdk/build-tools/33.0.0/aapt" dump xmlstrings "/Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/androidTest/development/debug/app-development-debug-androidTest.apk" AndroidManifest.xml 21:59:58.013 detox[28776] TRACE: [EXEC_SUCCESS, #19] String pool of 41 unique UTF-16 non-sorted strings, 41 entries and 0 styles using 2056 bytes: String #0: theme String #1: label String #2: name String #3: debuggable String #4: exported String #5: targetPackage String #6: handleProfiling String #7: functionalTest String #8: minSdkVersion String #9: targetSdkVersion String #10: compileSdkVersion String #11: compileSdkVersionCodename String #12: 12 String #13: Tests for com.myapp.app String #14: action String #15: activity String #16: android String #17: android.intent.action.MAIN String #18: android.permission.REORDER_TASKS String #19: android.test.runner String #20: androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity String #21: androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity String #22: androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity String #23: androidx.test.orchestrator String #24: androidx.test.services String #25: application String #26: com.google.android.apps.common.testing.services String #27: com.myapp.app String #28: com.myapp.app.DetoxTestAppJUnitRunner String #29: com.myapp.app.test String #30: http://schemas.android.com/apk/res/android String #31: instrumentation String #32: intent-filter String #33: manifest String #34: package String #35: platformBuildVersionCode String #36: platformBuildVersionName String #37: queries String #38: uses-library String #39: uses-permission String #40: uses-sdk 21:59:58.014 detox[28776] DEBUG: [EXEC_CMD, #20] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "rm -fr /data/local/tmp/detox" 21:59:58.064 detox[28776] TRACE: [EXEC_SUCCESS, #20] 21:59:58.064 detox[28776] DEBUG: [EXEC_CMD, #21] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "mkdir -p /data/local/tmp/detox" 21:59:58.146 detox[28776] TRACE: [EXEC_SUCCESS, #21] 21:59:58.146 detox[28776] DEBUG: [EXEC_CMD, #22] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 push "/Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/development/debug/app-development-debug.apk" "/data/local/tmp/detox/Application.apk" 21:59:58.486 detox[28776] TRACE: [EXEC_SUCCESS, #22] /Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/development/debug/app-development-debug.apk: 1 file pushed, 0 skipped. 336.7 MB/s (110926583 bytes in 0.314s) 21:59:58.491 detox[28776] DEBUG: [SPAWN_CMD, #23, cpid=28825] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell pm install -r -g -t /data/local/tmp/detox/Application.apk 21:59:58.818 detox[28776] TRACE: [SPAWN_STDOUT, #23, cpid=28825] Success 21:59:58.820 detox[28776] DEBUG: [SPAWN_END, #23, cpid=28825] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0 21:59:58.820 detox[28776] DEBUG: [EXEC_CMD, #24] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 push "/Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/androidTest/development/debug/app-development-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk" 21:59:58.852 detox[28776] TRACE: [EXEC_SUCCESS, #24] /Users/johnny/Development/app/js/projects/platform-mobile/android/app/build/outputs/apk/androidTest/development/debug/app-development-debug-androidTest.apk: 1 file pushed, 0 skipped. 522.8 MB/s (2428626 bytes in 0.004s) 21:59:58.857 detox[28776] DEBUG: [SPAWN_CMD, #25, cpid=28827] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell pm install -r -g -t /data/local/tmp/detox/Test.apk 21:59:58.915 detox[28776] TRACE: [SPAWN_STDOUT, #25, cpid=28827] Success 21:59:58.919 detox[28776] DEBUG: [SPAWN_END, #25, cpid=28827] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0 21:59:59.091 ROOT_DESCRIBE_BLOCK[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'ROOT_DESCRIBE_BLOCK' }) 21:59:59.092 Smoke:[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'Smoke:' }) 21:59:59.092 detox[28776] INFO: Smoke: is assigned to emulator-18636 (Pixel_5_API_31) 21:59:59.093 detox[28776] INFO: Smoke:: App should start and top-level tabs should be accessible 21:59:59.093 detox[28776] TRACE: [DETOX_BEFORE_EACH] running test: "Smoke: App should start and top-level tabs should be accessible" 21:59:59.093 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTestStart({ title: 'App should start and top-level tabs should be accessible', parent: 'Smoke:', fullName: 'Smoke: App should start and top-level tabs should be accessible', functionCode: 'function () {\n' + ' var self = this,\n' + ' args = arguments;\n' + ' return new Promise(function (resolve, reject) {\n' + ' var gen = fn.apply(self, args);\n' + ' function _next(value) {\n' + ' asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);\n' + ' }\n' + ' function _throw(err) {\n' + ' asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);\n' + ' }\n' + ' _next(undefined);\n' + ' });\n' + ' }', invocations: 1, status: 'running' }) 21:59:59.095 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:59.096 detox[28776] DEBUG: [EXEC_CMD, #26] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "am force-stop com.myapp.app" 21:59:59.126 detox[28776] TRACE: [EXEC_SUCCESS, #26] 21:59:59.126 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app' }) 21:59:59.127 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app', launchArgs: { detoxServer: 'ws://localhost:56527', detoxSessionId: '47a7a0bf-3746-c882-4cf0-06e5ce8aba2e' } }) 21:59:59.127 detox[28776] DEBUG: [EXEC_CMD, #27] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "date +\"%m-%d %T.000\"" 21:59:59.157 detox[28776] TRACE: [EXEC_SUCCESS, #27] 10-25 21:59:59.000 21:59:59.157 detox[28776] DEBUG: [EXEC_CMD, #28] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 reverse tcp:56527 tcp:56527 21:59:59.175 detox[28776] TRACE: [EXEC_SUCCESS, #28] 56527 21:59:59.176 detox[28776] DEBUG: [EXEC_CMD, #29] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "pm list instrumentation" 21:59:59.209 detox[28776] TRACE: [EXEC_SUCCESS, #29] instrumentation:com.myapp.app.test/com.myapp.app.DetoxTestAppJUnitRunner (target=com.myapp.app) 21:59:59.213 detox[28776] DEBUG: [SPAWN_CMD, #30, cpid=28832] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell am instrument -w -r -e detoxServer ws://localhost:56527 -e detoxSessionId 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e -e debug false com.myapp.app.test/com.myapp.app.DetoxTestAppJUnitRunner 21:59:59.716 detox[28776] DEBUG: [EXEC_CMD, #31] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 shell "ps | grep \"com\.myapp\.app$\"" 21:59:59.754 detox[28776] TRACE: [EXEC_SUCCESS, #31] u0_a117 6937 354 15149500 176308 0 0 R com.myapp.app 21:59:59.754 detox[6937] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-18636', bundleId: 'com.myapp.app', launchArgs: { detoxServer: 'ws://localhost:56527', detoxSessionId: '47a7a0bf-3746-c882-4cf0-06e5ce8aba2e' }, pid: 6937 }) 22:00:00.576 detox[28776] TRACE: [SPAWN_STDOUT, #30, cpid=28832] INSTRUMENTATION_STATUS: class=com.myapp.app.DetoxTest INSTRUMENTATION_STATUS: current=1 INSTRUMENTATION_STATUS: id=AndroidJUnitRunner INSTRUMENTATION_STATUS: numtests=1 INSTRUMENTATION_STATUS: stream= com.myapp.app.DetoxTest: INSTRUMENTATION_STATUS: test=runDetoxTests INSTRUMENTATION_STATUS_CODE: 1 22:00:00.789 detox[28776] DEBUG: [WSS_CONNECTION, #56631] registered a new connection. 22:00:00.794 detox[28776] TRACE: [WSS_GET_FROM, #56631] {"messageId":0,"type":"login","params":{"role":"app","sessionId":"47a7a0bf-3746-c882-4cf0-06e5ce8aba2e"}} 22:00:00.794 detox[28776] TRACE: [WSS_SEND_TO, #app] {"messageId":0,"type":"loginSuccess","params":{"testerConnected":true,"appConnected":true}} 22:00:00.794 detox[28776] TRACE: [SESSION_JOINED] app joined session 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e 22:00:00.794 detox[28776] TRACE: [WSS_SEND_TO, #tester] {"type":"appConnected"} 22:00:00.798 detox[28776] TRACE: [WS_MESSAGE] {"type":"appConnected"} 22:00:00.799 detox[28776] TRACE: [WS_SEND] {"type":"isReady","params":{},"messageId":-1000} 22:00:00.799 detox[28776] TRACE: [WSS_GET_FROM, #tester] {"type":"isReady","params":{},"messageId":-1000} 22:00:00.799 detox[28776] TRACE: [WSS_SEND_TO, #app] {"type":"isReady","params":{},"messageId":-1000} 22:00:01.302 detox[28776] TRACE: [WS_SEND] {"type":"currentStatus","params":{},"messageId":1} 22:00:01.304 detox[28776] TRACE: [WSS_GET_FROM, #tester] {"type":"currentStatus","params":{},"messageId":1} 22:00:01.305 detox[28776] TRACE: [WSS_SEND_TO, #app] {"type":"currentStatus","params":{},"messageId":1} 22:00:06.305 detox[28776] DEBUG: [APP_STATUS] Failed to execute the current status query. 22:00:09.098 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTestFnFailure({ error: 'Exceeded timeout of 10000 ms for a test.\n' + 'Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.' }) 22:00:09.102 detox[28776] TRACE: [DETOX_AFTER_EACH] failed test: "Smoke: App should start and top-level tabs should be accessible" 22:00:09.110 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTestDone({ title: 'App should start and top-level tabs should be accessible', parent: 'Smoke:', fullName: 'Smoke: App should start and top-level tabs should be accessible', functionCode: 'function () {\n' + ' var self = this,\n' + ' args = arguments;\n' + ' return new Promise(function (resolve, reject) {\n' + ' var gen = fn.apply(self, args);\n' + ' function _next(value) {\n' + ' asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);\n' + ' }\n' + ' function _throw(err) {\n' + ' asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);\n' + ' }\n' + ' _next(undefined);\n' + ' });\n' + ' }', invocations: 1, status: 'failed', errors: [ [ 'Exceeded timeout of 10000 ms for a test.\n' + 'Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.', ErrorWithStack: thrown: "Exceeded timeout of 10000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." at /Users/johnny/Development/app/js/projects/platform-mobile/e2e/smoke.e2e.ts:6:3 at _dispatchDescribe (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/index.js:67:26) at describe (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/index.js:30:5) at Object. (/Users/johnny/Development/app/js/projects/platform-mobile/e2e/smoke.e2e.ts:5:1) at Runtime._execModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:1299:24) at Runtime._loadModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:898:12) at Runtime.requireModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:746:10) at jestAdapter (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:106:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runTestInternal (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runner/build/runTest.js:380:16) ] ], asyncError: ErrorWithStack: thrown: "Exceeded timeout of 10000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." at /Users/johnny/Development/app/js/projects/platform-mobile/e2e/smoke.e2e.ts:6:3 at _dispatchDescribe (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/index.js:67:26) at describe (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/index.js:30:5) at Object. (/Users/johnny/Development/app/js/projects/platform-mobile/e2e/smoke.e2e.ts:5:1) at Runtime._execModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:1299:24) at Runtime._loadModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:898:12) at Runtime.requireModule (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runtime/build/index.js:746:10) at jestAdapter (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:106:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runTestInternal (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/jest-runner/build/runTest.js:380:16), timedOut: true }) 22:00:09.111 detox[28776] WARN: [PENDING_REQUESTS] The app has not responded to the network requests below: (id = 1) currentStatus: {} (id = -1000) isReady: {} That might be the reason why the test "Smoke: App should start and top-level tabs should be accessible" has timed out. 22:00:09.112 detox[28776] INFO: Smoke:: App should start and top-level tabs should be accessible [FAIL] 22:00:09.113 Smoke:[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'Smoke:' }) 22:00:09.113 ROOT_DESCRIBE_BLOCK[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' }) 22:00:09.130 detox[28776] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeCleanup() 22:00:09.131 detox[28776] TRACE: [WS_SEND] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642} 22:00:09.131 detox[28776] TRACE: [WSS_GET_FROM, #tester] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642} 22:00:09.131 detox[28776] TRACE: [WSS_SEND_TO, #app] {"type":"cleanup","params":{"stopRunner":true},"messageId":-49642} 22:00:14.134 detox[28776] ERROR: [Client.js/ERROR] The pending request #-49642 ("cleanup") has been rejected due to the following error: The tester has not received a response within 5000ms timeout to the message: Cleanup { type: 'cleanup', params: [Object], messageId: -49642 } 22:00:14.140 detox[28776] TRACE: [SESSION_TORN] tester exited session 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e 22:00:14.141 detox[28776] TRACE: [WSS_SEND_TO, #app] {"type":"testerDisconnected","messageId":-1} 22:00:14.141 detox[28832] TRACE: [SPAWN_KILL] sending SIGINT to: /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell am instrument -w -r -e detoxServer ws://localhost:56527 -e detoxSessionId 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e -e debug false com.myapp.app.test/com.myapp.app.DetoxTestAppJUnitRunner 22:00:14.144 detox[28776] DEBUG: [SPAWN_END, #30, cpid=28832] /Users/johnny/Library/Android/sdk/platform-tools/adb -s emulator-18636 shell am instrument -w -r -e detoxServer ws://localhost:56527 -e detoxSessionId 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e -e debug false com.myapp.app.test/com.myapp.app.DetoxTestAppJUnitRunner terminated with SIGINT 22:00:14.145 detox[28776] WARN: at node_modules/detox/src/devices/runtime/drivers/android/AndroidDriver.js:156:17 An error occurred while waiting for the app to become ready. Waiting for disconnection... Error: DetoxRuntimeError: Failed to run application on the device HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process. at MonitoredInstrumentation._getInstrumentationCrashError (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.js:72:12) at MonitoredInstrumentation._rejectPendingCrashPromise (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.js:60:37) at MonitoredInstrumentation._onInstrumentationTerminated (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/detox/src/devices/common/drivers/android/tools/MonitoredInstrumentation.js:55:10) at Instrumentation._onTerminated (/Users/johnny/Development/app/js/projects/platform-mobile/node_modules/detox/src/devices/common/drivers/android/tools/Instrumentation.js:54:18) at processTicksAndRejections (node:internal/process/task_queues:96:5) 22:00:14.146 detox[28776] DEBUG: [EXEC_CMD, #32] "/Users/johnny/Library/Android/sdk/platform-tools/adb" -s emulator-18636 reverse --remove tcp:56527 22:00:14.160 detox[28776] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully FAIL e2e/smoke.e2e.ts (17.137 s) Smoke: ✕ App should start and top-level tabs should be accessible (10007 ms) ● Smoke: › App should start and top-level tabs should be accessible thrown: "Exceeded timeout of 10000 ms for a test. Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test." 4 | 5 | describe('Smoke:', () => { > 6 | it('App should start and top-level tabs should be accessible', async () => { | ^ 7 | await launchExpoApp({ 8 | permissions: { notifications: 'YES', userTracking: 'YES' }, 9 | }); at smoke.e2e.ts:6:3 at Object. (smoke.e2e.ts:5:1) 22:00:14.167 detox[28776] TRACE: [SESSION_TORN] app exited session 47a7a0bf-3746-c882-4cf0-06e5ce8aba2e 22:00:14.182 detox[28776] TRACE: [EXEC_SUCCESS, #32] 22:00:14.248 detox[28775] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --verbose true smoke ```

Device logs

Device logs [device.log](https://github.com/wix/Detox/files/9866866/device.log)

More data, please!

smoke.e2e.ts

import { by, element } from 'detox';

import { dismiss, launchExpoApp, logIn, navTo, waitOn } from './utils/actions';

describe('Smoke:', () => {
  it('App should start and top-level tabs should be accessible', async () => {
    await launchExpoApp({
      permissions: { notifications: 'YES', userTracking: 'YES' },
    });
  });
});

actions.ts

export async function launchExpoApp(config?: Detox.DeviceLaunchAppConfig) {
  await device.launchApp(config);

  // Android test doesn't even get to the rest of the code...
}

Build command maps to: cd android && ENVFILE=.env.development IS_TEST=true ./gradlew assembleDevelopmentDebug assembleDevelopmentDebugAndroidTest -DtestBuildType=debug && cd ..

You can see here that running the test does successfully install and launch the app, but nothing beyond that:

https://user-images.githubusercontent.com/938210/197953218-b77797b5-7612-4c7b-90dc-c36098322556.mov

rmarquois commented 1 year ago

Same for me and I cannot explain why it freezes on await device.launchApp. Yet when I debug it, I see that it fully executed this function.

My apk is built using Expo EAS. It's a local development build and in my Jest setup.ts file configured using setupFilesAfterEnv (more info here), I run expo with --dev-client option and I'm waiting for bundle ready.

I followed the E2E guide for Expo and there is a warning at last step (when using development build) that this might not work properly on Android ^^

I figured out this issue using launchApp with url property.

Full code of my setup.ts file :

import { ChildProcess, exec, spawn } from 'child_process'
import { device } from 'detox'

import { main } from '../package.json'

let client: ChildProcess | null = null

beforeAll(async () => {
  runExpoDevClient()
  await openAppForDebugBuild(process.env.DETOX_CONFIGURATION)
  await waitForExpoDevClient()
})

afterAll(async () => {
  // kill expo dev server (default port is 8081)
  // not found for now a better way to do this ^^
  exec('kill -9 $(lsof -t -i:8081)')
})

const openAppForDebugBuild = async platform => {
  // Android and iOS don't work the same
  // for Android, we have to launch app in one step using url parameter
  // for iOS, we have to do this in two steps : launch app then open url
  if (platform === 'ios') {
    await device.launchApp({
      newInstance: true,
    })
    await device.openURL({
      url: getDeepLinkUrl(getDevLauncherPackagerUrl(platform)),
    })
  } else {
    await device.launchApp({
      newInstance: true,
      url: getDeepLinkUrl(getDevLauncherPackagerUrl(platform)),
    })
  }
}

// /!\ you have to update "your-app" with your app scheme
const getDeepLinkUrl = url =>
  `exp+your-app://expo-development-client/?url=${encodeURIComponent(
    url
  )}`

const getDevLauncherPackagerUrl = platform => {
  // host is different for Android emulator
  const host = platform === 'ios' ? 'localhost' : '10.0.2.2'
  return `http://${host}:8081/${main}.bundle?platform=${platform}&dev=true&minify=false&disableOnboarding=1`
}

const runExpoDevClient = () => {
  client = spawn('expo', ['start', '--dev-client'])
}

// I check with a regexp end of bundling
const waitForExpoDevClient = () => {
  return new Promise((resolve, reject) => {
    client?.stdout?.on('data', data => {
      if (data && /(ios|android) Bundling complete/gi.test(`${data}`)) {
        resolve(null)
      }
    })
    client?.stderr?.on('data', data => {
      reject(`stderr: ${data}`)
    })
    client?.on('close', code => {
      reject(`child process exited with code ${code}`)
    })
  })
}

Finally, I think it's because of Expo launcher screen. It runs before our app and Detox is lost.

Good luck :)

owens-ben commented 1 year ago

+1 having this issue, but i dont think we use expo...

stale[bot] commented 1 year 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 repository, read this discussion.

stale[bot] commented 1 year ago

The issue has been closed for inactivity.