无法生成诱惑报告

时间:2018-06-14 19:55:19

标签: allure

mvn网站总是在/ target目录中寻找诱惑结果。但是,在我的项目基目录中生成了allure-results目录。

  1. 如何在不同的目录中生成诱惑结果。
  2. 如何让mvn网站引用来自不同目录的诱惑结果?
  3. 我正在使用诱惑2以下是我的pom文件配置。

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <cucumber.version>1.2.5</cucumber.version>
        <extentreports.version>3.0.6</extentreports.version>
        <spring.version>4.1.5.RELEASE</spring.version>
        <selenium.version>3.4.0</selenium.version>
        <testng.version>6.10</testng.version>
        <aspectj.version>1.8.10</aspectj.version>
        <allure.results.directory>allure-results</allure.results.directory>
            <allure.report.directory>${basedir}\test-output\allure-report</allure.report.directory>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <allure.results_pattern>allure-results</allure.results_pattern>
    </properties>
    
    
    ....
     <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.21.0</version>
                    <configuration>
                        <suiteXmlFiles>
                            <suiteXmlFile>TestNG.xml</suiteXmlFile>
                        </suiteXmlFiles>
                        <argLine>
                            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                        </argLine>
                        <systemProperties>
                        <property>
                            <name>allure.results.directory</name>
                            <value>${allure.results.directory}</value>
                        </property>
                    </systemProperties>
    <!--                 <resultsDirectory>${allure.results.directory}</resultsDirectory> -->
    <!--                 <reportsDirectory>${allure.report.directory}</reportsDirectory> -->
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>
            </plugin>
    
            .... 
    
            <dependency>
                 <groupId>io.qameta.allure</groupId>
                 <artifactId>allure-testng</artifactId>
                 <version>2.6.0</version>
        </dependency>
    
    
        ....
    
    
            <reporting>
            <excludeDefaults>true</excludeDefaults>
            <plugins>
                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>2.9</version>
    
                        <configuration>
                            <reportVersion>2.6.0</reportVersion>
                            <resultsPattern>${allure.results_pattern}</resultsPattern>
        <!--                     <outputDirectory>${allure.report.directory}</outputDirectory> -->
        <!--                     <allureResultsDirectory>${allure.results.directory}</allureResultsDirectory> -->
                            <resultsDirectory>${allure.results.directory}</resultsDirectory>
                            <reportDirectory>${allure.report.directory}</reportDirectory>
                        </configuration>
                </plugin>
            </plugins>
    </reporting>
    

1 个答案:

答案 0 :(得分:0)

您可以通过创建包含以下内容的allure-results文件来更改src/test/resources/allure.properties生成路径:

allure.results.directory=target/allure-results

更新 在创建allure-results

之后,最好从所有allure.properties个变量中清除pom.xml