我已经安装:ruby,watir-webdriver,rspec,cucumber。无法使用黄瓜运行测试
我做了名为“功能”的文件夹。里面有黄瓜测试“process.feature”,其中一个特征是1个简单的场景。 “features”里面还有一个名为“step_definitions”的文件夹,其中ruby文件是process.rb。 我尝试在命令行中运行写入“cucumber process.feature”的测试,但它表示步骤未定义:1场景(1个未定义),3个步骤(3个未定义)。
你能告诉我我失踪了吗?
process.feature:
Feature:
‘User Login.’
Scenario:
Given I am logged in
When I open the process page
Then I see the details page
process.rb
Given /^I am logged in$/ do
b = Watir::Browser.new
b.goto 'http://star.teepub:000/star-web/'
code = '48702'
password = 'test'
b.text_field(:id => 'j_username').set code
b.text_field(:id => 'j_password').set password
b.link(:id => 'loginBtn').click
end
When /^I open the process page$/ do
pending
end
Then /^I see the details page$/ do
pending
end
从.feature文件步骤没有定义,发布process.feature和step_definitions/process.rb文件 – mechanicalfish
@mechanicalfish它被添加到描述 – Seda