gradle 空的诱惑报告-未知的诱惑报告NaN%

unftdfkk  于 2022-11-14  发布在  其他
关注(0)|答案(2)|浏览(138)

我在使用诱惑报告时遇到了问题。当我在测试执行后运行命令./gradlew allureReport时,我得到了一个空的报告,其中包含类似“Allure Report unknown NaN %”的文本。有人遇到过同样的问题吗?以下是我的build.gradle配置文件:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath "io.qameta.allure:allure-gradle:2.8.1"
}
}

plugins {
    id "io.qameta.allure" version "2.8.1"
    id 'java'
}

apply plugin: 'io.qameta.allure'

allure {
    version = '2.8.1'
    autoconfigure = true;
    aspectjweaver = true;
resultsDir = file('/build/allure-results')
reportDir = file('build/allure-results')
}

group 'com.poc'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

test {
    useTestNG()
    dependsOn cleanTest
    systemProperties System.getProperties()
}

dependencies {
    compile group: 'junit', name: 'junit', version: '4.12'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.141.59'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-firefox-driver', version: '3.141.59'
    compile group: 'org.testng', name: 'testng', version: '6.14.3'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-chrome-driver', version: '3.141.59'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-safari-driver', version: '3.141.59'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-edge-driver', version: '2.47.1'
    compile group: 'org.seleniumhq.selenium', name: 'selenium-api', version: '3.141.59'
    compile group: 'org.projectlombok', name: 'lombok', version: '1.18.10'
    compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.13'
    compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.1'
    compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.6'
    compile group: 'commons-io', name: 'commons-io', version: '2.6'
    compile group: 'io.qameta.allure', name: 'allure-testng', version: '2.8.1'
}
suzh9iv8

suzh9iv81#

你还没有在你的依赖项下添加allure-maven依赖项。我想这就是为什么你会得到这个NaN%错误的原因。

6mzjoqzu

6mzjoqzu2#

其中一个父文件夹名称中似乎有空格。因此,如果文件夹名称中有空格,请将文件夹名称用双引号括起来。请参阅以下示例:
错误:allure serve D:\test automation\webautomation\allure-results
正确:allure serve D:\"test automation"\webautomation\allure-results

相关问题