在Android Espresso中如何匹配包含在Bundle中的Bundle的Intent?

3

我正在尝试匹配一个包含在bundle中的值(请参见图像)。

我需要验证是否设置了uriString="file:///storage/emulated...."

但是到目前为止,我的代码只能验证到value[1]="Benefits Card provied by"

intended(IntentMatchers.hasExtras(BundleMatchers.hasValue(hasExtras(BundleMatchers.hasValue("test - Prescription Card")))));

图片不再可见 - Ewoks
1个回答

0

虽然这可能是旧的并且可能已经解决了,但我认为值得注意的是尝试使用hasExtras与嵌套的hasEntry

对于像 -> extras: [Bundle[{key=Bundle[<more data>]}]] 这样的嵌套包,可以尝试 -> hasExtras(hasEntry(<key>), hasEntry(<key>, <arg>))


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接