设想:
Feature: Login Success
Scenario: Login in User
Given I am on the sign_in page
And I fill in "Email" with "test@gmail.com"
And I fill in "Password" with "12345678"
When I press "Sign in"
Then page should have content "Update Projects"
我正在使用设计。
脚步:
Given /^I am on the sign_in page$/ do
visit ('/users/sign_in')
end
Given /^I fill in "(.*?)" with "(.*?)"$/ do |arg1, arg2|
fill_in arg1, :with => arg2
end
When /^I press "(.*?)"$/ do |arg1|
click_button arg1
end
Then /^page should have content "(.*?)"$/ do |arg1|
expect(page).to have_content arg1
end
非常简单。我正在使用设计。
为什么会失败:
预计会在...中找到文本“更新项目”
为什么黄瓜不重定向到下一页?