leave Android app in final state on espresso test completion

爷,独闯天下 提交于 2019-12-21 20:06:26

问题


Is it possible to leave the app under test in whatever state it's in at the end of an espresso test? I don't care if it's failure or success. When I am working on developing a feature and a test for said feature it would be useful to just have the instrumentation app stop and leave the app under test alone in whatever state it happens to be in. This would allow me to play around manually or attach a debugger and see what is going on without running through the entire flow manually.

Anyone know if this is possible?


回答1:


There are multiple actors in play that try to kill your activities... finally I had to provide a custom rule and a custom runner to get the behavior I wanted. Documented here:

https://gist.github.com/dbachelder/4d0588ab6adf0aa6e69a



来源:https://stackoverflow.com/questions/29950640/leave-android-app-in-final-state-on-espresso-test-completion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!