0

我正在尝试将 SoapUI 测试用例与 Allure 集成以生成报告。有一个maven项目,我正在使用soapui maven插件来运行测试用例。测试用例运行良好,生成了 JUnit 报告,但没有引人入胜的结果。请检查我的 pom,它可能对 allure 插件有一些错误的用法。

<?xml version='1.0' encoding='UTF-8'?><project xmlns:1='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'>

<name>SOAPUI Tests</name>
<version>1.0</version>
<modelVersion>4.0.0</modelVersion>
<groupId>soapui-tests</groupId>
<artifactId>soapui-tests</artifactId>
<description>SoapUI Integration Tests</description>

<properties>
 <allure.version>1.4.19</allure.version>
 <allure.maven.version>2.4</allure.maven.version>
 <surefire.version>2.18.1</surefire.version>
 <aspectj.version>1.7.4</aspectj.version>
 <soapui.version>4.6.1</soapui.version>
</properties>

<dependencies>
    <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-junit-adaptor</artifactId>
        <version>${allure.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${surefire.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>com.smartbear.soapui</groupId>
            <artifactId>soapui-maven-plugin</artifactId>
            <version>${soapui.version}</version>

            <configuration>
                <outputFolder>${basedir}/target/soapui-results</outputFolder>
                <junitReport>true</junitReport>
                <exportAll>true</exportAll >
                <printReport>true</printReport>
                <testFailIgnore>true</testFailIgnore>
            </configuration>

            <dependencies>
                <dependency>
                    <groupId>com.sun.mail</groupId>
                    <artifactId>javax.mail</artifactId>
                    <version>1.5.0-b01</version>
                </dependency>
            </dependencies>

            <executions>
                <execution>
                    <id>x_project.xml</id>
                    <phase>process-test-classes</phase>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <projectFile>x_project.xml</projectFile>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
                <argLine>
                    -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
                </argLine>
                <properties>
                    <property>
                        <name>listener</name>
                        <value>ru.yandex.qatools.allure.junit.AllureRunListener</value>
                    </property>
                </properties>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

<reporting>
    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>${allure.maven.version}</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>${surefire.version}</version>
        </plugin>
    </plugins>
</reporting>

mnv 测试站点命令返回以下错误:

[错误]无法在项目soapui-tests上执行目标org.apache.maven.plugins:maven-site-plugin:3.3:site(默认站点):页面生成期间出错:渲染Maven报告时出错:无法生成报告: InvocationTargetException: 找不到任何诱惑结果-> [帮助 1]

4

2 回答 2

0

我认为 Allure 报告不是为 XML 设计的,它是由 soapui 生成的。我前段时间尝试过同样的方法,但没有找到解决方案。现在我要联系 allure 团队。会尽快通知您。

于 2016-01-26T11:13:13.720 回答
0

正如我在您的 pom.xml 中看到的那样,您使用非标准输出文件夹作为测试结果${basedir}/target/soapui-results。所以你需要配置allure.results.directory属性来告诉 allure 插件在哪里寻找测试结果。

于 2016-02-17T09:25:29.373 回答