testng - Surefire 报告显示使用 testng 的测试次数增加了一倍
问题描述
但在 Aws 的肯定报告中,测试计数为 82(每个测试出现两次):
我正在使用 testng 7.3.0,surefire 版本 3.0.0-M5(最新版本目前在 maven 存储库中。
编辑:
在 target->surefire-reports->junitreports 文件夹中,我看到每个类两次,一次像这样:"TEST-LoginTests.xml"
一次像这样:"Test-Sanity.LoginTests.xml".
理智是一个包。
起居室:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>14</source>
<target>14</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.327</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.0-jre</version>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.ashot</groupId>
<artifactId>ashot</artifactId>
<version>1.5.4</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-s3</artifactId>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>5.2.9.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
buildspec.yml:
version: 0.2
phases:
install:
runtime-versions:
java: corretto11
commands:
- apt update
- curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz
- tar xvf openjdk-14_linux-x64_bin.tar.gz
- mv jdk-14 /opt/
- /opt/jdk-14/bin/java --version
build:
commands:
- env JAVA_HOME=/opt/jdk-14 PATH=/opt/jdk-14/bin:$PATH mvn --version
- env JAVA_HOME=/opt/jdk-14 PATH=/opt/jdk-14/bin:$PATH mvn -Dtestng.dtd.http=true surefire-report:report
reports: #New
SurefireReports: # CodeBuild will create a report group called "SurefireReports".
files: #Store all of the files
- '**/*'
base-directory: 'target/surefire-reports' # Location of the reports
有任何想法吗?
解决方案
推荐阅读
- javascript - 如果只有 prop 有 useCallback,为什么子组件会重新渲染?
- python - 一直在写一个搜索查询工具,经过一堆搜索却没有结果,它总是出现这个错误
- reactjs - 如何将类切换到 React.js 中的每个 li 元素?
- javascript - React.js 路由到“/”会导致 [不能在没有“新”的情况下调用]
- ios - Alamofire 不会自动设置“If-None-Match”标头
- arrays - 如何优化这段代码,让整个过程加速?
- python - 在 Python(tkinter)中从类的外部更改类的私有属性(标签)
- c++ - 我应该如何在 io_service 中解决这个问题?
- android - Jetpack Compose 减少 TextField 的高度
- javascript - 如何在 nodejs 中导入 puppeteer npm