2017-04-05 47 views
0

我与量角器黄瓜的执行工作我已经有conf.js文件后:“路径必须是一个字符串”错误执行黄瓜功能

exports.config = { 
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub', 
    framework: 'custom', 
    frameworkPath: require.resolve('protractor-cucumber-framework'), 

    capabilities: { 
    'browserName': 'firefox' 
    }, 

    specs: './features/login.feature', 

    onPrepare: function(){ 
    browser.driver.manage().window().maximize() 
    browser.get('http:www.google.com') 
    }, 

    jasmineNodeOpts: { 
    showColors: true, // Use colors in the command line report. 
    }, 

    cucumberOpts: { 
    require: 'features/steps/my_steps.js', 
    } 
}; 

这是我的步文件,只是含有的console.log:

module.exports = function(){ 
    this.Given(/Display something/, function() { 
    console.log('Hi'); 
    }); 
} 

,这是功能:

Feature: Running Cucumber with Protractor 

    Scenario: Protractor and Cucumber Test 
    Given Display something 

,但每次我execu时间用命令

protractor conf.js 

我得到这个错误蒂

Unhandled rejection VError: a handler errored, process exiting: PrettyFormatter::handleFeaturesResult: Path must be a string. Received undefined 

我不知道如果我在conf.js问题或指令不执行的权利。

我希望你能帮助我。

回答

0

这个工作对我来说:

cucumberOpts:conf.js

我补充一点:

cucumberOpts: { 
    require: 'features/steps/my_steps.js', 
    format: 'pretty', 
    tags:'false' 
    } 

所以对我来说,现在的工作,我希望这是你们的解决方案。

相关问题