2017-02-08 89 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'], 
}