我的问题是,我希望 Cypress 库的期望断言有一个超时,但似乎无法找到这样做的方法。
我尝试大大增加 cypress.conf 中的全局超时;然而,这不起作用。
if ($widget.find('report-widget')) {
SVGCount++;
expect(barGraphsChange[index]).to.not.equal(undefined)
console.log(barGraphsChange, index)
cy.getBarGraphTotal(SVGCount, barGraphsChange[index])
}
Run Code Online (Sandbox Code Playgroud)
如果不是超时,那么合理的解决方法也很好,谢谢!
另请注意:在此阶段之前,barGraphsChange[index] 正在通过调用的自定义 Cypress 命令进行计算和分配。