优先考虑Selenium / Serenity / JUnit中的测试用例

时间:2017-09-18 11:28:04

标签: java selenium junit serenity-bdd

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

我想优先考虑测试套件并测试其中的案例。

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

我该怎么做?

2 个答案:

答案 0 :(得分:0)

您可以这样设置优先级

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

        }

答案 1 :(得分:0)

像这样使用:

 @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

        }
相关问题