【问题标题】:Execute test suites in a specific order按特定顺序执行测试套件
【发布时间】:2016-05-25 05:09:39
【问题描述】:

我正在使用 maven-failsafe 插件来触发配置类似于

的 testng 套件
<suiteXmlFiles>
 <file>src/test/resources/suites/somesuite.xml</file>
 <file>src/test/resources/suites/anothersuite.xml</file>
 <file>src/test/resources/suites/yetanothersuite.xml</file>
</suiteXmlFiles>

但其中的套件或测试没有以正确的顺序执行。有没有办法指定套件应按以下顺序执行

  1. somesuite.xml
  2. anothersuite.xml
  3. 又一个suite.xml

我不关心套件中测试的执行顺序,但我只想在前一个套件完成后执行一个套件。是否有一些配置可以用来实现相同的目标?

【问题讨论】:

    标签: maven testng maven-failsafe-plugin


    【解决方案1】:

    创建一个单独的 testng.xml 文件并添加如下内容:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Suite">
        <suite-files>
            <suite-file
                path="path-to\suite1.xml" />
            <suite-file
                path="path-to\suite2.xml" />
        </suite-files>
    </suite>
    

    然后将此 testng.xml 文件添加到您的 maven 套件中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-05
      • 1970-01-01
      • 2023-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-08
      相关资源
      最近更新 更多