-
Notifications
You must be signed in to change notification settings - Fork 743
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
Actions are applied to overlapping views #532
Comments
@silyevsk Are you scrolling to find a particular element in the scroll view? Using the |
It's not that I have a specific test that fails (we had an issue with react native warning view covering a scroll view, but we have a workaround for that). In the described cases however, an action applied to a matched element (in code) is in fact applied to a wrong element (just because it covers some of the element). It's not a matter of limiting scrollView, it's that a wrong scrollView is scrolled instead of the one that was matched. |
I've confirmed a bug in EarlGrey that's causing this behavior. In |
@silyevsk I am unable to make the app crash with the 2nd test case |
@khandpur It turns out I was checking against EarlGrey 1.8.0 (no idea how, I installed it via CocoaPods without specifying a version..) I've checked it now with 1.9.4 and it works fine. I'm sorry I didn't check the version before opening the issue. Thank you for your time. |
The overlapping scroll view issue is still legit and we have a fix for it. Using this issue to track it. |
… tests. Also resolved an issue where the hierarchy dump functional test would fail incorrectly on old iOS versions.
… tests. Also resolved an issue where the hierarchy dump functional test would fail incorrectly on old iOS versions.
If there's a scrollView
A
overlapped with a scrollviewB
at the bottom, then a scroll-down action applied to theA
element generates touches at the bottom of it and thusB
is scrolled instead.If there's a button
A
overlapped with a buttonB
at the center, then a tap action onA
causes an exception.An example project for these cases with the tests: https://github.com/wix/earlgrey-with-overlapping-interactable-views
I think that there should be a check of the area available for tap and scroll (the first touch point). Something like this (for tap): going over all the views that appear above the view and subtracting areas covered by other views that would catch the touches/gestures instead of the view. Then the action point should be a point in the area. If there's too small area left, then it may be good to throw an exception (it would be nice if the minimum amount/percent of space is configurable) - because it's not enough area for a real user to tap.
Another (simpler to implement) option is to have a list of possible locations for touch points and checking only those points (checking if the view that is going to accept scroll at the bottom center of the view is indeed the view itself and if not, try switching to alternative locations).
The text was updated successfully, but these errors were encountered: