Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在React Native中使用Detox测试第三方库组件?_Android_Reactjs_React Native_Detox - Fatal编程技术网

Android 如何在React Native中使用Detox测试第三方库组件?

Android 如何在React Native中使用Detox测试第三方库组件?,android,reactjs,react-native,detox,Android,Reactjs,React Native,Detox,我有一个组件代码示例: import { Button } from 'react-native-elements' ... ... render() { return( <View> <Button testID='testButton' ... /> </View> ) } 对于普通按钮,测试工作正常。对于第三方按钮,我只使用了react native elements,测试失败并显示: Error: Error p

我有一个组件代码示例:

import { Button } from 'react-native-elements'
...

...
render() {
  return(
    <View>
      <Button testID='testButton' ... />
    </View>
  )
}
对于普通按钮,测试工作正常。对于第三方按钮,我只使用了
react native elements
,测试失败并显示:

Error: Error performing 'single click' on view '(with tag value: is "testButton" and view has effective visibility=VISIBLE)'.
我尝试与按钮的文本匹配,但也失败并显示(
addproduct
为按钮标题/文本):

由于本机按钮正在传递,我理解需要对第三方组件执行不同的操作。我有自己的自定义组件,我通过将
testID
发送到
react-native
组件来处理这些组件,它们可以工作。我不知道如何用第三方组件解决这个问题


我在Android上运行它

除非第三方组件允许您通过testID道具,否则您将无法做到这一点。然而,它确实说,这确实从
TouchableOpacity
/
TouchableNativeFeedBack
中获得了道具,所以应该是可用的。RRY离开了一段时间,但我明白你的意思
TouchableWithoutFeedback
采用
testID
prop。谢谢我将很快试用,并尝试在此处发布答案/更新
Error: Error performing 'single click' on view '(with tag value: is "testButton" and view has effective visibility=VISIBLE)'.
Error: Error performing 'single click' on view '(with text: is "Add Product" and the view has effective visibility=VISIBLE)'.