【问题标题】:Allure Report html generated blank倾城报告 html 生成空白
【发布时间】:2017-01-13 12:48:33
【问题描述】:

我正在做一个 POC 以使用 TestNG 实现关于 Maven 的 Allure 报告。我能够成功实现它,但是生成的报告是空白的,没有任何关于成功构建的信息。

请在下面找到我的 POM 文件。

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>com.org.cboe</groupId>
<artifactId>allurePOC</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- Project information and dependencies -->
<name>allurePOC</name>
<url>http://maven.apache.org</url>

<properties>
    <jetty.http.port>9000</jetty.http.port>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <allure.version>1.4.24.RC3</allure.version>
    <aspectj.version>1.8.9</aspectj.version>
</properties>

<dependencies>


    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.9.11</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.14</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.14</version>
    </dependency>


    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-scratchpad</artifactId>
        <version>3.14</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>3.14</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-excelant</artifactId>
        <version>3.14</version>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>htmlunit-driver</artifactId>
        <version>2.23</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.0.1</version>
    </dependency>



    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>2.7</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>2.7</version>
    </dependency>
    <!-- Allure dependencies -->
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>

    </dependency>

    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-testng-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
</dependencies>

<!-- Project Build information and dependencies -->

<build>

    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>

            <configuration>
                <fork>true</fork>
                <source>1.8</source>
                <target>1.8</target>
                <executable>C:\Program Files\Java\jdk1.8.0_111\bin\javac.exe</executable>
            </configuration>

        </plugin>

        <plugin>

            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>

            <dependencies>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-junit47</artifactId>
                    <version>2.18.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-testng</artifactId>
                    <version>2.18.1</version>
                </dependency>
            </dependencies>
            <configuration>
                <threadCount>1</threadCount>
                <!-- <properties> <property> <name>listener</name> <value>ru.yandex.qatools.allure.junit.AllureRunListener</value> 
                    </property> </properties> -->
            </configuration>


        </plugin>

        <plugin>

            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.7.v20160115</version>
            <configuration>
                <webAppSourceDirectory>
                    ${project.build.directory}/site/allure-results
                </webAppSourceDirectory>
                <httpConnector>
                    <port>${jetty.http.port}</port>
                </httpConnector>
                <stopKey>stop</stopKey>
                <stopPort>1234</stopPort>
            </configuration>

        </plugin>

    </plugins>

</build>

<!-- Project reporting -->

<reporting>

    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <reportDirectory> ${project.build.directory}/site/allure-results</reportDirectory>

                <!-- <resultsDirectory></resultsDirectory> -->

            </configuration>

        </plugin>



    </plugins>

</reporting>

【问题讨论】:

    标签: allure


    【解决方案1】:

    需要将aspectj-weaver添加为javaagent。见FAQ-and-Troubleshooting:

    您没有指定 -javaagent JVM 参数。这是强制性的,当 使用步骤、附件和参数,因为我们正在使用 AspectJ 来处理它们。

    解决方案:: 确保使用 -javaagent 启动 JVM 路径/到/aspectj-weaver.jar。请参阅有关如何完成此操作的示例 马文。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多