How to integrate cucumber-jvm with maven build

怎甘沉沦 提交于 2019-12-10 12:20:07

问题


i'm trying to put some bdd into my eclipse plugin project, but can't figure out how to run my integration tests during maven build fase. To write my tests i'm using SWTBot framework.

I already did the feature generation fase, and setup my tests. How do i setup my pom to run my integration tests?


回答1:


I use below configuration and run mvn clean verify. If you don't want to run tests in parallel, remove parallel, perCoreThreadCount and threadCountClasses tags. Make sure to update the regular expression to match your test naming convention <include>**/Run*.java</include>

             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <executions>
                    <execution>
                        <id>acceptance-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <outputEncoding>UTF-8</outputEncoding>
                            <parallel>classes</parallel>
                            <perCoreThreadCount>true</perCoreThreadCount>
                            <threadCountClasses>10</threadCountClasses>
                            <argLine>-Xmx1024m</argLine>
                            <argLine>-XX:MaxPermSize=256m</argLine>
                            <includes>
                                <include>**/Run*.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


来源:https://stackoverflow.com/questions/24252800/how-to-integrate-cucumber-jvm-with-maven-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!