
我设置了Espresso检测框架来运行我的Android Functional automation测试.
对于每个测试,我想在完成测试后登录应用程序并删除应用程序.
所以,我设置如下:
公共类FirstSampleTest扩展BaseTest {
private final BaseTest baseTest;// private final ElementUtils elementUtils;
public FirstSampletest() throws InterruptedException { this.baseTest = new Basetest();}@Beforepublic voID initiate() throws InterruptedException { //I have setup login method here to login to the app after it installs}@Rulepublic ActivityTestRule<SplashScreenActivity> splashScreenActivityActivityTestRule = new ActivityTestRule(SplashScreenActivity.class);@Testpublic voID testTheHomeScreen() throws InterruptedException { //Some tests go here. }@Afterpublic voID teardown() throws InterruptedException { //I want to uninstall the app or delete it from the emulator once the test is run }}解决方法:
无法从Instrumentation测试中卸载应用程序.但是,运行所有测试后,将自动卸载该应用程序.
注意:仅在运行单个测试时才会卸载应用程序.请使用该命令运行整个构建
./gradlew connectedAndroIDTest
以上是内存溢出为你收集整理的android – Espresso Instrumentation测试 – 测试后如何卸载或删除应用程序全部内容,希望文章能够帮你解决android – Espresso Instrumentation测试 – 测试后如何卸载或删除应用程序所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)