[英]Testcafe doesn't recognize my DOM in react
我是 testcafe 的新手,并试图在由create-react-app
制作的客户端上运行一个简单的测试,但由于某种原因,我无法访问 DOM,并使用 react 选择器。
我的客户:
import Button from '@material-ui/core/Button'
function(App){
return(
<Button>my button</Button>
);
}
export default App;
这是我的测试:
fixture `Record Page`
.page('http://localhost:3000')
test('try', async t=>{
await t
.click(ReactSelector('Button')) //from Material UI
.wait(100000)
})
错误:
the specified selector does not match any element in the DOM tree.
与“按钮”有关
谢谢
这是testcafe-react-selectors
模块和材料 UI 组件的一个已知问题。 有关其他详细信息,请参阅testcafe-react-selectors
存储库中的相应问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.