Bar*_*rak 5 android android-espresso react-native detox
我尝试使用 detox 检查该元素是否在 android 模拟器中可见。我滚动页面并查看元素,但是当我使用 detox 检查元素是否可见时,我收到此错误:
Test Failed: 'at least 75 percent of the view's area is displayed to the user.' doesn't match the selected view.
Expected: at least 75 percent of the view's area is displayed to the user.
Got: "ReactViewGroup{id=1227, visibility=VISIBLE, width=250, height=250, 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@a376217, tag=test1, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=95.0, child-count=1}"
Run Code Online (Sandbox Code Playgroud)
我试图滚动更多以将元素放在屏幕中间,但没有区别。
await expect(element(by.id('test1')).atIndex('2')).toBeVisible();
Run Code Online (Sandbox Code Playgroud)
我使用 react-native 所以它是相同的代码..,它与 iOS 完美配合,但在 android 中,我得到了我提到的错误。
* detox 是使用 android-espresso 的 react-native 的 e2e 测试库
就我而言,事实证明,我在本地拥有比 CI 更大的设备。因此,当我使用失败的屏幕截图时--take-screenshots failing
,我注意到,测试的视图位于绝对视图下方,并且被覆盖。IDK,如果它与上述问题相关,但也许它会对其他人有所帮助。
归档时间: |
|
查看次数: |
958 次 |
最近记录: |