Commit a1833680 authored by Diego de Araújo Martinez Camarinha's avatar Diego de Araújo Martinez Camarinha Committed by marcheing

Add create profile feature acceptance tests

Signed-off-by: marcheing's avatarHeitor Reis <[email protected]>
parent c48ee460
Feature: Creating a Profile
In order to complete my registration
As a regular user
I should be able to create a profile
Background:
Given I have a registered and confirmed user
@javascript @wip
Scenario: Filling valid data
Given I am at the home page
And I am logged in
And I click on the account drop down link
And I click the new profile link
And I fill the first name field with "Media"
And I fill the last name field with "Choice User"
And I fill the city field with "São Paulo"
And I select the country "Brasil"
And I select the state "São Paulo"
And I select any occupation
And I fill the zip_code field with "00981-009"
And I select "05" as my birthdate's day
And I select "10" as my birthdate's month
And I select "1990" as my birthdate's year
And I mark the terms of service checkbox
When I click on the button to send the profile information
Then I should see the successfully created profile message
@javascript @wip
Scenario: Filling invalid data
Given I am at the home page
And I am logged in
And I click on the account drop down link
And I click the new profile link
And I fill the city field with "São Paulo"
And I select the country "Brasil"
And I select the state "São Paulo"
And I select any occupation
And I fill the zip_code field with "00981-009"
And I select "05" as my birthdate's day
And I select "10" as my birthdate's month
And I select "1990" as my birthdate's year
When I click on the button to send the profile information
Then I should see the error messages for multiple profile errors
......@@ -33,9 +33,7 @@ end
Given(/^I am logged in$/) do
step 'I am at the home page'
step 'I click on the Sign in link'
step 'I switch to the last opened window'
step "I fill the email field with the user's email"
step "I fill the password field with the user's password"
step 'I click on the Sign in button'
step 'I switch to the first window'
end
Given(/^I click the my account link$/) do
step "I click on the \"#{I18n.t 'account.my'}\" link"
end
Given(/^I click the new profile link$/) do
step "I click on the \"#{I18n.t 'profile_links.new'}\" link"
end
Given(/^I select "(.*?)" as my birthdate's (.*?)$/) do |value, field|
step "I select \"#{value}\" from \"birthdate[#{field}]\""
end
Given(/^I mark the terms of service checkbox$/) do
step 'I check the "terms_of_service" box'
end
When(/^I click on the button to send the profile information$/) do
step "I click on the \"#{I18n.t 'save'}\" button"
end
Then(/^I should see the successfully created profile message$/) do
step "I should see \"#{I18n.t 'successfully_created_profile'}\""
end
Given(/^I fill the first name field with "(.*?)"$/) do |first_name|
step "I fill the \"user-first-name\" field with \"#{first_name}\""
end
Given(/^I fill the last name field with "(.*?)"$/) do |last_name|
step "I fill the \"user-last-name\" field with \"#{last_name}\""
end
Given(/^I fill the city field with "(.*?)"$/) do |city|
step "I fill the \"user-city\" field with \"#{city}\""
end
Given(/^I select the country "(.*?)"$/) do |country|
step "I select \"#{country}\" from \"#{I18n.t 'country'}\""
end
Given(/^I fill the zip_code field with "(.*?)"$/) do |zip_code|
step "I fill the \"user-postal-code\" field with \"#{zip_code}\""
end
Given(/^I select the state "(.*?)"$/) do |state|
step "I select \"#{state}\" from \"state\""
end
Given(/^I select any occupation$/) do
option = all('#occupation option').sample.text
step "I select \"#{option}\" from \"occupation\""
end
Then(/^I should see the error messages for multiple profile errors$/) do
step "I should see \"#{I18n.t 'errors_message', count: 2, model_name: I18n.t('profile')}\""
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment