Detox: `viewElement.scroll` slows down on repeated calls when reusing the Detox element

Created on 5 May 2020  路  15Comments  路  Source: wix/Detox

Description

viewElement.scroll slows down on repeated calls when reusing the Detox element.

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

Reproduction

Code with a slow down:

  const scrollView = element(by.id('scrollViewId'));
  while (true) {
    await scrollView.scroll(400, 'down');
    console.log('scrolled');
  }
  // it slow downs for me after 10 or so scrolls

It slows down by introducing a noticeable (more than a few seconds) lag before doing the scroll.

This will work well:

  while (true) {
    await element(by.id('scrollViewId')).scroll(400, 'down');
    console.log('scrolled');
  }
  // no slow downs

The first snippet works well on Android. Please, either fix that or document.

Expected behavior

No scroll slowdowns.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Detox: 16.4.0
  • React Native: 0.61.5
  • Node: 14.1.0
  • Device: MacBook with Catalina 10.15.4
  • Xcode: 11.4.1
  • iOS: 13.4 (emulator)
  • macOS: 10.15.4

Logs

If you are experiencing a timeout in your test

If you are seeing a build problem (e.g. during npm install)

  • [ ] I am providing the npm install log below:

Device and verbose Detox logs

  • [x] I have run my tests using the --loglevel trace argument and am providing the verbose log below: ios-trace.log
triagbug ios

All 15 comments

@rotemmiz Could this be some how "accumulating" more and more stuff as time goes by? Would this be fixed in invoke2?

@yurijmikhalevich Does this reproduce in Android as well?

@LeoNatan no, it seems to be fine on Android.

@yurijmikhalevich Could you please post a trace log, as requested in the template, while reproducing they issue?

@LeoNatan added log of the laggy version to the OP.

Thanks but that鈥檚 not the log I want.

Please provide the --loglevel trace log.

@LeoNatan uploaded the trace log.

We鈥檙e working on a new implementation of actions, which should be merged relatively soon. Let鈥檚 see if this reproduces there.

@LeoNatan great! Thank you! Please, let me know when it will be out so I'll test it.

I also noticed that tap action is much slower on iOS compared to Android. I wonder if it's due to the platform limitations or if there is a way to improve that.

Let's see how it performs in the new system.

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.

@LeoNatan is the new system ready? Should I test it again?

The new system has not been deployed yet. You can follow the status here: https://github.com/wix/Detox/pull/2098

Please test on latest Detox version and report back. Thanks

@LeoNatan the issue is fixed in 17.0.2. And the tests are running faster overall now. Thank you!

Great, thanks!

Was this page helpful?
0 / 5 - 0 ratings