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

Replace matching disambiguation with 1st match as default #4686

Open
d4vidi opened this issue Jan 14, 2025 · 0 comments
Open

Replace matching disambiguation with 1st match as default #4686

d4vidi opened this issue Jan 14, 2025 · 0 comments

Comments

@d4vidi
Copy link
Collaborator

d4vidi commented Jan 14, 2025

Describe your idea

This is a common type of an error we seem to stumble upon fairly frequently:

Test Failed: '(view.getTag() is "wix.platform.MEMBER_VIEW_SCREEN_CONTENT" and view has effective visibility <VISIBLE>)' matches 2 views in the hierarchy:
- [1] ReactViewGroup{id=369, visibility=VISIBLE, width=828, height=1536, has-focus=true, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.view.ViewGroup$LayoutParams@YYYYYY, tag=wix.platform.MEMBER_VIEW_SCREEN_CONTENT, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
- [2] ReactViewGroup{id=649, visibility=VISIBLE, width=828, height=1584, has-focus=false, has-focusable=true, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.view.ViewGroup$LayoutParams@YYYYYY, tag=wix.platform.MEMBER_VIEW_SCREEN_CONTENT, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=1}
Problem views are marked with '****MATCHES****' below.


HINT: To print view hierarchy on failed actions/matches, use log-level verbose or higher.

I think Detox should reduce strictness and, unless atIndex() is explicitly specified, resort to using the first match.

  • This can come with a warning, just in case.
  • In the future, the warning can be escalated to an error depending on whether strict mode is enabled

Related: Issue #2078 which can come in handy when analyzing multiple-match use cases.

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

No branches or pull requests

1 participant