I copied the setup and example from Testing Your Compose Layout into androidTest and for some reason it successfully installs on the emulator but none of the tests run. Am I missing something basic? Info in thread.
Vince Rickey
05/12/2021, 5:59 PM
Here's the exact sample test I am trying to run and a screenshot of the test results. Nothing happens in the emulator after this point. Thanks!
Copy code
@SmallTest
class ComposeTextTest {
@get:Rule
val composeTestRule = createComposeRule()
// createComposeRule() if you don't need access to the activityTestRule
val content = "Hello World!"
@Test
fun MyTest() {
// Start the app
composeTestRule.setContent {
MaterialTheme {
Text(text = content)
}
}
composeTestRule.onNodeWithText(content).assertIsDisplayed()
}
}
b
Bryan L
05/12/2021, 7:48 PM
Check your
testInstrumentationRunner
and confirm that you have the correct path. This fixed my issue anyways