react-native-owl: [Expo] All commands that deal with testID elements do not work
Hey-hey
Thanks for such a promising tool. Installation & setup was pretty easy.
Taking & comparing screenshots work flawlessly, but any action that needs element(press
, longPress
, changeText
, toExist
) matching throws error Failed: "Element not found: ZZZZZZZ"
.
Relevant for both iOS & Android, release build(can’t try debug as i’m using Expo custom dev client). What could be the problem and how to debug it?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (9 by maintainers)
Thanks both. I’ll have to look into this further once I get back on my laptop, as in travelling at the moment.
There are example projects at https://github.com/manosim/react-native-owl-demo and in the example directory of this repo that both demonstrate the functionality, so I’m not sure what’s causing the issue. Perhaps you can spot some omission from the setup docs that is causing the problem?
I’ll try what you suggested @simonedif and create a new RN 0.68.2 project and see if I encounter the same issue.
This is the correct babel config I found:
How did I find it ?
I went in
babel-expo-preset
and I commented all extra presets and plugins : https://github.com/expo/expo/blob/b783fcc4964b6bfe55ea15893b457a3de5abf3a1/packages/babel-preset-expo/index.js#L47-L116I uncommented each presets and plugins one by one and found that
@babel/plugin-transform-react-jsx
was the problem : https://github.com/expo/expo/blob/b783fcc4964b6bfe55ea15893b457a3de5abf3a1/packages/babel-preset-expo/index.js#L47-L58Changing the value from
automatic
toclassic
fixed the issue. I’m still investigating why 🧐Thanks for the hint. Could You please show full
babel.config.js
source?'module:metro-react-native-babel-preset'
is the part of already existing'babel-preset-expo'
preset, so it conflicts for me if added after expo preset.Thanks, @robwalkerco Sorry for the late reply - just to confirm I did follow the demo project and I managed to get the library working. Unfortunately, we still experiencing the issue of using the library with our project. As soon we will be able to find the resolution I will let you know. many thanks for your help!!
Hi, in my Expo project I just added in the presets (babel.config.js)
'module:metro-react-native-babel-preset'
and it’s works.@simonedif I’ve just run the example at https://github.com/manosim/react-native-owl-demo after updating the
react-native-owl
dependency to1.0.0
and it all works as expected.I think there are quite a few assumptions made regarding jest and typescript setup in the Owl docs, which perhaps make the setup not so simple for a new RN install.
I’d suggest you test out https://github.com/manosim/react-native-owl-demo as well and compare the setup with what you have currently. If you get your tests working, I’d love it if you were able to feedback on any additional setup steps required that we have missed.