gradle - Allure 在本地计算机上生成空的报告页面

标签 gradle automated-tests testng allure

如标题所述,我不能强制Allure 2在本地计算机上为我生成报告。
我从Google尝试了很多东西,但没有任何帮助。我使用Kotlin + Selenide + TestNG编写测试,如果有帮助的话:)
我对Allure有点困惑,因为它具有testNG的版本和Gradle的版本-应该使用哪个版本?都?
这是我的build.gradle文件:

group 'RegisteredUserFlow'
version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = "1.1.2-2"

    repositories {
        jcenter()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "ru.d10xa:gradle-allure-plugin:0.5.5"
    }
}

apply plugin: 'kotlin'
apply plugin: 'java'
apply plugin: 'ru.d10xa.allure'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

allure {
    aspectjweaver = true
    testNG = true
}

repositories {
    jcenter()
}

configurations {
    agent
}

dependencies {
    agent "org.aspectj:aspectjweaver:1.8.10"
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-2"
    testCompile "com.codeborne:selenide:4.4.3"
    testCompile "org.testng:testng:6.10"
    testCompile "io.qameta.allure:allure-testng:2.0-BETA6"
    testCompile "io.github.bonigarcia:webdrivermanager:1.6.2"
}

test.doFirst {
    jvmArgs "-javaagent:${configurations.agent.singleFile}"
}

test {
    useTestNG(){
        suites 'src/test/kotlin/testng.xml'
    }
    systemProperty 'allure.results.directory', 'build/allure-results'
    systemProperty 'allure.link.issue.pattern', 'https://github.com/allure-framework/allure-docs/issues/{}'
    systemProperty 'allure.link.tms.pattern', 'https://github.com/allure-framework/allure-docs/issues/{}'
}

tasks.withType(Test)*.finalizedBy allureReport

我使用的命令是:allure serve build/allure-resultsgradlew clean test allureReport
另外,我需要Java插件吗?

感谢任何帮助!
谢谢!

附言这是gradlew clean test allureReport命令后在控制台中出现的错误:
Execution failed for task ':allureReport'.
> Could not resolve all dependencies for configuration ':allureReport'.
   > Could not resolve org.slf4j:slf4j-api:1.7.12.
     Required by:
         project : > ru.yandex.qatools.allure:allure-bundle:1.4.24.RC3 > org.slf4j:slf4j-simple:1.7.12
         project : > ru.yandex.qatools.allure:allure-bundle:1.4.24.RC3 > ru.yandex.qatools.allure:allure-report-data:1.4.24.RC3 > ru.yandex.qatools.allure:allure-report-plugin-api:1.4.24.RC3 > ru.yandex.qatools.allure:allure-model:1.4.24.RC3

最佳答案

问题在于ru.d10xa:gradle-allure-plugin:0.5.5不支持Allure2。我们正在开发全新的Allure Gradle插件,此处提供https://github.com/allure-framework/allure-gradle

目前,您可以使用allure命令行在本地计算机上生成报告,并可以使用Allure Jenkins / Teamcity插件在CI上生成报告。

更新资料

现在提供支持Allure 2的新的Allure Gradle插件。有关更多详细信息,请参阅docs https://docs.qameta.io/allure/2.0/#_gradle_3

关于gradle - Allure 在本地计算机上生成空的报告页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44131517/

相关文章:

java - TestNg Eclipse 插件 - 开始测试时出现 NullPointer

spring - 使用 Gradle 构建 Spring 源文件失败

security - Auth0 测试账户最佳实践

android - Gradle 脚本自 0.4.0 起无法正常工作 - 找不到方法 plus()

tfs - 在 TFS 中,如何使用自定义记录器执行测试运行?

javascript - Protractor js测试无法提交 Angular 形式

java - TestNG 禁用某些 dataProvider 集

java - selenium webdriver 中的空指针异常 - TestNG - PageFactory

android - 减少 Android Studio 中的 Gradle 同步时间

android - 有时使用 dexdebug 构建失败?