我在 Espresso 中进行了测试,在测试结束时,我按下应用程序中的通话按钮,这会导致手机的拨号屏幕。
如何返回应用程序? 我想返回应用程序并从中注销。
pressBack();
不执行任何操作。
如有建议,我们将不胜感激。
最佳答案
UiDevice mDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());
mDevice.pressRecentApps();
mDevice.pressRecentApps();
我最终使用了UIAutomator。正是我所需要的。
关于java - Espresso : returning to application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49340645/