I am trying to use Robotium to automate the testing of an application. The test cases were documented and they are supposed to be test in specific order. But it seems that Junit run the tests in alphabetic order.. how do I rearrange the order of execution? Here is the basic structure of my test class:

我正在尝试使用Robotium来自动测试应用程序。测试用例被记录下来,它们应该按照特定的顺序进行测试。但是,Junit似乎是以字母顺序运行测试的。如何重新安排执行顺序?下面是我的测试类的基本结构:

public class ETTerminalTest extends ActivityInstrumentationTestCase2<IdleActivity> {
   private Solo solo;
   private static final Logger LOGGER = LoggerFactory.getLogger(ETTerminalTest.class);

   public ETTerminalTest() {
       super("com.employtouch.etterminal.ui.activity", IdleActivity.class);
   }

   protected void setUp() throws Exception {
       solo = new Solo(getInstrumentation(), getActivity());
   }

   @Smoke
   public void testEnterPin() throws Exception {
       ...
   }

   @Smoke
   public void testWhatEver() throws Exception {
       ...
   }
   @Smoke
   public void testSomethingElse() throws Exception {
       ...
   }
    @Override
    public void tearDown() throws Exception {
        try {
            //Robotium will finish all the activities that have been opened
            solo.finalize();    
        } catch (Throwable e) {
                e.printStackTrace();
        }
        getActivity().finish();
        super.tearDown();
    } 
}

1 个解决方案

#1


3

I am not sure for Robotium, but the test order for normal jUnit test cases can be managed by creating a test suite. I guess it should be same in this case as well.(I haven't tried it myself). Some info here.

我不确定Robotium是否有效,但是可以通过创建测试套件来管理正常jUnit测试用例的测试顺序。我想在这种情况下也是一样的。(我自己还没试过。)一些信息。

更多相关文章

  1. mac react-native从零开始android真机测试
  2. Java类的初始化顺序
  3. 如何在一个套件中执行多个测试用例时,一次又一次地打开android应
  4. 我可以在测试运行时跳过JUnit测试吗?
  5. JMeter-Java压力测试工具-02
  6. java 的 数据库连接测试类 (SQL server)
  7. 基于Java的应用程序的GUI测试工具
  8. 测试技术大牛谈成长经历:一个好的软件测试工程师应该做到这些!
  9. java高并发测试实例(精确到几百纳秒)

随机推荐

  1. Python实现数据写入 Excel 的三种模块!
  2. 绝了!Python定时爬取微博热搜+pyecharts动
  3. 这52页pdf,顶10篇python自动化办公文章
  4. 学习C的第五天
  5. 刚学完python自动化系列文章,就接了一单任
  6. 学习C的第四天
  7. 开开心心爬APP,结果一坑连一坑
  8. nginx跳转 去掉工程名
  9. #6.1# 用python画出你的童年回忆
  10. centos7 中yum不能用了