【发布时间】:2021-03-04 16:57:49
【问题描述】:
我在 pom.xml 中定义了我的配置文件如下:
<profiles>
<profile>
<id>Test123</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<!-- put your configurations here -->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/target/testdemo.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
我们运行了一个命令mvn test -PTest123,没有运行测试,如下所示: cmd output
但是,我们使用命令 mvn test 运行,它已经运行了如下所示的测试: cmd output
【问题讨论】:
-
您正在指定一个套件 XML 文件。因此它将运行除此插件的默认调用之外的其他测试。在 target 目录中指定 XML 文件似乎不正确。可能没有!
标签: java selenium maven testng