我正在尝试匹配 bundle of bundle ( see image ) 中的值。
我需要验证 uriString="file:///storage/emulated...." 是否已设置。
但到目前为止,使用我的代码,我最多只能验证 value[1]="Benefits Card provided by"。
intended(IntentMatchers.hasExtras(BundleMatchers.hasValue(hasExtras(BundleMatchers.hasValue("test - Prescription Card")))));
最佳答案
虽然这是旧的并且可能已经解决了,但我认为尝试使用 hasExtras
是值得注意的。连同嵌套 hasEntry
.
对于嵌套包,如 -> extras: [Bundle[{key=Bundle[<more data>]}]]
可以试试 -> hasExtras(hasEntry(<key>), hasEntry(<key>, <arg>))
关于android-intent - Android espresso 匹配意图与 bundle 内的 bundle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40900334/