我有3個類,每個類有3個測試。通過test.xml文件基於多個類定義的優先級運行測試
1類
@Test(priority = 1)
public void testA1() {
System.out.println("testA1");
}
@Test(priority = 2)
public void testA2() {
System.out.println("testA2");
}
@Test(priority = 3)
public void testA3() {
System.out.println("testA3");
}
2類
@Test(priority = 1)
public void testB1() {
System.out.println("testB1");
}
@Test(priority = 2)
public void testB2() {
System.out.println("testB2");
}
@Test(priority = 3)
public void testB3() {
System.out.println("testB3");
}
3類
@Test(priority = 1)
public void testC1() {
System.out.println("testC1");
}
@Test(priority = 2)
public void testC2() {
System.out.println("testC2");
}
@Test(priority = 3)
public void testC3() {
System.out.println("testC3");
}
這是我的XML文件的代碼。
<test verbose="2" name="hello" group-by-instances="true">
<classes>
<class name="Class1"></class>
<class name="Class2"></class>
<class name="Class3"></class>
</classes>
</test>
這裏是我的回答 testA1 testB1 testC1 testA2 testB2 testC2 testA3 testB3 testC3
但是我預期的答案是 testA1 testA2 testA3 testB1 testB2 testB3 testC1 testC2 testC3
在此先感謝有這方面的幫助。
你如何運行你的套件? –
我正在運行maven框架,並直接在intellij,這兩種情況下相同的錯誤 –