2016-08-03 51 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