-
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
Expect element To Not Be Visible doesn't work correctly on Android #1825
Comments
yup, same here. Funny thing is, if i replace the toBeNotVisible() matcher with toBeVisible(), the test passes on Android while failing on iOS. It should fail, since the component is most certainly not visible. I've tried playing around with the withTimeout() argument, choosing longer periods to ensure without a doubt that the item is not visible, but to no avail. |
Describe the bug
I have an expandable/collapsable element that displays certain elements when expanded and hides them when collapsed. When collapsed, I expect the
To Not Be Visible
assertion to be true, however on Android it returns error, 2 different ones depending on how the assertion is carried outTo Reproduce
Make sure that the element is existing in the view but not visible An expandable/collapsable element is how this issue was found and it may be useful as the elements were visible once but after collapsing they no longer are.
If the assertion is implemented with
await waitFor(element).toBeNotVisible().withTimeout(waitTime)
- Detox will wait until timeout is finished and fail the test with the following error message:Error: [<seconds>]sec timeout expired without matching of given matcher: (null or not is displayed on the screen to the user)
If the assertion is implemented with
await expect(MobileElement).toBeNotVisible()
- Detox will instantly fail the test with the following message:Error: 'not is displayed on the screen to the user' doesn't match the selected view. Expected: not is displayed on the screen to the user Got: "ReactImageView{id=[<id>], visibility=VISIBLE, width=[<width>], height=[<height>], has-focus=false, has-focusable=false, 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@fc8e1c0, tag=[<content-desc>], root-is-layout-requested=false, has-input-connection=false, x=0.0, y=35.0}"
This error message is also displayed if a manual sleep is added before
Environment (please complete the following information):
This issue doesn't happen on iOS, the To Not Be Visible assertion works correctly there
The text was updated successfully, but these errors were encountered: