我正在运行自动化测试脚本(这是一个Maven项目基于Java并在AzureDevops CI / CD管道中使用测试ng)。我已经将所有代码推送到Github并创建了一个Maven任务来运行测试。
但是当我尝试运行Maven任务时,它没有考虑testng.xml,在这里我拥有所有测试配置(例如要运行哪些测试(测试的顺序)以及其他配置内容(如侦听器)来创建一些自定义报告) 。它只是运行我完整的Maven项目中存在的所有测试类。
请帮助我在构建中添加哪个配置/任务,以便基于我的testng.xml运行测试
下面是Pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd“>4.0.0测试自动化测试0.0.1-快照罐测试http://maven.apache.orgorg.seleniumhq.selenium硒java3.14.0org.testngng6.11编译org.apache.poipoi3.16-beta2com.relevantcodes范围报告2.41.2公地公地2.6log4jlog4j1.2.17com.googlecode.json-简单json-简单1.1.1
<!-- for gson https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<property>
<name>listener</name>
<value>com.qa.ExtentReportListner.ExtentRerportListener</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
您能否在工作时让我知道?我想知道您如何在DevOps UI中进行测试报告。
[我已经将Maven与Pom.Xml Agent一起工作,并将结果工件(.HTML文件)发布到项目文件夹中。我没有DevOps测试通过/失败报告。你成功了吗?