如何解决有没有办法在 Detox 中记录找到的值?
我正在尝试调试一些 Detox 测试,我有一些如下断言:
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 举报,一经查实,本站将立刻删除。