如何生成index.html-诱惑报告 - testng-maven-selenium webdriver

问题描述 投票:0回答:1

我是新手的报道。我正在进行selenium testng测试并使用maven来运行它们。在mvn测试之后,生成一个xml文件的allure-result文件夹。任何人都可以告诉我如何用这个生成index.html文件。我需要在pom.xml中添加一些东西吗?这是我的pom.xml:

<properties>
    <allure.version>1.4.13</allure.version>
    <aspectj.version>1.8.10</aspectj.version>
</properties>
<dependencies>
    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-testng</artifactId>
        <version>2.0-BETA14</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-testng-adaptor</artifactId>
        <version>1.5.3</version>
        <exclusions>
            <exclusion>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.11</version>
        <scope>test</scope>
    </dependency>

    <build>
        <plugins>
            <plugin>
                 <groupId>io.qameta.allure</groupId>
                 <artifactId>allure-maven</artifactId>
                 <version>2.8</version>
            </plugin>
            <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"
                </argLine>
                <suiteXmlFiles>
                    <suiteXmlFile>testng.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>1.8.10</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

<reporting>
    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                  <outputDirectory>${basedir}/target/allure-reports/</outputDirectory>
                    <allureResultsDirectory>${basedir}/target/allure-results</allureResultsDirectory>
            </configuration>
        </plugin>
    </plugins>
</reporting>

我尝试运行MVN网站,但这不起作用。谢谢!!

maven selenium allure
1个回答
0
投票

问题是你使用旧报告(Allure 1)和新适配器(只有Allure 2支持)。

你可以在这里找到https://docs.qameta.io/allure/2.0/#_testng的完整文档

还有工作示例可用https://github.com/allure-examples/allure-testng-example

© www.soinside.com 2019 - 2024. All rights reserved.