【问题标题】:testcafe Expect click to failtestcafe 预计点击失败
【发布时间】:2019-04-27 12:38:26
【问题描述】:

testcafe 是否可以预期点击失败?

我正在使用 testcafe 工作室。

在我点击页面上的提交按钮后,我想要进行测试以确保页面上不再有某些文本。

最好的方法是什么?

谢谢

【问题讨论】:

    标签: testing automated-tests e2e-testing testcafe web-testing


    【解决方案1】:

    我找到了一种确保元素不在页面上的方法:

    我用了t.notOk(Selector(mySelectorHere).count)

    【讨论】:

      【解决方案2】:

      在您的测试场景中,您可以使用exists Selector 属性:

      Selector('h1').withText('Some text').exists
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-10-02
        • 2019-11-25
        • 2016-01-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多