【发布时间】:2021-08-26 14:38:25
【问题描述】:
我正在尝试调试一些排毒测试,我有一些如下断言:
await expect(eventScreenMatcher.component).toExist();
await expect(eventScreenMatcher.toggleButton).toExist();
await expect(eventScreenMatcher.toggleButton).toHaveText('Add to schedule');
我认为是toggleButton 的按钮在屏幕上,并且有正确的文本Add to schedule。但是 Detox 在最后一个断言上失败了。
Detox 如何确定文本是什么(它只是检查那个元素),有没有办法记录它认为存在的内容?
这是我目前得到的输出:
预期:(带有文本:是“添加到计划”并且视图具有有效可见性=VISIBLE) 得到:“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}
【问题讨论】:
标签: javascript end-to-end detox