0
**Google_Visit.feature**
Feature: Navigating Google By Cucumber
I want to navigate to Google.com
Scenario: Visiting Google
Given I am on Google.com Page
**google_steps.rb**
Given(/^I am on Google\.com Page$/) do
@browser = Selenium :: Browser.start(SITE, :firefox)
@browser.goto(PAGES["http://www.google.com"])
end
**feature/support/env.rb**
require 'selenium-webdriver'
require 'cucumber'
SITE = 'www.google.com'
Browser = Selenium :: Browser.start(SITE, :firefox)
PAGES = {
"Google Home" => "www.google.com",
}
我已經試過很多時間,但只在結果部分顯示錯誤,以實際行動錯誤:我已經創建項目硒的Watir,但是當我沿着my_steps.rb執行特徵文件,那麼它顯示
*您可以實現對不確定的步驟一步定義這些片段:
Given(/^I am on Google\.com Page$/) do
pending # Write code here that turns the phrase above into concrete actions
end
1 scenario (1 undefined)
1 step (1 undefined)
0m0.021s*
看看[我如何問一個好問題](http://stackoverflow.com/help/how-to-ask) - 然後,考慮使問題的標題變得更加清晰,並且不要使用它爲完整的問題。 –
你的'features'目錄裏有'step_definitions'目錄嗎?你在那個目錄中的步驟是? – orde
是的,我在功能目錄中包含了step_definitions – Anuj