**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",
}
我已经尝试了很多时间,但只有结果部分中显示的错误:
*您可以使用以下代码段实现未定义步骤的步骤定义:
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*