2013-04-23 41 views
0

我設置了弗蘭克,並已完成大部分設置。我試圖運行內置的黃瓜測試,只需旋轉設備。弗蘭克安裝完成,但黃瓜測試不工作

我做cucumber -d而在MyProject/Frank/並獲得這樣的:

cucumber -d 
Feature: 
    As an iOS developer 
    I want to have a sample feature file 
    So I can see what my next step is in the wonderful world of Frank/Cucumber testing 

    Scenario:            # features/my_first.feature:6 
     Rotating the simulator for demonstration purposes 
    Given I launch the app        # features/step_definitions/launch_steps.rb:5 
    Given the device is in landscape orientation  # features/my_first.feature:9 
    Given the device is in portrait orientation   # features/my_first.feature:10 
    Given the device is in landscape orientation  # features/my_first.feature:11 
    Given the device is in portrait orientation   # features/my_first.feature:12 

1 scenario (1 skipped) 
5 steps (1 skipped, 4 undefined) 
0m0.002s 

You can implement step definitions for undefined steps with these snippets: 

Given(/^the device is in landscape orientation$/) do 
    pending # express the regexp above with the code you wish you had 
end 

Given(/^the device is in portrait orientation$/) do 
    pending # express the regexp above with the code you wish you had 
end 

只是困惑,並希望我調整設定了權利。感謝任何答案。

+0

你可以發佈功能文件嗎? – 2013-04-23 20:07:29

回答

0

我想通了一點前。我跑cucumber -d做一個「幹運行」而不是像一個應該有的cucumber。當我運行cucumber時,一切正常。

1

要使用預定義的弗蘭克步驟,你應該在你的「launch_steps.rb」文件,該文件通常位於下初下面一行「yourAppWorkspace /弗蘭克/功能/ step_definitions」:

require 'frank-cucumber/core_frank_steps.rb' 

然後,如果您在features目錄下運行「cucumber」,則步驟應該正確運行。

您還可以看到這裏所有的預定義的步驟:https://github.com/moredip/Frank/blob/master/gem/lib/frank-cucumber/core_frank_steps.rb