【问题标题】:Testcafe doesn't recognize my DOM in reactTestcafe 在反应中无法识别我的 DOM
【发布时间】:2019-12-15 20:15:43
【问题描述】:

我是 testcafe 的新手,正在尝试运行一个简单的测试 在create-react-app 制作的客户端上,但由于某种原因,我无法访问 DOM, 并使用反应选择器。

我的客户:

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.

与“按钮”相关的

谢谢

【问题讨论】:

    标签: javascript reactjs automated-tests create-react-app testcafe


    【解决方案1】:

    这是testcafe-react-selectors 模块和材质 UI 组件的已知问题。有关更多详细信息,请参阅 testcafe-react-selectors 存储库中对应的 issue

    【讨论】:

      猜你喜欢
      • 2019-01-22
      • 2019-09-23
      • 2019-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-07
      • 2016-02-17
      • 1970-01-01
      相关资源
      最近更新 更多