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

sleep does not work when a DialogFragment is open and the test is running on Android 11+ #503

Open
ajburley opened this issue Aug 1, 2023 · 0 comments

Comments

@ajburley
Copy link

ajburley commented Aug 1, 2023

Library Version:

4.3.0

Describe the Bug:

When calling sleep while a DialogFragment is open, the test fails every time on Android 11+ with an error "Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds"

I believe this may be related to issue android/android-test#751
In the code, sleep is calling isRoot to look for the root view, but this doesn't work properly if a DialogFragment is open.

Steps to reproduce the bug:

  1. Open a DialogFragment, for example I'm using a BottomSheetDialogFragment
  2. After it opens, call sleep
  3. See that the test fails

Expected Behavior:

I expected sleep to work as normal.

One option might be to be able to pass a view matcher to sleep, which could be of a view you know to exist. Or else just match any view using some generic matcher like withClassName(any()) or something.

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

No branches or pull requests

1 participant