-
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
atIndex()
not working as expected on Android
#337
Comments
@isnifer, this is not a fix for that issue. |
I'll take a look at this. |
Hey @SMJ93 , Silly thing, but could you please check it with I just noticed that you want to match the By the way, thanks to your report, I noticed a discrepancy between iOS and Android in how they handle
The difference is NOT in being zero indexed and one indexed. Both are zero indexed. It's about the ordering of the matched elements. |
Hi @simonracz, I tried with both There are 2 Let me know if you need anything else. |
After the error, does detox print out the view hierarchy? I am sure it's not about the I'll also check out something in the mean time. (By the way, without an |
Cool, cheers @simonracz. Here is the full Hierarchy:
|
I have a hunch. You have an AlertDialog shown on the screen, right? Sadly, it seems that causes issues for Espresso, which is used inside Detox Android. :( In Espresso syntax it means, that tests like this:
Must be transformed to
In case this is really the cause of this issue, sadly I don't have a quick solution to it. Maybe we have to expose this oddity in Detox API too in the end. Which would be super ugly. :( |
@simonracz, yeah the date picker displays as an AlertDialog: I can interact with other parts of the
|
Thanks for the extra info. I plan create a small test with a dialog and scrollviews to debug the issue. I can't promise a date though yet. |
Cool, we are using the Let me know if you need anything else. |
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. |
Description
I am trying to select the first
ScrollView
in my view hierarchy on Android.await element(by.type('android.widget.ScrollView')).atIndex(1)
works on it's own, but then when calling a.click()
/.scroll()
/.swipe()
event after e.g:await element(by.type('android.widget.ScrollView')).atIndex(1).scroll(100, 'up');
It throws the following error:
Error: Error: Error performing 'scrollInDirection' on view 'matches 1th view.'.
Steps to Reproduce
Call atIndex() followed by any of the ActionsOnElements on Android.
Node, Device, Xcode and macOS Versions
The text was updated successfully, but these errors were encountered: