在cucumber中执行测试用例之前,需要将特征文件复制到某个位置
存在要素文件的某些指定位置。需要将这些文件复制到在cucumber中执行测试用例之前,需要将特征文件复制到某个位置,cucumber,cucumber-java,cucumber-serenity,Cucumber,Cucumber Java,Cucumber Serenity,存在要素文件的某些指定位置。需要将这些文件复制到 src/test/resources/ 作为自动化的一部分,在执行测试用例之前 我试着用 @BeforeClass //java code to do copying of files from one location to other 但是Cucumber首先扫描所有功能文件。因此,由于找不到下面提到的任何特征文件,因此失败 @CucumberOptions(features = "src/test/resources/subscrip
src/test/resources/
作为自动化的一部分,在执行测试用例之前
我试着用
@BeforeClass
//java code to do copying of files from one location to other
但是Cucumber首先扫描所有功能文件。因此,由于找不到下面提到的任何特征文件,因此失败
@CucumberOptions(features = "src/test/resources/subscription.feature")
使用
验证阶段的maven资源插件
复制功能文件,根据您的配置更改输出目录
和资源目录
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!-- Destination folder -->
<outputDirectory>${basedir}\src\test\resources\features</outputDirectory>
<resources>
<resource>
<!-- Source folder -->
<directory>E:\.....\nonresource</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
maven资源插件
3.0.2
复制资源
验证
复制资源
${basedir}\src\test\resources\features
E:\…\n来源
您是如何执行这些测试的?Maven?是的。。。使用maven