空手道测试在src / test

时间:2019-04-26 20:47:04

标签: cucumber karate cucumberjs

我想将空手道测试从src / test移到新文件夹src / it,因为将集成测试与单元测试分开对我来说很有意义。

有可能吗?

我试图将Java类放在src / it / java中,并将功能放在src / it / resources中,并且运行空手道测试,但没有测试用例。

谢谢。

1 个答案:

答案 0 :(得分:1)

使用Maven插件解决了问题,添加了src / it / java作为测试源和src / it / resources作为测试资源:

            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.5</version>
            <executions>
                <execution>
                    <id>add-test-source</id>
                    <goals>
                        <goal>add-test-source</goal>
                    </goals>
                    <configuration>
                        <sources>
                            <source>src/it/java</source>
                        </sources>
                    </configuration>
                </execution>
                <execution>
                    <id>add-test-resource</id>
                    <goals>
                        <goal>add-test-resource</goal>
                    </goals>
                    <configuration>
                        <resources>
                            <resource>
                                <directory>src/it/resources</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>