提问者:小点点

如何为Cucumber场景执行SoapUI测试用例?


我在Eclipse中有一个带有Maven、Cucumber、SoapUI和JUnit的项目。我已经能够成功构建它而没有错误(耶!我是Maven、SoapUI和Cucumber的新手)。这个项目有一个包含两个场景的Cucumber功能文件。我在pom. xml文件中对SoapUI进行了以下配置

   .
   .
   <pluginRepositories>
        <pluginRepository>
            <id>smartbear-sweden-plugin-repository</id>
            <url>http://www.soapui.org/repository/maven2/</url>
        </pluginRepository>
   </pluginRepositories>
   <build>
     <plugins>
       <plugin>
          <groupId>com.smartbear.soapui</groupId>
          <artifactId>soapui-pro-maven-plugin</artifactId>
          <version>4.6.1</version>
       <executions>
          <execution>
           <phase>test</phase>
           <goals>
               <goal>test</goal>
           </goals>
           <configuration>
               <projectFile>soapui-project.xml</projectFile>
               <outputFolder>soapuiOut</outputFolder>
               <junitReport>true</junitReport>
              <exportwAl>true</exportwAl>
               <printReport>false</printReport>
           </configuration>
          </execution>
       </executions>
     </plugin>
     .
     .

目前当我使用maven构建它时,它运行了整个SoapUI项目,其中包含所有测试用例。我想将SoapUI中的两个测试用例链接到feature文件中的两个场景。是否可以在场景的测试步骤定义中运行SoapUI测试套件中的单个测试用例?只有当与其相关的SoapUI测试用例通过时,该场景才应该通过。


共1个答案

匿名用户

问:是否可以在场景的测试步骤定义中从SoapUI测试套件运行单个测试用例?

答:当然,在您的配置中使用testCase,按照这里的留档:http://www.soapui.org/Test-Automation/maven-2x.html#5-1-test-settings

一个小评论:你提到你是Maven的新手。如果你想让你的项目更加Maven化,把你的soapui-project. xml放在src/test/soapui中,并相应地调整你的pom.xml。