在jenkins android模拟器上运行测试

时间:2020-03-25 09:05:18

标签: android jenkins android-espresso

我正在设置Jenkins服务器。

每当我在分支上进行推送时,我都希望构建并运行我的Kespresso测试。

我正在使用android模拟器jenkins插件。模拟器启动,然后詹金斯构建APK,然后我启动了connectedAndroidTest。 它启动测试,但我总是遇到此错误:

09:53:51 > Task :app:connectedDevDebugAndroidTest
09:55:41 Starting 26 tests on hudson_en-US_400_1920x1080_android-24_armeabi-v7a(AVD) - 7.0

ItemCategoryTest > testItemCategoryIntegrity[hudson_en-US_400_1920x1080_android-24_armeabi-v7a(AVD) - 7.0] [31mFAILED [0m
09:56:58    java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
09:56:58    Root{application-window-token=android.view.ViewRootImpl$W@22cb195, window-token=android.view.ViewRootImpl$W@22cb195, has-window-focus=false, layout-params-type=1, layout-params-string=WM.LayoutParams{(0,0)(fillxfill) ty=1 fl=#81e90181 pfl=0x20000 wanim=0x1030465 vsysui=0x2000 needsMenuKey=2}, decor-view-string=DecorView{id=-1, visibility=VISIBLE, width=1080, height=1920, has-focus=true, has-focusable=true, has-window-focus=false, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=WM.LayoutParams{(0,0)(fillxfill) ty=1 fl=#81e90181 pfl=0x20000 wanim=0x1030465 vsysui=0x2000 needsMenuKey=2}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=2}}

似乎没有找到视图,但我不知道为什么。

如果有人遇到问题,我很乐意获得帮助

谢谢

0 个答案:

没有答案