Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testID prop on FontAwesomeIcon cannot be used to select the element in detox e2e test #142

Open
RonaldvdH opened this issue Aug 15, 2022 · 5 comments

Comments

@RonaldvdH
Copy link

Describe the bug
I have refactored the icons in my app to use the "FontAwesomeIcon" from @fortawesome/react-native-fontawesome. The type shows an optional testID prop, but when i fill it Detox cannot find it.

Reproducible test case
Run and build the detox react-native example https://github.com/wix/Detox/tree/master/examples/demo-react-native
add one fontAwesomeIcon and try to select it with the testID

Expected behavior
I expect the testID to work with test runners like Detox with the FontAwesomeIcon

Desktop (please complete the following information):
OS: macOS 12.5
CPU: (10) arm64 Apple M1 Max
Memory: 403.17 MB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.19 - ~/.yarn/bin/yarn
npm: 8.16.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.12 - /opt/homebrew/opt/openjdk@11/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.69.3 => 0.69.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Tested on iOS simulator.

Additional context
I have fixed my tests after the refactor to wrap all the icons with a View component or something that was fitting to the situation so the testID is not directly on the icon component.

@amithrchandran
Copy link

We can please fix this ? I'm also facing the same issue

@ghostgarrix
Copy link

Same here

1 similar comment
@mmessali
Copy link

Same here

@laurielabergepetalmd
Copy link

We have the same problem!

@jahirfiquitiva
Copy link

Same issue here, using jest and @testing-library/react-native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants