问题描述
在执行任何操作之前,我需要赛普拉斯默认情况下等待任何xhr请求完成.是否有任何方法可以将其设置为默认值或其他替代方法,因为我正在测试的应用程序运行缓慢且需要进行大量的api调用?
I need Cypress to wait for any xhr requests to complete by default before performing any operations. Is there any way to make this as a default or any other alternatives because the application I am testing is slow and makes a lot of api calls?
通过为每个api请求编写一个语句,会变得混乱和不必要的工作.需要一种使它更容易的方法.
By writing a single statement for every api request is getting messy and unnecessary work. Need a way to make this easier.
推荐答案
在这里找到了对我有用的东西 https://github.com/PinkyJie/cypress-auto-stub-example
Found something that works for me here https://github.com/PinkyJie/cypress-auto-stub-example
寻找cy.waitUntilAllAPIFinished
Look for cy.waitUntilAllAPIFinished
这篇关于赛普拉斯请求默认等待吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!