【问题标题】:Why maven-surefire-plugin doesn't run the testng.xml file in priority order?为什么 maven-surefire-plugin 不按优先级顺序运行 testng.xml 文件?
【发布时间】:2019-10-03 10:02:37
【问题描述】:

我的 pom.xml 文件没有按优先顺序运行测试脚本。我已经提到了优先级 = 0、1 等类的优先级。但它会从包中随机选取类。它应该按照优先级顺序运行。通过 testng.xml 触发器可以正常工作。

<build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
         </plugin>
      </plugins>
   </build>

可能是什么原因?

【问题讨论】:

  • 你能按照列出的优先顺序显示你的测试文件吗?

标签: testng maven-surefire-plugin


【解决方案1】:

这是由于执行环境设置为 JRE 而不是 JDK 。 因此,将工作区默认值更改为 JRE 到 JDK 解决了这个问题。 对于 JRE HOME,我给了 C:\Program Files\Java\jdk1.8.0_171

因为编译有JDK是必须的。

【讨论】:

    猜你喜欢
    • 2012-08-11
    • 2020-01-08
    • 1970-01-01
    • 2020-11-02
    • 2015-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多