无法使用硒 java 黄瓜生成诱惑报告

时间:2021-02-14 05:58:44

标签: java selenium cucumber allure

我正在努力解决以下错误,因为我无法生成诱惑报告。尝试执行 mvn allure:report 命令时出现以下错误

<块引用>

未能在项目 AutomationFramework1.0 上执行目标 io.qameta.allure:allure-maven:2.8:report (default-cli):在 Allure 报告生成中发生错误。

[INFO]
[INFO] --- allure-maven:2.8:report (default-cli) @ AutomationFramework1.0 ---
[INFO] Allure installation denter code hereirectory D:\AutomationFramework1.0/.allure
[INFO] Try to finding out allure 2.0.1
[INFO] Generate Allure report (report) with version 2.0.1
[INFO] Generate Allure report to D:\AutomationFramework1.0\target\site/allure-maven-plugin
[INFO] Found results directory D:\AutomationFramework1.0\target\allure-results
[INFO] Can't find information about categories.
[INFO] Generate report to D:\AutomationFramework1.0\target\site\allure-maven-plugin
[ERROR] Can't generate allure report data
java.io.IOException: Cannot run program "D:\AutomationFramework1.0.allure\allure-2.0.1\bin\allure.bat" (in directory "."): CreateProcess error=2, The system cannot find the file specified

我的项目文件夹结构如下所示。 Project Folder Structure

我在 pom.xml 中使用的依赖项如下。

`

<dependencies>
    <!-- For selenium WebDriver-->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.7.0</version>
    </dependency>

    <!-- For cucumber-->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>4.2.0</version>
        <scope>compile</scope>

    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.2.0</version>
        <scope>compile</scope>

    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>4.2.0</version>
    </dependency>

    <!-- For Reporting-->
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-cucumber4-jvm</artifactId>
        <version>2.10.0</version>
    </dependency>

    <!-- Other utilities -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.5</version>
    </dependency>
</dependencies>
   <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.0.0-M5</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
        </plugin>
        <plugin>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-maven</artifactId>
            <version>2.8</version>
        </plugin>
    </plugins>
</build>

`

1 个答案:

答案 0 :(得分:1)

您的构建部分配置不正确。请参阅https://docs.qameta.io/allure/#_maven_4 你应该使用

<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20</version>
        <configuration>
            <argLine>
                -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                -Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
            </argLine>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
        </dependencies>
    </plugin>
</plugins>

将aspectj添加到属性部分,并在配置中指定要报告和结果的目录

相关问题