我正在使用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>
答案 0 :(得分: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>