无法让 aws device farm 识别我的功能文件
Cannot get my features files recognized by aws device farm
我有一个问题 运行 我的设备农场黄瓜项目。
我收到此错误:
[TestNG] 原因:java.lang.IllegalArgumentException:不是文件或目录:/tmp/scratchheDEgq.scratch/test-packagex5ZhYf/src/test/java/cucumber/features
我从这条消息中了解到,我的项目中的功能目录路径存在问题,但它在本地有效。
我在代码中是这样写的:
@CucumberOptions(features = "src/test/java/cucumber/features", glue = "cucumber.steps")
我应该提供不同的设备农场路径吗?我在这里错过了什么?
谢谢
默认情况下,src/test/java/cucmber
目录(如果它存在于项目中)不包含在 *-test.jar 文件中。尝试将功能文件放在 src/test/resources
目录中,如 Device Farm 示例项目所示。
或者,您可以在 pom.xml 中实现 testResources 标记,以显式引用除 src/test/resources 之外的另一个目录,假设我们使用的是 maven:
<testResources>
<testResource>
<directory>${project.basedir}/src/test/YOUR_DIRECTORY_HERE</directory>
</testResource>
</testResources>
查看此 link 以获取有关 testResources 标签的更多信息
https://maven.apache.org/pom.html#Resources
testResources: The testResources element block contains testResource elements. Their definitions are similar to resource elements, but are naturally used during test phases. The one difference is that the default (Super POM defined) test resource directory for a project is ${basedir}/src/test/resources. Test resources are not deployed.
HTH
-詹姆斯
我有一个问题 运行 我的设备农场黄瓜项目。 我收到此错误:
[TestNG] 原因:java.lang.IllegalArgumentException:不是文件或目录:/tmp/scratchheDEgq.scratch/test-packagex5ZhYf/src/test/java/cucumber/features
我从这条消息中了解到,我的项目中的功能目录路径存在问题,但它在本地有效。
我在代码中是这样写的:
@CucumberOptions(features = "src/test/java/cucumber/features", glue = "cucumber.steps")
我应该提供不同的设备农场路径吗?我在这里错过了什么?
谢谢
默认情况下,src/test/java/cucmber
目录(如果它存在于项目中)不包含在 *-test.jar 文件中。尝试将功能文件放在 src/test/resources
目录中,如 Device Farm 示例项目所示。
或者,您可以在 pom.xml 中实现 testResources 标记,以显式引用除 src/test/resources 之外的另一个目录,假设我们使用的是 maven:
<testResources>
<testResource>
<directory>${project.basedir}/src/test/YOUR_DIRECTORY_HERE</directory>
</testResource>
</testResources>
查看此 link 以获取有关 testResources 标签的更多信息 https://maven.apache.org/pom.html#Resources
testResources: The testResources element block contains testResource elements. Their definitions are similar to resource elements, but are naturally used during test phases. The one difference is that the default (Super POM defined) test resource directory for a project is ${basedir}/src/test/resources. Test resources are not deployed.
HTH
-詹姆斯