Skip to content

RootViewWithoutFocusException when trying to apply a ViewMutation "behind" a dialog #31

@cmathew

Description

@cmathew

Describe the bug
Since 2.0.0, mutations can only be applied to Views of the currently focused root.

To Reproduce

  1. Navigate to a screen that displays some content
  2. Open a bottom sheet
  3. Try to apply a ViewMutation to the content from step 1. Be sure to supply a correct inRoot modifier to your ViewInteraction
  4. See error: androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus

Expected behavior
ViewMutations should work on any root, regardless of state

Additional context
This may be an Espresso-level limitation - can it be ignored somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions