1

我的 Soap UI 项目和 pom.xml 位于 D:\Projekte\JacobMarshell 下

想使用 maven 执行soap ui 项目的测试套件。

使用以下命令时未执行测试套件

“mvn test”并得到以下响应。

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven 2 soapUI Sample
[INFO]    task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [resources:testResources {execution: default-testResources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] No sources to compile
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: D:\Projekte\JacobMarshell

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

这是 pom.xml 的代码片段

<project xmlns="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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>src.main.resources</groupId>
    <artifactId>soapui-maven2-plugin</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Maven 2 soapUI Sample</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <pluginRepositories>
        <pluginRepository>
            <id>eviwarePluginRepository</id>
            <url>http://www.soapui.org/repository/maven2</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
               <groupId>eviware</groupId>
                <artifactId>maven-soapui-plugin</artifactId>
                <version>4.5.1</version>
                <configuration>
                            <projectFile>Sample-Upload-to-Upload-Diagnose---Complete--soapui-project.xml</projectFile>
                            <junitReport>true</junitReport>

                            <outputFolder>reports</outputFolder>
                            <testSuite>diag_upload_tc</testSuite>
                        </configuration>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>   
        </plugins>
    </build>
</project>

无法弄清楚为什么 maven 不执行我的测试套件?

4

2 回答 2

0

实际问题出在存储库...我删除了存储库中的 eviware 文件夹并开始运行“mvn test”命令,存储库已下载,然后测试套件开始执行感谢 Marcel Stör 给了我希望总有一天我会得到答案。

于 2013-11-05T13:12:39.053 回答
0

使用以下插件:

<plugin>
   <groupId>com.smartbear.soapui</groupId>
   <artifactId>soapui-maven-plugin</artifactId>
   <version>5.0.0</version>

   <!– Change the name to identify –&gt;
   <configuration>
      <projectFile>src/test/resources/soapui/Soapui-auto-soapui-project.xml</projectFile>
      <!– Change the project file name –&gt;
      <outputFolder>target/surefire-reports</outputFolder>
      <!– Change the suite name –&gt;
      <junitReport>true</junitReport>
      <exportwAll>true</exportwAll>
      <printReport>true</printReport>
      <testFailIgnore>false</testFailIgnore>
      <projectProperties>
         <value>EnvName=${soapUiEnv}</value>
         <value>ServiceEndPoint=${ServiceEndPoint}</value>
         <value>TestReportPath=${project.build.directory}/surefire-reports/</value>
      </projectProperties>
      <soapuiProperties>
         <property>
            <name>soapui.properties</name>
            <value>src/test/resources/soapui/soapui-auto_data.properties</value>
         </property>
      </soapuiProperties>
   </configuration>
</plugin>

您需要创建一个测试套件并将其复制到“src/test/resources/soapui/”。在项目文件标签中指定路径并执行测试以运行应用程序运行命令“mvn com.smartbear.soapui:soapui-maven-plugin:5.0.0:test -DServiceEndPoint=http://localhost:8080”

您可以参考下面的博客文章,通过使用 Maven 插件进行 Spring Boot 应用程序的示例肥皂自动化进行解释。

于 2020-12-04T04:29:53.517 回答