我正在尝试将 UI 测试集成到一个相当大的反应原生项目中。但是只要我想记录 ui 测试,我就会收到警告
Timestamped Event Matching Error: Failed to find matching element
这是我要击中的 ui 元素。
<TouchableOpacity style={containerStyle}
onPress={this.props.onPress}
accessibilityLabel='back_button_touchable'
accessible={true}
testID='back_button_touchable'
underlayColor='#99d9f4'>
<Image style={iconStyle} source={require('../white-arrow.png')}/>
<Text style={styles.text}>{this.props.text}</Text>
</TouchableOpacity>
我刚刚建立了一个新的 react native 项目,并试图让 ui 测试运行,这很好。所以这让我想到了元素检索被现有代码/构建设置以某种方式阻止的问题。
有什么想法可以禁用或阻止 ui 测试吗?