Ruby on rails 黄瓜步骤定义
我正在使用Cucumber/Capybara编写一些特性级测试 这是我的特征定义Ruby on rails 黄瓜步骤定义,ruby-on-rails,cucumber,capybara,bdd,Ruby On Rails,Cucumber,Capybara,Bdd,我正在使用Cucumber/Capybara编写一些特性级测试 这是我的特征定义 Feature: User Signin As a User I want to signin So i can use my app Background: Given user with "email" email and "password" password Scenario: Signing in with correct credentials When
Feature: User Signin
As a User
I want to signin
So i can use my app
Background:
Given user with "email" email and "password" password
Scenario: Signing in with correct credentials
When I go to sign in page
And I fill in "user_email" with "email"
And I fill in "user_password" with "password"
And I click "Sign in" button
Then I should go to the dashboard page
如何定义检查是否转到特定页面的步骤?基本上,我如何定义以下步骤
Then(/^I should go to the dashboard page$/) do
end
还有黄瓜/水豚步骤定义的文档吗?有几种可能性:
current_path.should == DashboardPage.path
Then(/^I should go to the dashboard page$/) do
page.should have_css('#id_that_is_present_only_at_dashboard_page')
end
current_path.should == DashboardPage.path