【问题标题】:The xml file is rejected while using AWS Device farm for testingxml 文件在使用 AWS 设备场进行测试时被拒绝
【发布时间】:2017-08-02 16:46:49
【问题描述】:

由于我是AWS设备场的初学者,通过我的测试,最大的障碍是,AWS设备场执行测试目录中的所有测试用例。但我只在xml文件中给出了特定的测试用例。那是我的项目不需要全部那时要运行的测试用例。有人可以帮助我吗?

【问题讨论】:

    标签: amazon-web-services appium


    【解决方案1】:

    我在 AWS Device Farm 团队工作。 从您的描述看来,您正在使用 TestNG 框架。

    1. 正如你所说,你所有的测试都应该在 src/test 下。

    2. 您的 testng.xml 需要位于按照文档 here 中提到的步骤创建的 tests.jar 的根目录中

    3. 如果您不知道如何将 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> 
      
    4. 目前并非所有功能(例如使用 testng.xml 对测试进行排序)都受支持,但您可以确定在 testing.xml 中确定要运行哪些测试,这似乎是您的主要要求。

    【讨论】:

    • 嗨...谢谢 nikof.. 我已将 testng xml 文件放入测试 jar。但它似乎无法正常工作 @NikofTime 。还有什么我需要设置的吗?
    • 您能分享一下 testng.xml 文件的外观吗?目前,我们仅支持基本功能,例如根据您在 testng.xml 中提到的内容过滤测试。不支持组和参数。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-03
    相关资源
    最近更新 更多