Skip to content

Cannot tap on Switch Component in e2e tests on iOS #28032

@compojoom

Description

@compojoom

Description:
I've reported the issue in the detox repo over here: wix/Detox#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:
flacky-switch

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(R) Core(TM) 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: SwitchIssue: Author Provided ReproThis issue can be reproduced in Snack or an attached project.Platform: iOSiOS applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions