量角器:PhpStorm IDE指向默认的conf.js文件

时间:2018-03-04 13:13:52

标签: selenium protractor phpstorm webstorm

我正在尝试在Ubuntu上的PhpStorm IDE中运行一个基本的Protractor脚本。当我运行conf文件时,它会将此错误抛出。

Usage: protractor [configFile] [options]
configFile defaults to protractor.conf.js
The [options] object will override values from the config file.
See the reference config for a full list of options.

Error: Error: more than one config file specified
at /usr/local/lib/node_modules/protractor/built/cli.js:163:15

我无法理解为什么它指向默认的conf文件而不是我指定的文件。

以下是配置的屏幕截图

PhpStorm error

c_conf.js

exports.config = {
    seleniumAddress: 'http://localhost:4444/wd/hub', 
    specs: [spec.js],
    framework : 'jasmine',

    capabilities: {
        browserName: 'chrome'
    }
}

spec.js

describe('Protractor Framework', function(){
    it('Title', function(){
        browser.get('https://www.google.com');
    })
})

1 个答案:

答案 0 :(得分:1)

您设置错误,请参考以下屏幕截图中的设置:

  • Node interpreter用于指定nodejs binary
  • Node parameters 可选,指定nodejs binary的参数
  • JavaScript file必须是量角器\ build
  • cli.js
  • Application parameters用于指定在cmd行中键入的conf文件和参数
  • Environment variables 可选

enter image description here