【问题标题】:Giving priority to test cases in Selenium/Serenity/JUnit优先考虑 Selenium/Serenity/JUnit 中的测试用例
【发布时间】:2017-09-18 11:28:03
【问题描述】:

我的测试框架中的测试套件/故事很少。

我想为测试套件以及其中的测试用例设置优先级。

例如删除应用程序内所有配置文件的测试,应在插入配置文件的测试之前执行。此外,将所有配置文件插入应用程序的测试套件应在对其执行某些操作等的套件之前执行。

我该怎么做?

【问题讨论】:

    标签: java selenium junit serenity-bdd


    【解决方案1】:

    你可以这样设置优先级

            @Test(priority = 1,alwaysRun = true)
            public void rentalhomesHomePage() throws InterruptedException {
                //Your test case
    
            }
    

    【讨论】:

      【解决方案2】:

      这样使用:

       @Test(priority = 2)
              public void testcase1() throws Exception {
                  //code
      
              }
      
       @Test(priority = 4)
              public void testcase2() throws Exception {
                  //code
      
              }
      
       @Test(priority = 3)
              public void testcase3() throws Exception {
                  //code
      
              }
      @Test(priority = 1)
              public void testcase4() throws Exception {
                  //code
      
              }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-10-27
        • 1970-01-01
        • 2022-11-28
        • 1970-01-01
        相关资源
        最近更新 更多