我目前正在Android中构建一个应用程序,并使用Robotium进行功能测试(顺便说一下,不要在没有Android 1.6的情况下使用Robotium,这太麻烦了).
其中一些测试有随机的失败倾向,主要是Robotium缺少文本字段,或超时,而不是阅读文本.我正在尝试使用@FlakyTest注释,因此它们会在抛出失败的测试错误之前运行两到三次.但是,注释不起作用,测试在失败后不会重新运行.
以下是我使用注释的方法:
public class ClassName extends ActivityInstrumentationTestCase2<HomeActivity>{
@LargeTest
@FlakyTest(tolerance=3)
public void testMethod(){
//Here I run my roboitium scripts.
}
}
Run Code Online (Sandbox Code Playgroud)
然后我从命令行运行它:
adb shell am instrument -w com.jayway.test/android.test.InstrumentationTestRunner
eclipse和测试的命令行执行都没有考虑到片状测试注释.有没有人看到我试图申请的错误@FlakyTest?