1

我正在使用 maven soapui pro 插件来运行测试套件。我想使用 groovy 脚本来创建测试用例所需的唯一数据。如何在 pom 中指定 groovy 脚本的路径以获取唯一数据?

当前的 pom 有以下插件:

<plugin>
                <groupId>eviware</groupId>
                <artifactId>maven-soapui-pro-plugin</artifactId>
                <version>4.0.0</version>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <projectFile>src/test/resources/CIAM-Integration-test-suite-soapui-project.xml</projectFile>
                            <outputFolder>${project.build.directory}/soapui-reports</outputFolder>
                            <!-- <endpoint>${thirdpartyinventory.service.endpoint}</endpoint>  -->
                            <printReport>true</printReport>
                            <junitReport>true</junitReport>
                            <!-- <projectProperties>
                                <value>message=Hello World!</value>
                                <value>jdbcString=${thirdpartyinventory.jdbcString}</value>
                            </projectProperties> -->
                            <soapuiProperties>
                                <property>
                                    <name>soapui.logroot</name>
                                    <value>${project.build.directory}/soapui-logs/</value>
                                </property>
                                 <property>
                                        <name>soapui.scripting.library</name>
                                        <value>src/test/resources/B2C.groovy</value>
                                 </property>
                            </soapuiProperties>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>jgoodies</groupId>
                        <artifactId>looks</artifactId>
                        <version>2.2.0</version>
                    </dependency>
                    <dependency>
                        <groupId>fife</groupId>
                        <artifactId>rsyntaxtextarea</artifactId>
                        <version>1.3.4</version>
                    </dependency>
                    <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.4</version>
                    </dependency>
                    <dependency>
                        <groupId>hsqldb</groupId>
                        <artifactId>hsqldb</artifactId>
                        <version>1.8.0.10</version>
                        <type>jar</type>
                    </dependency>
                    <dependency>
                        <groupId>com.oracle</groupId>
                        <artifactId>ojdbc14</artifactId>
                        <version>10.2.0.3.0</version>
                        <type>jar</type>
                    </dependency>
                </dependencies>
            </plugin>
4

1 回答 1

1

能够解决问题。

这是 pom 中的一个简单更改:

以前的代码:

<soapuiProperties>
                                <property>
                                    <name>soapui.logroot</name>
                                    <value>${project.build.directory}/soapui-logs/</value>
                                </property>
                                 <property>
                                        <name>soapui.scripting.library</name>
                                        <value>src/test/resources/B2C.groovy</value>
                                 </property>
                            </soapuiProperties>

更改代码:

 <soapuiProperties>
                                <property>
                                    <name>soapui.logroot</name>
                                    <value>${project.build.directory}/soapui-logs/</value>
                                </property>
                                 <property>
                                        <name>soapui.scripting.library</name>
                                        <value>src/test/resources</value>
                                 </property>
                            </soapuiProperties>
于 2013-01-14T03:58:19.067 回答