浓缩咖啡吐司搭配仅适用于Android 10(API级别29)

。 测试交流评论91字数 2040阅读模式
摘要用浓缩咖啡测试时。toast仅适用于Android 10。 onView(带文本(R.string.TOAST\u string)) .inRoot(withDecorView(n...

用浓缩咖啡测试时。toast仅适用于Android 10。

onView(withText(R.string.TOAST_STRING))
                .inRoot(withDecorView(not(getActivity().window.decorView)))
                .check(matches(isDisplayed()))

但是在android 11上,这不起作用。对我来说,它抛出了RootViewWithoutFocusException文章源自玩技e族-https://www.playezu.com/192023.html

androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: 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:
    Root{application-window-token=android.view.ViewRootImpl$W@6aa9ae4, window-token=android.view.ViewRootImpl$W@6aa9ae4, has-window-focus=false, layout-params-type=1, layout-params-string={(0,0)(fillxfill) ty=BASE_APPLICATION wanim=0x10302fe
      fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDS
      pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND FIT_INSETS_CONTROLLED
      fitSides=}, decor-view-string=DecorView{id=-1, visibility=INVISIBLE, width=1080, height=2340, has-focus=false, has-focusable=false, 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={(0,0)(fillxfill) ty=BASE_APPLICATION wanim=0x10302fe
      fl=LAYOUT_IN_SCREEN LAYOUT_INSET_DECOR SPLIT_TOUCH HARDWARE_ACCELERATED DRAWS_SYSTEM_BAR_BACKGROUNDS
      pfl=FORCE_DRAW_STATUS_BAR_BACKGROUND FIT_INSETS_CONTROLLED
      fitSides=}, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}}
        at dalvik.system.VMStack.getThreadStackTrace(Native Method)
        at java.lang.Thread.getStackTrace(Thread.java:1736)
        at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:12)
        at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:7)
        at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:8)
        at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:12)
        at com.example.asapandroid.kbTests.SubCategoryPageTest.noNetworkToastShownWhenThereIsNoNetwork(SampleTest.kt:37)

请有人帮我做这个。检查android 11及更高版本上是否显示祝酒词。文章源自玩技e族-https://www.playezu.com/192023.html

软件测试设计文章源自玩技e族-https://www.playezu.com/192023.html 文章源自玩技e族-https://www.playezu.com/192023.html

玩技站长微信
添加好友自动发送入群邀请
weinxin
rainbow-shownow
玩技官方公众号
官方微信公众号
weinxin
PLAYEZU
 
  • 版权提示:本站仅供存储任何法律责任由作者承担▷诈骗举报◁▷新闻不符◁▷我要投稿◁
    风险通知:非原创文章均为网络投稿真实性无法判断,侵权联系2523030730
    免责声明:内容来自用户上传发布或新闻客户端自媒体,切勿!切勿!切勿!添加联系方式以免受骗。
  • 原创转载:https://www.playezu.com/192023.html
    转载说明: 点我前往阅读>>>
匿名

发表评论

匿名网友
确定