【问题标题】:Running multiple testsuites of single soapUi project in maven在 Maven 中运行单个soapUi项目的多个测试套件
【发布时间】:2023-04-07 05:30:02
【问题描述】:

我想在一次执行 maven 时从我的项目中运行多个测试套件。不知何故多次运行不成功。

如果我添加两个具有相同测试目标的执行,则每个测试套件都单独运行。

<executions>
                <execution>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <projectFile>soapui-project.xml</projectFile>
                        <testSuite>SOAPTests1</testSuite>
                    </configuration>
                </execution>
                <execution>
                    <goals>
                        <goal>test</goal>
                    </goals>
                    <configuration>
                        <projectFile>soapui-project.xml</projectFile>
                        <testSuite>SOAPTests2</testSuite>
                    </configuration>
                </execution>
            </executions>           

但是我想以单次执行或比上述更好的方式运行,因为我有很多不同的测试套件要运行,如果我所有的测试套件都像上面那样,那只会让我的文件看起来很长.

我希望我的 pom.xml 看起来像这样:

    <execution>
        <goals>
            <goal>test</goal>
        </goals>
    <configuration>
        <projectFile>LocalAdapa-soapui-project.xml</projectFile>
        <testSuite>SOAPTests1</testSuite>
        <testSuite>SOAPTests2</testSuite>
        <testSuite>SOAPTests3</testSuite>
    </configuration>
</execution>

【问题讨论】:

  • 您希望自己执行项目以使其更简单?
  • 是的,正确的。如上所述,我可以执行两次,但想知道是否有其他更好的方法
  • 如果删除所有testSuite 元素会怎样?
  • 如果我删除所有 testSuite 元素,所有测试都按 testSuite 名称的字母顺序运行。这就是我需要一个解决方案以正确顺序运行所有测试套件的地方
  • 我遵循的经验法则是每个测试用例应该是独立的,因此作为测试套件,不应该依赖于执行顺序。下单有什么原因吗?

标签: maven soapui pom.xml test-suite


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2014-11-23
    • 2012-02-29
    • 2012-04-12
    • 2015-11-18
    • 1970-01-01
    • 2019-05-05
    • 1970-01-01
    • 1970-01-01
    • 2014-03-25
    相关资源
    最近更新 更多