diff --git a/tests/application/src/androidTest/java/dev/enro/test/application/fragment/UnboundBottomSheetRobot.kt b/tests/application/src/androidTest/java/dev/enro/test/application/fragment/UnboundBottomSheetRobot.kt index e00a70f0..539079de 100644 --- a/tests/application/src/androidTest/java/dev/enro/test/application/fragment/UnboundBottomSheetRobot.kt +++ b/tests/application/src/androidTest/java/dev/enro/test/application/fragment/UnboundBottomSheetRobot.kt @@ -42,7 +42,9 @@ class UnboundBottomSheetRobot( // on API 30 Espresso seems to fail to call "pressBack" unless the fragment's View is // manually requested for focus. This does not occur on API 23, 27 or 33. I believe this // is a bug in Espresso/API 30 specifically. - fragment.requireView().requestFocus() + composeRule.runOnUiThread { + fragment.requireView().requestFocus() + } // dirty hack to wait for the focus to come through, because waiting for // requireView().isFocused isn't working Thread.sleep(1000)