问题描述
有人知道如何访问作为输入传递给ScheduleRun API的test.parameters
键-值对吗?
这就是我在做什么:
- 传递要在
test.filter
下运行的测试的输入。 - 在
test.parameters
下通过测试所需的参数。我确保它是有效的JSON对象。 - 我没有传递任何
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团队得到确认,目前他们不支持针对定制环境的此功能。