无法让AWS设备场识别我的功能文件 [英] Cannot get my features files recognized by aws device farm

查看:98
本文介绍了无法让AWS设备场识别我的功能文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用设备场运行我的黄瓜项目时遇到问题。
我收到此错误:

I am having an issue running my cucumber project with device farm. I am getting this error:

[TestNG]原因:java.lang.IllegalArgumentException:不是文件或目录:/tmp/scratchheDEgq.scratch/ test-packagex5ZhYf / src / test / java / cucumber / features

[TestNG] Caused by: java.lang.IllegalArgumentException: Not a file or directory: /tmp/scratchheDEgq.scratch/test-packagex5ZhYf/src/test/java/cucumber/features

我从此消息中了解到,我的项目中features目录的路径存在问题,但在本地

I understand from this message that there is an issue with the path of the features directory in my project but locally it works.

这就是我将其放入代码中的方式:

This is how I put it in my code:

@CucumberOptions(features = src / test / java / cucumber / features,胶水= cucumber.steps)

@CucumberOptions(features = "src/test/java/cucumber/features", glue = "cucumber.steps")

我应该提供一条不同的设备场路径吗?我在这里错过了什么?

Should I provide a different path to device farm? What am I missing here?

谢谢

推荐答案

默认情况下, * -test.jar文件不包含 src / test / java / cucmber 目录(如果项目中存在)。尝试将功能文件放在 src / test / resources 目录中,如Device Farm示例项目所示。

By default the src/test/java/cucmber directory(if it exists in the project) is not included the *-test.jar file. Try putting the feature files in the src/test/resources directory as shown in the Device Farm sample project.

> https://github.com/aws-samples/aws-device-farm-appium-cucumber-tests-for-sample-app/tree / master / src / test / resources / LoginTest

或者,您可以在pom.xml中实现testResources标记,以明确引用除src /之外的其他目录。假设我们使用的是Maven:

Alternatively, you can implement the testResources tags in the pom.xml to explicitly reference another directory besides src/test/resources assuming that we're using maven:

<testResources>
     <testResource>
        <directory>${project.basedir}/src/test/YOUR_DIRECTORY_HERE</directory>
     </testResource>
</testResources>

查看此链接以获取有关testResources标签
https://maven.apache.org/pom.html#Resources

Check out this link for more info on the testResources tag https://maven.apache.org/pom.html#Resources


testResources:testResources元素块包含testResource元素。它们的定义类似于资源元素,但在测试阶段自然会使用。一个区别是项目的默认(定义为Super POM)测试资源目录为$ {basedir} / src / test / 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

-James

这篇关于无法让AWS设备场识别我的功能文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆