1

我需要使用 TestNG 从 2 个类运行测试。testng.xml 配置指定了这一点:

<classes>
    <class name="com.xyz.TestA"></class>
    <class name="com.xyz.TestB"></class>
</classes>
  • TestA 有方法:i1, i2, i3, i4
  • TestB 有方法:j1、j2、j3、j4

测试按以下顺序运行:

i1, i3, j1, j4, i2, i4, j2, j3

有人知道原因吗?请帮忙~非常感谢!

4

1 回答 1

1

如果您使用的是最新的 TestNG,请使用“preserve-order”:

<test name="foo" preserve-order="true">
  <classes>
    <class...>
于 2010-09-16T13:57:48.043 回答