I tried to check with detox if the element is visible with android emulator. I scroll my page and see the element but when I check with detox if the element is visible I get this error:
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}"
I tried to scroll more to put the element in the middle of the screen, but there is no difference.
await expect(element(by.id('test1')).atIndex('2')).toBeVisible();
I use react-native so it's the same code.., and It works perfectly with iOS but in android, I get the Error that I mention.
*detox is e2e testing library for react-native that use android-espresso
In my case, it turned out, that locally I had bigger device than CI had. So when I did a failing screenshot using
--take-screenshots failing
I noticed, that tested view was beneath the absolute view and it was covered. IDK, if it is related to above issue, but maybe it will help someone else.