问题描述
我有一个gradle项目,我正在尝试使用CucumberJVM 4生成“魅力报告”。我已经推荐了许多博客及其网站,但没有运气。有人可以使用Java和Allure Reports + CucumberJVM与BDD Cucumber一起为示例GitHub Gradle 项目提供帮助吗?
我已尝试按照本文档中的步骤进行操作,但是gradle命令中未执行'.json'文件和步骤定义。
链接:https://docs.qameta.io/allure/#_cucumber_jvm
命令:gradle clean allure 或 gradle clean allureReport
以下是我在build.gradle中所做的更改:
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies{
classpath "io.qameta.allure:allure-gradle:2.8.1"
}
}
apply plugin: "io.qameta.allure"
allure {
version = '2.2.1'
autoconfigure = true
String allureJavaVersion = '2.0-BETA9'
aspectjweaver = true
boolean clean = true
resultsDir = file('testfolder/build/allure-results')
reportDir = file('build/reports/allure-report')
String configuration = 'testCompile'
useCucumberJVM {
version = '2.0-BETA12'
}
downloadLink = "https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/2.2.1/allure-2.2.1.zip"
}
dependencies{
// Allure Reports
testCompile "io.qameta.allure:allure-cucumber4-jvm:2.10.0"
testCompile "io.qameta.allure:allure-cucumber-jvm:2.0-BETA16"
testCompile ("org.aspectj:aspectjweaver:1.8.10")
}
import io.qameta.allure.gradle.task.AllureReport
task allureAggregatedReport(type: AllureReport) {
resultsDirs = subprojects.allure.resultsDir
}
解决方法
你在这里!! -https://github.com/Ragul-Dhandapani/BDD-Cucumber-Allure-Gradle
该项目具有build.grade(黄瓜JVM4 + Java + Allure + BDD黄瓜)。确保您的黄瓜版本
,好吧,要在底座上配置诱惑力2.0,您应该做三件事,分别添加dependencies (also compile group)
和allure module
。
而且有效。
之后,将在result directory
中配置json文件。您可以通过allure CLI
查看我的工作配置
dependencies {
compile "org.seleniumhq.selenium:selenium-java:${selenium}"
testCompile group: 'junit',name: 'junit',version: '4.12'
testCompile 'info.cukes:cucumber-java:1.2.5'
compile 'info.cukes:cucumber-junit:1.2.5'
compile "org.testng:testng:${testNG}"
compile group: 'io.qameta.allure',name: 'allure-attachments',version: '2.0-BETA16'
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.qameta.allure:allure-gradle:2.3"
}
}
apply plugin: 'io.qameta.allure'
allure {
version = '2.4.1'
useCucumberJVM {
version = '2.0-BETA5'
}