Im testing android app written in compose using cucumber and gherkin. My app is checking for shared prefs during splash screen to decide what fragment it should show. I want to do clean test app run every scenario/test but only first test under cucumber is working fine, Im starting my activity (single activity app), but only first run is clearing my app shared prefs, every next is not which breaks my Cucumber Background and next all scenarios. Maybe there is any other option that I could do to have fresh installation etc every scenario, need help
val composeRule = createAndroidComposeRule<MainActivity>()
@Given("launch app")
fun launchApp() {
with(composeRule) {
activityRule.scenario.onActivity {
// clear app shared prefs
// do other stuff
}
}
}