I'm working on app testing automation with combining both Espresso and UiAutomator.
Some of the feature are hidden behind the feature flag that is updated upon signing in. After the app gets initial bundle of data from the server the feature flag is turned on and I gotta kill the app and restart it.
I've tried with this:
Intents.release()
scenarioRule.scenario.close()
Intents.init()
ActivityScenario.launch<MyActivity>(intent)
but the app is still found in recent apps, the app is still found in recent apps I've also tried adding UiAutomator's:
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.pressRecentApps()
device.findObject(UiSelector().descriptionContains("my app's name")).swipeUp(100)
But it still behaves as not being closed.
When I do it manually:
- Sign in
- Recent apps
- Swipe up then it works as expected.