AWS DeviceFarm:如何访问传递给“ ScheduleRun” API的test.parameters

问题描述

有人知道如何访问作为输入传递给ScheduleRun API的test.parameters键-值对吗?

这就是我在做什么:

  1. 传递要在test.filter下运行的测试的输入。
  2. test.parameters下通过测试所需的参数。我确保它是有效的JSON对象。
  3. 我没有传递任何yaml文件,因此在DeviceFarm上触发了“标准”测试运行。

这是我用来检索数据的代码

final Bundle bundle = InstrumentationRegistry.getArguments();
for (final String key : bundle.keySet())
{
    final Object obj = bundle.get(key);
    Log.i(TAG,"Key - '" + key + "' ; Value - '" + obj.toString() + "'");
}

我知道test.filter部分有效是因为InstrumentationRegistry.getArguments()捆绑包能够检索class值,这是需要运行的测试。不幸的是,捆绑包中没有test.parameters值。

有什么我想念的东西吗?还是应该使用其他机制来检索test.parameters

解决方法

从AWS团队得到确认,目前他们不支持针对定制环境的此功能。