escodro
02/24/2021, 11:50 AMCannot call setContent twice per test!
Is it possible to “clearContent” before starting it again?
Some of my tests are flaky because I need to mix it up with Espresso. ☹️
Thanks in advance!ppvi
02/24/2021, 1:00 PMcreateEmptyComposeRule
?escodro
02/24/2021, 1:24 PMppvi
02/24/2021, 1:51 PMescodro
02/24/2021, 2:00 PMppvi
02/24/2021, 2:33 PMescodro
02/24/2021, 2:37 PM@get:Rule
val composeTestRule = createEmptyComposeRule()
@get:Rule
val flakyRule = FlakyTestRule().allowFlakyAttemptsByDefault(defaultAttempts = 10)
private lateinit var scenario: ActivityScenario<ComponentActivity>
@Before
fun setup() {
scenario = ActivityScenario.launch(ComponentActivity::class.java)
}
@After
fun tearDown(){
scenario.close()
}
@Test
@Repeat(times = 10)
fun test() {
scenario.onActivity {
it.setContent { ... }
}
}