量角器上 browser.setNetworkConditions 的替代品是什么? [英] What is the replacement for browser.setNetworkConditions on Protractor?

查看:57
本文介绍了量角器上 browser.setNetworkConditions 的替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 e2e 测试中有一个测试用例,我需要禁用网络.

I have a test case on my e2e testing that I need to disable network.

我以前是这样做的:

browser.driver.setNetworkConditions({
    offline: true
});

我需要一个替代方案,因为最新的 chromedriver API 不再支持此功能.

I need an alternative because latest chromedriver API no longer support this function.

推荐答案

最新的 chromedrive API 仍然支持这个.您可以查看文档 此处.

The latest chromedrive API still supports this. You can check the documentation here.

尝试在没有驱动程序的情况下使用.喜欢:

Try using without the driver. like:

browser.setNetworkConditions({
    offline: true
});

这篇关于量角器上 browser.setNetworkConditions 的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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