赛普拉斯请求默认等待吗? [英] Cypress request wait by default?

查看:87
本文介绍了赛普拉斯请求默认等待吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在执行任何操作之前,我需要赛普拉斯默认情况下等待任何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.

推荐答案

在这里找到了对我有用的东西

Found something that works for me here https://github.com/PinkyJie/cypress-auto-stub-example

寻找cy.waitUntilAllAPIFinished

Look for cy.waitUntilAllAPIFinished

这篇关于赛普拉斯请求默认等待吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆