5. Feature: Login In order to manage my private data As a person.com user I want to login Scenario: Normal login Given I am on the home page When I fill in "login" with "value" And I fill in password field "passwd" with "value1" And I press "login" Then I should see "My Stuff" But I should not see "ERROR: Invalid password!" Scenario: Invalid login with bad login Given I am on the home page When I fill in "login" with "value1" And I fill in password field "passwd" with "value2" And I press "login" Then I should see "NO Login" Scenario: Invalid login with incorrect password Given I am on the home page When I fill in "login" with "value" And I press "login" Then I should see "ERROR: Invalid password!"
6. Scenario Outline : eating Given there are <start> cucumbers When I eat <eat> cucumbers Then I should have <left> cucumbers Examples : | start | eat | left | | 12 | 5 | 7 | | 20 | 5 | 15 | Given the following people exist: | name | email | phone | | Aslak | aslak@email.com | 123 | | Joe | joe@email.com | 234 | | Bryan | bryan@email.org | 456 |
7. Feature: Registration In order to start using site As a new user I want to register Scenario: Normal registration Given I am on the home page When I fill in "email" with random email And I fill in "fullname" with "MyNameIs" And I fill in "nickname" with "MyNicknameIs" And I choose "gender_1" And I select "10" from "birthday_day" And I select "March" from "birthday_month" And I select "1986" from "birthday_year" And I fill in "city" with "Antarctica, Antarctica, Antarctica" And I fill in "password" with "testpass" And I fill in "city" with "Antarct" And I click to city autocomplete item with "Antarctica" And I press "button_submit" Then I should see "Thank you for registration!"
8. Given /^(?:|I )am on (.+)$/ do |page_name| visit path_to(page_name) end When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| with_scope(selector) do click_button(button) end end Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| with_scope(selector) do if page.respond_to? :should page.should have_no_content(text) else assert page.has_no_content?(text) end end end When /^(?:|I )fill in "([^"]*)" with random email(?: within "([^"]*)")?$/ do |field, selector| @email = Faker::Internet.email with_scope(selector) do fill_in(field, :with => @email) end end