Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

.scrollTo() work too slow on Android #2496

Closed
1 task done
retyui opened this issue Nov 30, 2020 · 9 comments
Closed
1 task done

.scrollTo() work too slow on Android #2496

retyui opened this issue Nov 30, 2020 · 9 comments

Comments

@retyui
Copy link

retyui commented Nov 30, 2020

Describe the bug

I've just added Detox to my App, using a debug build I run a test with scroll to bottom action. And it seems very laggy

  // I tried to diables Synchronization but I didn't see effect
  await device.disableSynchronization(); 
  await elementById(EMOTIONS_INTRO_SCROLL_VIEW).scrollTo('bottom');
  await elementById(EMOTIONS_INTRO_DONE_BUTTON).tap();
  await device.enableSynchronization();

To Reproduce

  • I have tested this issue on the latest Detox release and it still reproduces

Steps to reproduce:

  1. Android + debug build
  2. scrollTo()
  3. See a video below
      <ScrollView testID={EMOTIONS_INTRO_SCROLL_VIEW}>
        <View
          style={{
            height: 400,
            borderWidth: 1,
            borderColor: 'red',
          }}
        />
        <View
          style={{
            height: 400,
            borderWidth: 1,
            borderColor: 'gold',
          }}
        />
        <View
          style={{
            height: 400,
            borderWidth: 1,
            borderColor: 'blue',
          }}
        />
        <View
          style={{
            height: 400,
            borderWidth: 1,
            borderColor: 'green',
          }}
        />
        <View
          style={{
            height: 400,
            borderWidth: 1,
            borderColor: 'pink',
          }}
        />
        <Button
          testID={EMOTIONS_INTRO_DONE_BUTTON}
          title="MyButton"
          onPress={() => {}}
        />
      </ScrollView>

Expected behavior
Scroll action works without laggy

Screenshots

Device and Verbose Detox Logs

11-30 13:00:21.043 20219 20338 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":["EMOTIONS_INTRO_SCROLL_VIEW"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAction"},"method":"scrollToEdge","args":[{"type":"Integer","value":4}]}}]}
11-30 13:00:21.044 20219 20325 D Detox   : class com.wix.detox.espresso.DetoxMatcher, matcherForTestId, [EMOTIONS_INTRO_SCROLL_VIEW]
11-30 13:00:21.044 20219 20325 D Detox   : class androidx.test.espresso.Espresso, onView, [(with tag value: is "EMOTIONS_INTRO_SCROLL_VIEW" and view has effective visibility=VISIBLE)]
11-30 13:00:21.045 20219 20325 D Detox   : class com.wix.detox.espresso.DetoxAction, scrollToEdge, [4]
11-30 13:00:21.045 20219 20325 D Detox   : class com.wix.detox.espresso.EspressoDetox, perform, [androidx.test.espresso.ViewInteraction@125d31a, com.wix.detox.espresso.DetoxAction$2@388fe4b]
11-30 13:00:21.049 20219 20219 I ViewInteraction: Performing 'scrollToEdge' action on view (with tag value: is "EMOTIONS_INTRO_SCROLL_VIEW" and view has effective visibility=VISIBLE)
11-30 13:00:21.050 20219 20219 D DetoxScrollHelper: scroll Point(540, 1791) --> Point(540, 156)
11-30 13:00:21.195  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@570502d)
11-30 13:00:21.195  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@570502d)
11-30 13:00:21.234 20219 20338 I WebSocketClient: At onMessage
11-30 13:00:21.235 20219 20338 I WebSocketClient: At receiveAction
11-30 13:00:21.235 20219 20338 D WebSocketClient: Detox Action Received: currentStatus
11-30 13:00:21.235 20219 20338 I DetoxManager: onAction: type: currentStatus params: {}
11-30 13:00:21.243 20219 20338 I WebSocketClient: At onMessage
11-30 13:00:21.243 20219 20338 I WebSocketClient: At receiveAction
11-30 13:00:21.243 20219 20338 D WebSocketClient: Detox Action Received: currentStatus
11-30 13:00:21.243 20219 20338 I DetoxManager: onAction: type: currentStatus params: {}
11-30 13:00:21.715 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 200 iterations.
11-30 13:00:22.195  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@90e0962)
11-30 13:00:22.195  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@90e0962)
11-30 13:00:22.979 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 400 iterations.
11-30 13:00:23.062  1675  1750 E storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
11-30 13:00:23.196  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@5a20af3)
11-30 13:00:23.197  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@5a20af3)
11-30 13:00:23.709 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 500 iterations.
11-30 13:00:23.858  1547  1637 W audio_hw_generic: Not supplying enough data to HAL, expected position 68379262 , only wrote 68182560
11-30 13:00:24.197  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@faebe3f)
11-30 13:00:24.198  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@faebe3f)
11-30 13:00:25.197  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@f18630c)
11-30 13:00:25.197  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@f18630c)
11-30 13:00:25.240 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 700 iterations.
11-30 13:00:25.551 20219 20219 D DetoxScrollHelper: scroll Point(540, 1791) --> Point(540, 156)
11-30 13:00:26.158 20219 20244 W FA      : No number filter for long property. property: _fot
11-30 13:00:26.196  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@e190d1)
11-30 13:00:26.196  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@e190d1)
11-30 13:00:26.236 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 200 iterations.
11-30 13:00:26.323 20219 20244 W FA      : No number filter for long property. property: _fot
11-30 13:00:26.483 20219 20244 I chatty  : uid=10499(com.sintylapse.therapydiaries.debug) Measurement Wor identical 1 line
11-30 13:00:26.647 20219 20244 W FA      : No number filter for long property. property: _fot
11-30 13:00:26.996 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 300 iterations.
11-30 13:00:27.196  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@295e0c2)
11-30 13:00:27.201  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@295e0c2)
11-30 13:00:27.732 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 400 iterations.
11-30 13:00:28.197  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@c57fed3)
11-30 13:00:28.198  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@c57fed3)
11-30 13:00:28.514 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 500 iterations.
11-30 13:00:29.196  1804  1871 I GnssLocationProvider: WakeLock acquired by sendMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@b4dfa10)
11-30 13:00:29.197  1804  1818 I GnssLocationProvider: WakeLock released by handleMessage(REPORT_SV_STATUS, 0, com.android.server.location.GnssLocationProvider$SvStatusInfo@b4dfa10)
11-30 13:00:29.290 20219 20219 W UiControllerImpl: Waiting for: MOTION_INJECTION_HAS_COMPLETED for 600 iterations.
11-30 13:00:29.401  1804  1818 E memtrack: Couldn't load memtrack module
11-30 13:00:29.401  1804  1818 W android.os.Debug: failed to get memory consumption info: -1
11-30 13:00:30.062 20219 20219 I Detox   : UIManagerModule is busy
11-30 13:00:30.068 20219 20219 D DetoxScrollHelper: scroll Point(540, 1791) --> Point(540, 156)

Environment (please complete the following information):

  • Detox: 17.13.2
  • React Native: 0.63.3
  • Node: 12
  • Device: AOSP emulator
  • OS: Android
  • Test-runner: jest-circus
@stale
Copy link

stale bot commented Dec 30, 2020

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.

@stale stale bot added the 🏚 stale label Dec 30, 2020
@retyui
Copy link
Author

retyui commented Dec 30, 2020

активный

@stale stale bot removed the 🏚 stale label Dec 30, 2020
@stale
Copy link

stale bot commented Jan 29, 2021

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.

@stale stale bot added the 🏚 stale label Jan 29, 2021
@retyui
Copy link
Author

retyui commented Jan 29, 2021

noooo
please stop

@stale stale bot removed the 🏚 stale label Jan 29, 2021
@aleparty
Copy link

aleparty commented Feb 5, 2021

We have the same issue, while on iOS scroll works smooth and fast - it does not do so on Android

@stale
Copy link

stale bot commented Mar 7, 2021

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.

@stale stale bot added 🏚 stale and removed 🏚 stale labels Mar 7, 2021
@d4vidi
Copy link
Collaborator

d4vidi commented Mar 14, 2021

@retyui On Android we've decided to prefer accuracy over smoothness. When the scroll happens too fast, acceleration catches up and the scrolling continues uncontrollably due to a subsequent fling. However, we might allow for a speed factor parameter (slow = default vs. fast). Would that work in your use case?

@KatieSnell-TomTom
Copy link

@d4vidi joining this as I would love to see a speedier scroll on Android emulators!

Also, both the swipe and scrollTo actions are not working on all the scroll views in my app (some work as expected, some do not get scrolled). Do you know how I can figure out what is different and why it is not working"?

@d4vidi
Copy link
Collaborator

d4vidi commented May 31, 2021

@KatieSnell-TomTom please try to follow #2787, if you think it matches your scenarios. If it does, feel free to submit your artifacts and use case details as well, there.

@d4vidi d4vidi changed the title .scrollTo() work to slow on Android .scrollTo() work too slow on Android Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants