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

[Android] scroll does not finish before tap occurs #757

Closed
lalka-workco opened this issue May 29, 2018 · 6 comments
Closed

[Android] scroll does not finish before tap occurs #757

lalka-workco opened this issue May 29, 2018 · 6 comments

Comments

@lalka-workco
Copy link
Contributor

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.

await element(by.id('scrollView')).scrollTo('bottom');

await element(by.text('Log out')).tap();

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 7.3.7
  • React Native: 0.53.3
  • Node: 9.2.0
  • Device: Android simulator (Nexus_5X_API_27)
  • Xcode: 9.2
  • macOS: 10.13.4

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}

@stale
Copy link

stale bot commented Jul 13, 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 13, 2018
@stale
Copy link

stale bot commented Jul 20, 2018

The issue has been closed for inactivity.

@stale stale bot closed this as completed Jul 20, 2018
@rotemmiz
Copy link
Contributor

Detox Android does not support RN >=51. Recheck this issue when we announce support for modern RN version

@wix wix locked and limited conversation to collaborators Jul 23, 2018
@noomorph
Copy link
Collaborator

@lalka-workco, could you please recheck the issue with Detox 9?

@d4vidi
Copy link
Collaborator

d4vidi commented May 29, 2019

Reopened because thanks to @viktorijasujetaite we now know this happens with detox 12.9.0 on RN 0.59.x. I'll have to take a deeper look into it to know whether this is applicable with older RN versions, but in any case the bug does exist - and needs to be prioritized.

@d4vidi d4vidi self-assigned this May 29, 2019
@d4vidi
Copy link
Collaborator

d4vidi commented Jun 26, 2019

After some investigation work, seems that this isn't really the issue. I'll open one that better describe the actual problem, soon. Closing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants