Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Scroll and Swipe doesn't work after using the adb input command to simulate back. #788

Closed
abdulkhaliquem9 opened this issue Jun 14, 2018 · 2 comments

Comments

@abdulkhaliquem9
Copy link

abdulkhaliquem9 commented Jun 14, 2018

Scroll and Swipe are not working, after I have called the ADB command input to press the device back button on android emulator, It was working before adding these lines

const spawn = require('child-process-promise').spawn; return spawn('sh', ['-c', adb -s ${device._deviceId} shell input "keyevent 4"]);

I was using tapAtPoint() to press the react-native-navigation 's NavigationBar's BACK button. As I found that I can use ADB input commands, I replaced the code with that. But it stopped other actions to work.

Detox, Node, Device, Xcode and macOS Versions

  • Detox: "7.3.2",
  • React Native: "0.51.1",
  • Node:8.11.1
  • Device: emulator Nexus_5X_API27
  • Xcode:
  • macOS: linux mint

Device and verbose Detox logs

test.espresso.action.GeneralClickAction@2d48725]
06-14 16:53:11.105 2547 2547 I ViewInteraction: Performing 'single click' action on view with tag value: is "Water Label"
06-14 16:53:11.121 2547 2547 I Detox : UIManagerModule is busy.
06-14 16:53:11.133 2547 2547 I Detox : mqt_js looper is busy
06-14 16:53:11.307 2547 2547 I Detox : JS Timer is busy
06-14 16:53:11.354 2547 2547 D ReactNative: ReactInstanceManager.attachRootViewToInstance()
06-14 16:53:11.355 2547 3361 I ReactNativeJS: Running application "RH.GeneralTrackers" with appParams: {"initialProps":{"screenInstanceID":"screenInstanceID18","navigatorID":"navigatorID3_nav","navigatorEventID":"screenInstanceID18_events"},"rootTag":191}. DEV === true, development-level warning are ON, performance optimizations are OFF
06-14 16:53:11.358 2547 3361 I ReactNativeJS: 'getConfig: ', 'pin_configured', { binary: '0.9.90',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: js: 'v0.9.90-2',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: isDoctorAdded: true,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: pedometerAuthorize: false,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: dailyNotification: true,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: invokeDailyQ: false,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: loggedin: '+918801234618',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: basicprofile: true,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: cognitoId: 'us-east-1:7e0de7c2-fe73-419f-93c4-01bc60b9bbc2',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: authId: 'cb550ad4-786c-4305-8b38-591d7b9380e1',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: authKey: 'acmmbHREl7E09Yse+KWxb6YbUp23jKYdMxuq2dkl+xs=',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: authSecret: 'zoX9P1g/TVH5BfHMHDiKOuw8EAJEAqckqNhHUIml+8Y=',
06-14 16:53:11.358 2547 3361 I ReactNativeJS: pin_configured: true,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: dashboardLoaded: true,
06-14 16:53:11.358 2547 3361 I ReactNativeJS: device_token: 'cjKPsZKWjCY:APA91bFxkpklFv_OLeS1igi0ePGyPx7-PoY3F5tvicbAx1LexzT4cu-22-e1YLQAS2NE_fULvi7Y6IaTzjMZoYc14CdM1il-7tEVqITGXA1vQ7A7Nm3KZk-kO1niSOdeCa0sNUKaVLBL' }
06-14 16:53:11.498 1586 1603 E BatteryExternalStatsWorker: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs[]=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
06-14 16:53:11.499 1586 1599 E memtrack: Couldn't load memtrack module
06-14 16:53:11.499 1586 1599 W android.os.Debug: failed to get memory consumption info: -1
06-14 16:53:11.541 1586 1599 E memtrack: Couldn't load memtrack module
06-14 16:53:11.541 1586 1599 W android.os.Debug: failed to get memory consumption info: -1
06-14 16:53:11.611 2547 2547 I Detox : JS Timer is busy
06-14 16:53:11.613 2547 2547 I Detox : JS Timer is busy
06-14 16:53:11.832 2547 2778 D DetoxManager: Invocation result: android.support.test.espresso.ViewInteraction@21cef1c
06-14 16:53:11.835 2547 2778 I WebSocketClient: At sendAction
06-14 16:53:11.839 2547 2778 D WebSocketClient: Detox Action Sent: invokeResult
06-14 16:53:11.850 2547 3057 I WebSocketClient: At onMessage
06-14 16:53:11.850 2547 3057 I WebSocketClient: At receiveAction
06-14 16:53:11.851 2547 3057 D WebSocketClient: Detox Action Received: invoke
06-14 16:53:11.852 2547 3057 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"waitForAssertMatcher","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForAnd","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["scoreView"]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}},{"type":"Double","value":1}]}
06-14 16:53:11.854 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [scoreView]
06-14 16:53:11.854 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForSufficientlyVisible, []
06-14 16:53:11.854 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForAnd, [with tag value: is "scoreView", at least 75 percent of the view's area is displayed to the user.]
06-14 16:53:11.854 2547 2778 D Detox : class android.support.test.espresso.Espresso, onView, [(with tag value: is "scoreView" and at least 75 percent of the view's area is displayed to the user.)]
06-14 16:53:11.855 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForSufficientlyVisible, []
06-14 16:53:11.856 2547 2778 D Detox : class com.wix.detox.espresso.DetoxAssertion, waitForAssertMatcher, [android.support.test.espresso.ViewInteraction@4265780, at least 75 percent of the view's area is displayed to the user., 1.0]
06-14 16:53:11.860 2547 2547 I ViewInteraction: Checking 'MatchesViewAssertion{viewMatcher=at least 75 percent of the view's area is displayed to the user.}' assertion on view (with tag value: is "scoreView" and at least 75 percent of the view's area is displayed to the user.)
06-14 16:53:11.862 2547 2778 D DetoxManager: Invocation result: null
06-14 16:53:11.862 2547 2778 I WebSocketClient: At sendAction
06-14 16:53:11.863 2547 2778 D WebSocketClient: Detox Action Sent: invokeResult
06-14 16:53:11.868 2547 3057 I WebSocketClient: At onMessage
06-14 16:53:11.868 2547 3057 I WebSocketClient: At receiveAction
06-14 16:53:11.868 2547 3057 D WebSocketClient: Detox Action Received: invoke
06-14 16:53:11.868 2547 3057 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertMatcher","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["scoreView"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]}
06-14 16:53:11.869 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [scoreView]
06-14 16:53:11.869 2547 2778 D Detox : class android.support.test.espresso.Espresso, onView, [with tag value: is "scoreView"]
06-14 16:53:11.870 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForSufficientlyVisible, []
06-14 16:53:11.870 2547 2778 D Detox : class com.wix.detox.espresso.DetoxAssertion, assertMatcher, [android.support.test.espresso.ViewInteraction@f596bac, at least 75 percent of the view's area is displayed to the user.]
06-14 16:53:11.873 2547 2547 I ViewInteraction: Checking 'MatchesViewAssertion{viewMatcher=at least 75 percent of the view's area is displayed to the user.}' assertion on view with tag value: is "scoreView"
06-14 16:53:11.878 2547 2778 D DetoxManager: Invocation result: android.support.test.espresso.ViewInteraction@f596bac
06-14 16:53:11.878 2547 2778 I WebSocketClient: At sendAction
06-14 16:53:11.878 2547 2778 D WebSocketClient: Detox Action Sent: invokeResult
06-14 16:53:12.122 3652 3652 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-14 16:53:12.125 3652 3652 W app_process: Could not reserve sentinel fault page
06-14 16:53:12.180 3652 3652 W app_process: Unexpected CPU variant for X86 using defaults: x86
06-14 16:53:12.182 3652 3652 I app_process: The ClassLoaderContext is a special shared library.
06-14 16:53:12.209 3652 3652 D AndroidRuntime: Calling main entry com.android.commands.input.Input
06-14 16:53:12.209 3652 3652 I Input : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=97908, downTime=97908, deviceId=-1, source=0x101 }
06-14 16:53:12.212 3652 3652 I Input : injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_BACK, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=97908, downTime=97908, deviceId=-1, source=0x101 }
06-14 16:53:12.214 3652 3652 D AndroidRuntime: Shutting down VM
06-14 16:53:12.236 1976 3190 I Dialer : OmtpVvmCarrierCfgHlpr - OmtpEvent:CONFIG_STATUS_SMS_TIME_OUT
06-14 16:53:12.236 1976 1976 I Dialer : RetryPolicy - discarding deferred status: configuration_state=4
06-14 16:53:12.238 2547 3057 I WebSocketClient: At onMessage
06-14 16:53:12.238 2547 3057 I WebSocketClient: At receiveAction
06-14 16:53:12.238 2547 3057 D WebSocketClient: Detox Action Received: invoke
06-14 16:53:12.238 2547 3057 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":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["Sleep Label"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAction"},"method":"scrollInDirection","args":[{"type":"Integer","value":4},{"type":"Double","value":300}]}}]}
06-14 16:53:12.239 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [Sleep Label]
06-14 16:53:12.239 2547 2778 D Detox : class android.support.test.espresso.Espresso, onView, [with tag value: is "Sleep Label"]
06-14 16:53:12.240 1976 1976 I Dialer : VvmTaskExecutor - no more tasks, stopping service if no task are added in 5000 millis
06-14 16:53:12.248 1976 1976 I Dialer : VvmTaskReceiver - task received
06-14 16:53:12.248 1976 1976 I Dialer : VvmTaskReceiver - TaskExecutor already running
06-14 16:53:12.248 1976 1976 I Dialer : Task.createTask - create task:com.android.voicemail.impl.ActivationTask
06-14 16:53:12.249 1976 1976 I Dialer : RetryPolicy - retry #1 for com.android.voicemail.impl.ActivationTask@2ff616b queued, executing in 5000
06-14 16:53:12.249 1976 1976 I Dialer : VvmTaskExecutor - com.android.voicemail.impl.ActivationTask@2ff616b added
06-14 16:53:12.249 1976 1976 I Dialer : VvmTaskExecutor - minimal wait time:5000
06-14 16:53:12.249 1976 1976 I Dialer : VvmTaskExecutor - sleep for 5000 millis
06-14 16:53:12.259 2547 2778 D Detox : class com.wix.detox.espresso.DetoxAction, scrollInDirection, [4, 300.0]
06-14 16:53:12.261 2547 2778 D Detox : class com.wix.detox.espresso.EspressoDetox, perform, [android.support.test.espresso.ViewInteraction@3eb8444, com.wix.detox.espresso.DetoxAction$3@e2c392d]
06-14 16:53:12.342 2547 2547 I ViewInteraction: Performing 'scrollInDirection' action on view with tag value: is "Sleep Label"
06-14 16:53:12.515 2547 2547 D ReactNative: ReactInstanceManager.detachViewFromInstance()
06-14 16:53:12.518 2547 3361 I ReactNativeJS: 'GeneralTracker, getCurrentScreen: ', 'RH.GeneralTrackers'
06-14 16:53:12.519 2547 3361 I ReactNativeJS: 'SecureComponent ', 'RH.DashBoard'
06-14 16:53:12.528 2547 2547 W unknown:ReactNative: Unable to dispatch touch to JS as the catalyst instance has not been attached
06-14 16:53:13.222 2043 2390 W ctxmgr : [AclManager]No 2 for (accnt=account#-517948760#, com.google.android.gms(10012):IndoorOutdoorProducer, vrsn=12685000, 0, 3pPkg = null , 3pMdlId = null , pid = 2043). Was: 3 for 57, account#-517948760#
06-14 16:53:13.355 2547 2778 D DetoxManager: Invocation result: android.support.test.espresso.ViewInteraction@3eb8444
06-14 16:53:13.355 2547 2778 I WebSocketClient: At sendAction
06-14 16:53:13.356 2547 2778 D WebSocketClient: Detox Action Sent: invokeResult
06-14 16:53:13.361 2547 3057 I WebSocketClient: At onMessage
06-14 16:53:13.361 2547 3057 I WebSocketClient: At receiveAction
06-14 16:53:13.361 2547 3057 D WebSocketClient: Detox Action Received: invoke
06-14 16:53:13.361 2547 3057 I DetoxManager: onAction: type: invoke params: {"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAssertion"},"method":"assertMatcher","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["Alcohol Label"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForSufficientlyVisible","args":[]}}]}
06-14 16:53:13.362 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [Alcohol Label]
06-14 16:53:13.362 2547 2778 D Detox : class android.support.test.espresso.Espresso, onView, [with tag value: is "Alcohol Label"]
06-14 16:53:13.363 2547 2778 D Detox : class com.wix.detox.espresso.DetoxMatcher, matcherForSufficientlyVisible, []
06-14 16:53:13.363 2547 2778 D Detox : class com.wix.detox.espresso.DetoxAssertion, assertMatcher, [android.support.test.espresso.ViewInteraction@13ea0b0, at least 75 percent of the view's area is displayed to the user.]
06-14 16:53:13.366 2547 2547 I ViewInteraction: Checking 'MatchesViewAssertion{viewMatcher=at least 75 percent of the view's area is displayed to the user.}' assertion on view with tag value: is "Alcohol Label"
06-14 16:53:13.366 2547 2547 W ResourceType: No package identifier when getting name for resource number 0x00000258
06-14 16:53:13.371 2547 2778 E DetoxManager: Exception
06-14 16:53:13.371 2547 2778 E DetoxManager: java.lang.reflect.InvocationTargetException
06-14 16:53:13.371 2547 2778 E DetoxManager: at java.lang.reflect.Method.invoke(Native Method)
06-14 16:53:13.371 2547 2778 E DetoxManager: at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:345)
06-14 16:53:13.371 2547 2778 E DetoxManager: at org.apache.commons.lang3.reflect.MethodUtils.invokeStaticMethod(MethodUtils.java:308)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.invoke.types.ClassTarget.execute(ClassTarget.java:23)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.invoke.types.Target.invoke(Target.java:59)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:35)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:26)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.invoke.MethodInvocation.invoke(MethodInvocation.java:20)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.detox.DetoxManager$2.run(DetoxManager.java:104)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.os.Handler.handleCallback(Handler.java:790)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.os.Handler.dispatchMessage(Handler.java:99)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.os.Looper.loop(Looper.java:164)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.detox.Detox$1.run(Detox.java:136)
06-14 16:53:13.371 2547 2778 E DetoxManager: at java.lang.Thread.run(Thread.java:764)
06-14 16:53:13.371 2547 2778 E DetoxManager: Caused by: android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'at least 75 percent of the view's area is displayed to the user.' doesn't match the selected view.
06-14 16:53:13.371 2547 2778 E DetoxManager: Expected: at least 75 percent of the view's area is displayed to the user.
06-14 16:53:13.371 2547 2778 E DetoxManager: Got: "ReactTextView{id=600, visibility=VISIBLE, width=152, height=61, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.view.ViewGroup$LayoutParams@e9926fd, tag=Alcohol Label, root-is-layout-requested=false, has-input-connection=false, x=181.0, y=11.0, text=Alcohol, input-type=0, ime-target=false, has-links=false}"
06-14 16:53:13.371 2547 2778 E DetoxManager:
06-14 16:53:13.371 2547 2778 E DetoxManager: at dalvik.system.VMStack.getThreadStackTrace(Native Method)
06-14 16:53:13.371 2547 2778 E DetoxManager: at java.lang.Thread.getStackTrace(Thread.java:1538)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:90)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:52)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.support.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:314)
06-14 16:53:13.371 2547 2778 E DetoxManager: at android.support.test.espresso.ViewInteraction.check(ViewInteraction.java:291)
06-14 16:53:13.371 2547 2778 E DetoxManager: at com.wix.detox.espresso.DetoxAssertion.assertMatcher(DetoxAssertion.java:31)
06-14 16:53:13.371 2547 2778 E DetoxManager: ... 14 more
06-14 16:53:13.371 2547 2778 E DetoxManager: Caused by: junit.framework.AssertionFailedError: 'at least 75 percent of the view's area is displayed to the user.' doesn't match the selected view.

-->

@abdulkhaliquem9 abdulkhaliquem9 changed the title Scroll and Swipe doesn't work after using the adb input command simulate back. Scroll and Swipe doesn't work after using the adb input command to simulate back. Jun 15, 2018
@stale
Copy link

stale bot commented Jul 30, 2018

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.

@stale stale bot added the 🏚 stale label Jul 30, 2018
@stale
Copy link

stale bot commented Aug 6, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Aug 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant