<?xml version="1.0" encoding="UTF-8"?>
<suite name="Parallel test runs" parallel="tests" thread-count="2">
<test name="ModuleTest">
<classes>
<class name="com.qa.testcases.AccountTest" ></class>
<class name="com.qa.testcases.DeviceTest" ></class>
</classes>
</test>
<test name="UserTest">
<classes>
<class name="com.qa.testcases.UserTest" ></class>
</classes>
</test>
</suite>
我想按顺序运行AccountTest和Device Test,并行运行ModuleTest和UserTest 。并行执行正在发生,但AccountTest和Device Test没有以Sequential运行,而是开始以Parallel运行。有没有办法让它们按顺序运行?
我有两个测试类如下
1.AccountTest
public class AccountTest {
@BeforeTest
public void setUp() {
}
@Test(Priority=0)
public void createAccount(){
}
@Test(Priority=1)
public void editAccount(){
}
@Test(Priority=2)
public void deleteAccount(){
}
@AfterTest
public void closeSession() {
}
}
2.设备测试
public class DeviceTest {
@BeforeTest
public void setUp() {
}
@Test(Priority=0)
public void createDevice(){
}
@Test(Priority=1)
public void editDevice(){
}
@Test(Priority=2)
public void deleteDevice(){
}
@AfterTest
public void closeSession() {
}
}
问题是首先执行 AccountTest 的@BeforeTest方法,而不是转到 AccountTest 的@Test(priority=0),而是执行 DeviceTest 的@BeforeTest方法。我希望在进入 DeviceTest 之前先运行整个 AccountTest 类