angularjs – 无法停止量角器显示文件下载提示

前端之家收集整理的这篇文章主要介绍了angularjs – 无法停止量角器显示文件下载提示前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
问题

我正在测试下载文件,但是当我触发下载时,会出现“另存为…”提示.
我在SO question中看到了一个解决方案,但它似乎对我不起作用.

配置

我的量角器配置文件看起来像这样(coffeescript):

exports.config =
  capabilities:
    browserName: "chrome"
    shardTestFiles: true
    maxInstances: 2
    chromeOptions:
      args: ['--no-sandBox','--test-type=browser']
      prefs:
        download:
          prompt_for_download: false
          default_directory: '/'
          default_content_settings:
            popups: 0

更多

在chromeOptions.pref webdriver docs上声明:

See the ‘Preferences’ file in Chrome’s user data directory for examples.

@H_301_29@

我实际上无法在自己的Chrome偏好设置文件中看到default_directory.

"download": {
  "directory_upgrade": true,"prompt_for_download": false
},

系统

>量角器:1.5.0版(相当新)
>节点:0.10.28,0.11.8和0.11.14

解决方法

提供default_directory chrome首选项中现有目录的绝对路径.

猜你在找的Angularjs相关文章