2016-08-03 54 views
0

我想通过运行量角器conf.js文件生成步定义骨架。 我需要在量角器中实现BDD。使用黄瓜量角器集成生成骨架

conf.js

exports.config = { 
    directConnect: true, 
    capabilities: { 
    'browserName': 'chrome' 
    }, 
    framework: 'custom', 
    frameworkPath: require.resolve('protractor-cucumber-framework'), 
    specs: ['features /*.feature'], 
    jasmineNodeOpts: { 
    defaultTimeoutInterval: 30000 
    } 
}; 

特征文件

@tag1 
Feature: Add Numbers 
    As a user of the calculator 
    I want to add 2 numbers 

    @tag2 
    Scenario: Add 2 small numbers 
    Given the calculator is cleared 
    When I add 5 and 6 
    Then the result should be 11 
+0

你看到您的控制台输出中的任何错误? – Mallory

+0

错误是什么?问题是什么? – nilesh

+0

看起来像一个重复的问题 - http://stackoverflow.com/questions/38605648/how-to-generate-skeleton-using-cucumber-feature-file – Rocky

回答

0

你有如下格式游览功能文件中的文本。然后如果你运行你的conf.js文件,你会看到这些步骤。

@ TAG1

功能:添加号码,因为我想添加2号

@ TAG2

情景计算器的用户:添加2个小号

Given the calculator is cleared 
When I add 5 and 6 
Then the result should be 11