您的位置:首页 > 其它

Espresso拦截不到Intent,Recorded intents:[]

2017-12-13 14:18 330 查看
使用Espresso Intent 测试时,Recorded intents一直是空的,一直找不到原因,折腾了几天才发现Espresso.Intents和Jpush有冲突,使用的是Jpush SDK3.0.8

Activity代码:



Espresso Intents UI测试代码:



报错

android.support.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: Wanted to match 1 intents. Actually matched 0 intents.

IntentMatcher: has component: has component with: class name: an instance of java.lang.String package name: an instance of java.lang.String short class name: is ".activity.PublishRepairActivity"

Matched intents:[]

Recorded intents:[]
at dalvik.system.VMStack.getThreadStackTrace(Native Method)


发现是Application中对Jpush进行了初始化造成的,具体为什么会有冲突,不太清楚



解决方案:

注释掉Jpush的初始化,再跑测试就通过了



发了几封邮件给极光,但并没有没有得到解决方案,可能目前国内不太注重自动化测试,懒得去折腾了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  espresso jpush