Cannot tap on Switch Component in e2e tests on iOS
See original GitHub issueDescription: I’ve reported the issue in the detox repo over here: https://github.com/wix/Detox/issues/1896 thinking that it’s something related to detox, but it seems more like a bug in RN core.
Basically I have a detox test that fails randomly on the press of a Switch component. I can see the tap on the component, but the Switch is not responding. It seems to happen in around 20% of the cases.
Here is a gif:
That first tap wasn’t registered - all the other went fine.
Here is the repo that demonstrates the issue: https://github.com/compojoom/rnDetoxActionSheetBug/tree/switch-bug
after cloning run
$ yarn
$ detox build -c ios.sim.debug
$ detox build -c ios.sim.debug
If the test succeeds - rerun it several times.
As it can be seen from the js code: https://github.com/compojoom/rnDetoxActionSheetBug/blob/switch-bug/App.js#L29;L57 - it’s a pure RN app with just the Switch component on the screen.
Running the same test on android succeeds in 100% of the cases.
Moreover I’ve done the same test on a Native iOS app and there tapping on the switch component is always registered. So that’s why I’m excluding detox as the reason for the bug. Here is a link to the native project that doesn’t have this issue: https://github.com/compojoom/SwitchDetoxNative
React Native version:
$ react-native info info Fetching system and libraries information… System: OS: macOS 10.15.3 CPU: (16) x64 Intel® Core™ i9-9980HK CPU @ 2.40GHz Memory: 1.26 GB / 32.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 13.6.0 - /usr/local/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1 Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.0, 29.0.2 System Images: android-24 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom Android NDK: 19.0.5232133 IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5 npmGlobalPackages: create-react-native-module: 0.11.1 react-native-cli: 2.0.1
Steps To Reproduce
Please refer to the provided repository above.
Expected Results
I expect that the Switch component will respond to taps all the time in e2e tests.
Snack, code example, screenshot, or link to a repository:
Everything is provided in the description above
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8 (2 by maintainers)
Top GitHub Comments
Try
longPress
- I faced the same issuehttps://github.com/wix/Detox/blob/master/docs/APIRef.ActionsOnElement.md#longpressduration
ok, so longPress is the workaround? But we so far agree that this is a bug?