运行 gui 测试时禁用 Chrome 中的保存密码提示

Disabling save password prompts in Chrome when running gui tests

当运行在Chrome中进行验收测试时,部分流程正在登录,Chrome会提示您保存密码(从而隐藏部分window 与此提示)。我如何配置 WebDriverIO 以便它告诉 Chrome 不显示提示?

several google ,我了解到 Chrome 驱动程序的正确设置称为 credentials_enable_service,但它始终使用 Ruby、Java 或 Python api 对于 Selenium,我不知道如何或在何处设置它在静态 WebDriver 配置对象中。

很明显它应该在 capabilities.chromeOptions 下面,但是直接把它放在那里会从 wdio 吐出一个关于未知选项的错误。

found an example where the setting was applied 到 Protracter 框架,结果发现可以将配置逐字复制到 WebDriverIO。

capabilities.chromeOptions 下有一个 prefs 属性,可用于在 Chrome 中设置个人资料首选项。这就是全部要求:

capabilities: {
  'browserName': 'chrome',
  'chromeOptions': {
      'prefs': {
          'credentials_enable_service': false,