Stefan Roeck
03/13/2025, 10:34 AM@OptIn(ExperimentalTestApi::class)
class AppE2eTest {
@Test
fun `test complete app`() = runComposeUiTest {
setContent { App() } // App uses nested Composables that invoke `viewModel { SomeViewModel() }` down in the hierarchy
onNodeWithText("Welcome to my app").assertExists()
}
}
The error I'm getting is:
java.lang.IllegalStateException: No ViewModelStoreOwner was provided via LocalViewModelStoreOwner
How to build such a LocalViewModelStoreOwner for testing scope? Or is there another runner than runComposeUiTest
for this purpose?loke
03/13/2025, 10:49 AM