2017-02-08 87 views
1

我試圖讓PhantomJS與量角器一起工作。當我的代碼需要到達保存在單獨服務器上的後端端點時,我目前遇到Phantom問題,但不是Chrome。因此,我想用--ignore-ssl-errors選項來測試它。將命令行參數傳遞給瀏覽器與量角器

不幸的是,在Protractor文檔中提供的example config文件似乎沒有列出任何將參數傳遞給瀏覽器的方式。這可能嗎?

回答

0

原來答案是在一個封閉的量角器問題:https://github.com/angular/protractor/issues/150

你可以傳遞參數與phantomjs.cli.args屬性,使用參數數組的瀏覽器。只需將它添加到您的配置中的capabilities屬性中,在指定browserName的相同位置:

capabilities: { 
    browserName: 'phantomjs', 
    'phantomjs.binary.path': require('phantomjs').path, 
    'phantomjs.cli.args': ['--web-security=false', '--ignore-ssl-errors=true', '--webdriver-loglevel=DEBUG'], 
}