[英]Testcafe doesn't recognize my DOM in react
I'm new into testcafe, and trying to run a simple test on a client which made by create-react-app
, but for some reason, I can't reach the DOM, and use the react selectors.我是 testcafe 的新手,并试图在由create-react-app
制作的客户端上运行一个简单的测试,但由于某种原因,我无法访问 DOM,并使用 react 选择器。
My client:我的客户:
import Button from '@material-ui/core/Button'
function(App){
return(
<Button>my button</Button>
);
}
export default App;
This is my test:这是我的测试:
fixture `Record Page`
.page('http://localhost:3000')
test('try', async t=>{
await t
.click(ReactSelector('Button')) //from Material UI
.wait(100000)
})
Error:错误:
the specified selector does not match any element in the DOM tree.
which related to the 'Button'与“按钮”有关
Thank you谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.