Describe the bug
I am using RN 0.59 with react-navigation 3. I defined a very simple test, to find a button on the screen, and tap it. The button is found (first test passes), but the actual tapping doesn't work. In fact, when I have the iOS simulator open when running the test, I see that Detox attempts to tap the button, but nothing happens. Manually tapping the button with the mouse after the test finishes also doesn't work. It seems the input mode on the simulator is changed? Instead of my mouse cursor, I see a circle? That might be normal though, I only started using Detox recently, so I have no pre-RN 0.59 comparison, or even a test that does work in a different place.
Expected behavior
Tap should work
Screenshots

Environment (please complete the following information):
The circle is the visual indicator we use for Detox.
But if you say touches are not accepted even when you manually click, it sounds to me like a bug in your app? Are all touches not accepted or is it just on that specific button?
I got the same behavior. I'm not sure if detox alone is to blame here, but it definitely changes something and react-navigation (or react-native-gesture-handler) behaves differently.
I created a reproducable demo app. https://github.com/dadish/detox_react_navigation
To see the difference in behavior:
cd to it's directory.yarn install.detox build.react-native startreact-native run-ios --simulator "iPhone 7"detox test.Don't know why and how detox prevents react-navigation function properly. But it seems like it contributes to it.
Detox sends native touch events. We do not use either of these two libraries, but if those changed, it sounds like a bug in their handling. We've seen issues with these libraries before and they were library related. See e.g. https://github.com/wix/Detox/issues/1207
I'm wondering if it's not the same issue that I have.
When I try to navigate to a screen with the Detox, react-navigation doesn't navigate to the screen. Works with switchNavigator but it doesn't work with stackNavigator. It's kind of weird.
@LeoNatan What I meant was, when I manually click _after the test completes_ and the visual indicator still shows, it doesn't work. If I restart the app outside of detox, the button works fine.
@dadish Thanks for actually isolating it into a reproducible demo, I didn't have the time to do that earlier, but that is _exactly_ the issue I'm seeing.
@alexmngn Well, that might also be it. The only action linked to that button is the navigate.
can someone please try to provide a reproducible example without using react-navigation at all? i think the only reason it is being mentioned here is because it uses react-native-gesture-handler. you should be able to reproduce react-navigation's usage of react-native-gesture-handler but just wrapping a view in a pangesturehandler and then putting your button inside of that view.
@brentvatne I updated the example __without__ react-navigation. Only react-native-gesture-handler.
https://github.com/dadish/detox_react_navigation
You can follow the same steps as above. Before detox test, you should be able to drag around a plum colored square. Then run detox test, after it's finished, you won't be able to drag it anymore.
Then it must be a bug in RNGH and should open an issue there. Detox sends native touches and has no relation to whatever JS runs in RNGH.
If you provide specific information on what is confusing RNGH, it is possible to investigate, but most likely the issue is on their side, or RN itself.
Guys, when investigating #1234, we found that in RN59, If Detox is attached, RN thinks its in testing mode and disables some functionality. I wonder if that is not a cause of some of the issues here. I'll release 12.1 soon with the fix for #1234. Please test if it helps with other issues discussed here.
Confirmed! Updated detox to latest and the issue is gone. Both on my own app and the demo app I created for this issue. Thanks a lot on your efforts @LeoNatan!
Great!, thanks for the update.
I can also confirm that this works as expected now. Thank you very much @LeoNatan!
Most helpful comment
Guys, when investigating #1234, we found that in RN59, If Detox is attached, RN thinks its in testing mode and disables some functionality. I wonder if that is not a cause of some of the issues here. I'll release 12.1 soon with the fix for #1234. Please test if it helps with other issues discussed here.