简体   繁体   English

Android Instrumented 测试配置问题

[英]Android Instrumented tests configuration problem

I have some Espresso tests which are in the androidTest directory of Android Studio.我在 Android Studio 的 androidTest 目录中有一些 Espresso 测试。 When I bring cursor over the green triangle (see below) to run the test the Studio shows "Run Test" instead of "Run verifySomething" and proceeds to run the test as a unit test instead of Espresso test.当我将光标移到绿色三角形上(见下文)以运行测试时,Studio 显示“运行测试”而不是“运行 verifySomething”,并继续将测试作为单元测试而不是 Espresso 测试运行。 This was working fine until I upgraded from Studio 3.4 to 3.5 although I cannot tell fo sure this is the root cause.在我从 Studio 3.4 升级到 3.5 之前,这一切正常,尽管我无法确定这是根本原因。 If I go to Run |如果我去运行 | Edit Configurations I can see that Studio added a new entry "Android JUnit" in the left side panel instead of "Android Instrumented Test".编辑配置 我可以看到 Studio 在左侧面板中添加了一个新条目“Android JUnit”,而不是“Android Instrumented Test”。 If I manually create "Android Instrumented Test" configuration and manually add the "verifySomething" method I can run it as Instrumented test if I select it from the Studio's top level menu bar configuration dropdown.如果我手动创建“Android Instrumented Test”配置并手动添加“verifySomething”方法,如果我从 Studio 的顶级菜单栏配置下拉列表中选择它,我可以将其作为 Instrumented 测试运行。 How can I restore previous behavior where Studio automatically recognizes and uses instrumented test methods?如何恢复之前 Studio 自动识别和使用仪器化测试方法的行为?

在此处输入图片说明

I faced the same issue on version 3.5.2.我在 3.5.2 版上遇到了同样的问题。 After updating Android Studio to 3.5.3 it is starting instrumentation tests as usual, when clicking on the green rectangle next to the test function.将 Android Studio 更新到 3.5.3 后,当单击测试功能旁边的绿色矩形时,它会照常启动仪器测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM