我知道我可以将历史目录从诱惑性报告复制到生成的诱惑性结果中,然后执行诱惑性生成来显示历史记录,但我正在寻找一种方法来实现这一点,使用诱惑性gradle中的内置功能。
目前,我先运行./gradlew clean test,然后运行./gradlew allureReport,这会给我一个新的html报告,没有历史记录或重新运行。我注意到,测试任务删除了整个allure-report目录,然后重新生成并重新填充它。
这是我的build.gradle:
buildscript {
repositories {
mavenLocal()
jcenter()
}
}
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'java'
id 'eclipse'
// Allure reporter
id 'io.qameta.allure' version '2.8.1'
}
repositories {
mavenCentral()
jcenter()
}
def allureVersion = "2.13.1"
allure {
autoconfigure = true
version = allureVersion
useJUnit5 {
version = '2.0-BETA10'
}
downloadLink = "https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.1/allure-commandline-2.13.1.zip"
}
test {
useJUnitPlatform() {
includeEngines 'junit-jupiter'
}
ignoreFailures = true
}
dependencies {
compile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.6.0'
compile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.6.0'
compile group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.6.0'
// Needed as a workaround for JUnit 5 not failing tests that stopped due to an error message. The fix is in eclipse 4.10
compile group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.6.0'
compile group: 'io.qameta.allure', name: 'allure-junit5', version: '2.13.1'
compile group: 'io.qameta.allure', name: 'allure-java-commons', version: '2.13.1'
// https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
}我还尝试将结果和报告目录指定为build目录之外的目录,如下所示:
allure {
autoconfigure = true
version = allureVersion
resultsDir = file('../../allure-results')
reportDir = file('../../allure-report')
...
}这允许诱饵-结果文件夹保留以前的报告,这些报告显示为重试(不完全正确),但历史记录仍然不起作用。
发布于 2021-02-26 16:23:57
我已经通过在运行的测试脚本中添加这些行解决了这个问题(我有一些测试scuites)
call gradlew test -PsuiteFile=YOUR_TEST_SUITE.xml
mkdir allure-results\history
xcopy build\allure-results\* allure-results\history
allure serve allure-results\history所以我添加了文件夹allure-results\history来保存所有的结果
https://stackoverflow.com/questions/60895749
复制相似问题