问题描述
await expect(eventScreenMatcher.component).toExist();
await expect(eventScreenMatcher.toggleButton).toExist();
await expect(eventScreenMatcher.toggleButton).toHaveText('Add to schedule');
我认为是 toggleButton
的按钮显示在屏幕上并且具有正确的文本 Add to schedule
。但 Detox 在最后一个断言上失败了。
Detox 如何确定文本是什么(它是否只检查该元素)以及是否有办法记录它认为存在的内容?
这是我目前得到的输出:
预期:(文本:是“添加到计划”并且视图具有有效可见性=可见) 得到:“ReactViewGroup{id=4605,visibility=VISIBLE,width=1300,height=139,has-focus=false,has-focusable=true,has-window-focus=true,is-clickable=true,is-enabled =true,is-focused=false,is-focusable=true,is-layout-requested=false,is-selected=false,layout-params=android.view.ViewGroup$LayoutParams@34f98eb,tag=ToggleScheduleButton,root-is -layout-requested=false,has-input-connection=false,x=0.0,y=0.0,child-count=1}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)