如何使用节流连接运行 TestCafe 测试? [英] How to run TestCafe tests with throttling connection?

查看:32
本文介绍了如何使用节流连接运行 TestCafe 测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果文件上传时间超过 1 分钟,我需要检查功能.

I need to check functionality if a file is uploading longer then 1 minute.

为了通过手动测试进行检查,我使用 Chrome Dev Tools 设置节流慢 3G".但我不知道如何用 TestCafe 做到这一点.

To check it with manual testing I use Chrome Dev Tools to set Throttling "Slow 3G". But I can't figure out how to do it with TestCafe.

推荐答案

TestCafe 没有用于设置限制的 API.但是,TestCafe 在内部使用 Chrome DevTools 协议,因此您可以访问内部 CDP 方法.请参考以下链接开始使用:

TestCafe does not have an API to set the throttling. However, TestCafe uses Chrome DevTools Protocol internally so you can get access to internal CDP methods. Please refer to the following links to get started:

Chrome 开发工具协议

chrome-remote-interface

chrome-remote-interface 存储库

另请查看 以下示例如何在 chrome headless 中启用文件下载.

Please also take a look at the following example which shows how to enable file downloading in chrome headless.

我认为您需要将此示例与 CDP Network.emulateNetworkConditions 方法结合起来.

I think you need to combine this example with the CDP Network.emulateNetworkConditions method.

请参考这篇文章https://chromedevtools.github.io/devtools-protocol/tot/Network#method-emulateNetworkConditions

这篇关于如何使用节流连接运行 TestCafe 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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