Hi all, Is it possible to write Integration Tests ...
# multiplatform
s
Hi all, Is it possible to write Integration Tests that involve Composables AND ViewModels with the KMP testing framework? The idea is to just mock the http backend using a MockServer and test the full UI layer. Here's a sample:
Copy code
@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?
l
You probably want to ask in #CJLTWPH7S