UiAutomator测试套件(一组测试)

3
我想使用 UiAutomator for AndroidJUnit3 TestSuite 功能。
我尝试创建了一个 TestSuite 类,以及一个带有 public static Test suite() 方法的 UiAutomatorTestCase 类。但是这些方法都没有奏效。 UiAutomator 仅支持通过 -c package.name.TestClass 参数直接声明测试类?
1个回答

0

尽管您选择了JUnit3测试,但UIAutomator测试用例需要使用com.android.uiautomator.testrunner.UiAutomatorTestCase进行扩展。

来源:链接

是的,您是正确的,每个扩展UiAutomatorTestCase的类都是一个测试用例,并且可以使用-c package.name.TestClass访问。


你想说什么?当然我的测试用例扩展了 UiAutomatorTestCase。我在问关于 JUnit 的测试套件,我知道 -c 选项,但这不是一个好的解决方案。 - Artem Zinnatullin
你在说什么?UiAutomatorTestCase 扩展了 JUnit3 中的 TestCase。JUnit 不是一个 Eclipse/桌面框架,它只是一组 Java 类。 - Artem Zinnatullin
我的意思是JUNIT框架只能用于测试您的应用程序,但使用UIAutomator框架,我们可以测试Android操作系统(设置/ WiFi /等)以及您的应用程序。我认为它们是不同的。如果这不合理,请纠正我。 - Anvesh Yalamarthy
1
UiAutomator基于JUnit3,但不支持JUnit的TestSuite,这就是我想对你说的全部。 - Artem Zinnatullin
检查这个工具[http://sourceforge.net/projects/uiautomator/]。它提供了维护测试套件的功能,虽然不像JUnit那样。 - Dnavir

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接