TestCafe - 由于加载元素缓慢导致的浏览器超时

时间:2018-04-12 13:53:17

标签: testcafe

我最近开始使用TestCafe测试我的WebApp并遇到了我的一个页面的问题..在元素中显示信息之前,该页面向第三方拨打了一个昂贵的电话..此调用可以采取&gt ; 10秒钟返回。在测试这个页面时,TestCafe似乎要等到这个元素被加载才会执行测试(测试不引用这个元素)。我的问题是,我是否有办法解决这个问题?我本以为不要在整个页面上调用await,而只是在特定选择器上调用await会有效,但是没有快乐,即使包括没有等待仍然等待加载这个元素?相当困惑!任何帮助都将非常感激!

test.before(async t => {
      await t
      .click('button'); //this takes the user to a new page
    })
    ('should be on the correct page after clicking the button', async t => {
      await t
      //this expect wont be tested until the whole page is loaded 
      //(including the very slow element - hence we will time out before this expect is called)
     .expect(Selector('.app-title').innerText).eql('title');
    });

0 个答案:

没有答案
相关问题