Detox: `viewElement.scroll` slows down on repeated calls when reusing the Detox element
Description
viewElement.scroll
slows down on repeated calls when reusing the Detox element.
- 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
- I have followed the instructions under Lower-level Idling Resources Debug and am providing the log below: ios.log
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
- I have run my tests using the
--loglevel trace
argument and am providing the verbose log below: ios-trace.log
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (8 by maintainers)
The new system has not been deployed yet. You can follow the status here: https://github.com/wix/Detox/pull/2098
Let’s see how it performs in the new system.