【发布时间】:2017-08-02 16:46:49
【问题描述】:
由于我是AWS设备场的初学者,通过我的测试,最大的障碍是,AWS设备场执行测试目录中的所有测试用例。但我只在xml文件中给出了特定的测试用例。那是我的项目不需要全部那时要运行的测试用例。有人可以帮助我吗?
【问题讨论】:
标签: amazon-web-services appium
由于我是AWS设备场的初学者,通过我的测试,最大的障碍是,AWS设备场执行测试目录中的所有测试用例。但我只在xml文件中给出了特定的测试用例。那是我的项目不需要全部那时要运行的测试用例。有人可以帮助我吗?
【问题讨论】:
标签: amazon-web-services appium
我在 AWS Device Farm 团队工作。 从您的描述看来,您正在使用 TestNG 框架。
正如你所说,你所有的测试都应该在 src/test 下。
您的 testng.xml 需要位于按照文档 here 中提到的步骤创建的 tests.jar 的根目录中
如果您不知道如何将 testng xml 放入测试 jar,一种方法是在 pom.xml 中设置一个目标,如下所述
<plugin>
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
目前并非所有功能(例如使用 testng.xml 对测试进行排序)都受支持,但您可以确定在 testing.xml 中确定要运行哪些测试,这似乎是您的主要要求。
【讨论】: