-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Android] scroll does not finish before tap occurs #757
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Detox Android does not support RN >=51. Recheck this issue when we announce support for modern RN version |
@lalka-workco, could you please recheck the issue with Detox 9? |
Reopened because thanks to @viktorijasujetaite we now know this happens with detox |
After some investigation work, seems that this isn't really the issue. I'll open one that better describe the actual problem, soon. Closing. |
Description
When using the scroll/scrollTo command before a tap command the tap happens before the scroll is finished which causes the button to be clicked improperly. It appears as if the tap is happening at the same time as the scroll which means it does not trigger the onPress call.
In this scenario the button we want to tap is currently off the screen but we are trying to scroll it into the view by going to the bottom of the scrollable view.
Steps to Reproduce
The following code works on iOS, but fails on Android. We want to scroll to the bottom of the scrollable view and tap the Log out button. This problem also exists when the command is something like
await element(by.id('scrollView')).scroll(800, 'down');
.I have been able to find a work around if I use the command from the docs
await waitFor(element(by.text('Log out'))).toBeVisible().whileElement(by.id('scrollView')).scroll(250, 'down');
, however it seems to always encounter a timeout and adds several seconds to the test in each place it's used.Detox, Node, Device, Xcode and macOS Versions
Device and verbose Detox logs
The following command reaches a timeout and does not respond with the "rbx" as other commands do.
send: {"type":"invoke","params":{"target":{"type":"Class","value":"com.wix.detox.espresso.Espres
soDetox"},"method":"perform","args":[{"type":"Invocation","value":{"target":{"type":"Class","valu
e":"android.support.test.espresso.Espresso"},"method":"onView","args":[{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxMatcher"},"method":"matcherForTestId","args":["scrollView"]}}]}},{"type":"Invocation","value":{"target":{"type":"Class","value":"com.wix.detox.espresso.DetoxAction"},"method":"scrollToEdge","args":[{"type":"Integer","value":4}]}}]},"messageId":13}
The text was updated successfully, but these errors were encountered: