等待 angular 稳定,然后继续测试执行

时间:2021-06-07 13:48:48

标签: cypress

我有一个 Web 应用程序,我目前正在使用 Cypress 对其进行测试。我有一个问题,某些页面执行客户端渲染。页面加载后/项目被点击

在框架继续执行测试之前,我需要等待客户端渲染完成。

在控制台上。

我需要类似的东西

 const testability = window.getAngularTestability(window.getAllAngularRootElements()[0]);
if (testability.isStable()) {
  doneCb(true);
} else {
  testability.whenStable((didWork) => {
    doneCb(didWork);
  }, TIME_OUT);

使用 cypress/typescript。我无法在窗口对象上获取方法 getAngularTestability

enter image description here

我考虑过使用 cy.exec 但它似乎是在系统上而不是在应用程序上执行的。

0 个答案:

没有答案