I have a screen with a ScrollView and a Button which is in the very bottom and is partially visible, i.e. top part of the button is in the screen, but the title is not visible, unless I scroll down:
expect(element(by.id(BUTTON_IN_THE_BOTTOM))).toBeVisible()
=> the matcher fails.
element(by.id(BUTTON_IN_THE_BOTTOM)).tap()
=> all is good, button is tapped.
This seems to be an inconsistency and I would think that the framework should be consistent in such behaviors. Is this the expected behavior?
was using detox 7.3.2
Most likely an inconsistency between matchers in Earl Grey, our iOS backend framework.
Regardless, you are asking for trouble by not scrolling. The position on screen is dependent on several factors, including device size, RN layout system and the OS layout system and content. You should not really make assumptions about pixel accuracy. By not scrolling the button the visible, you are introducing flakiness where there shouldn't be.