简体   繁体   English

Testcafe 在反应中无法识别我的 DOM

[英]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谢谢

This is a known problem with testcafe-react-selectors module and material UI components.这是testcafe-react-selectors模块和材料 UI 组件的一个已知问题。 For additional details, see the corresponding issue in testcafe-react-selectors repository.有关其他详细信息,请参阅testcafe-react-selectors存储库中的相应问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM