Commit db09f4dc3a14c34fa1e40cbd3bdf036559965ffb

Authored by Daniela Feitosa
2 parents 58ea760c cb8a5d9d

Merge branch 'capybara' of git://gitorious.org/~danielcunha/noosfero/danielcunha…

…s-noosfero into capybara
features/edit_environment_templates.feature
... ... @@ -4,50 +4,46 @@ Feature: edit environment templates
4 4  
5 5 Background:
6 6 Given that the default environment have all profile templates
  7 + And I am logged in as admin
  8 + And I follow "Administration"
7 9  
  10 + @selenium
8 11 Scenario: See links to edit all templates
9   - Given I am logged in as admin
10   - When I follow "Administration"
11   - And I follow "Profile templates"
12   - Then I should see "Person template" link
13   - And I should see "Community template" link
14   - And I should see "Enterprise template" link
15   - And I should see "Inactive Enterprise template" link
  12 + Given I follow "Profile templates"
  13 + Then I should see "Person template"
  14 + And I should see "Community template"
  15 + And I should see "Enterprise template"
  16 + And I should see "Inactive Enterprise template"
16 17  
  18 + @selenium
17 19 Scenario: Go to control panel of person template
18   - Given I am logged in as admin
19   - When I follow "Administration"
20   - And I follow "Profile templates"
  20 + Given I follow "Profile templates"
21 21 And I follow "Person template"
22   - Then I should be on Person template's control panel
  22 + Then I should be on colivre.net_person_template's control panel
23 23  
  24 + @selenium
24 25 Scenario: Go to control panel of enterprise template
25   - Given I am logged in as admin
26   - When I follow "Administration"
27   - And I follow "Profile templates"
  26 + Given I follow "Profile templates"
28 27 And I follow "Enterprise template"
29   - Then I should be on Enterprise template's control panel
  28 + Then I should be on colivre.net_enterprise_template's control panel
30 29  
  30 + @selenium
31 31 Scenario: Go to control panel of inactive enterprise template
32   - Given I am logged in as admin
33   - When I follow "Administration"
34   - And I follow "Profile templates"
35   - And I follow "Inactive enterprise template"
36   - Then I should be on Inactive Enterprise template's control panel
  32 + Given I follow "Profile templates"
  33 + And I follow "Inactive Enterprise template"
  34 + Then I should be on colivre.net_inactive_enterprise_template's control panel
37 35  
  36 + @selenium
38 37 Scenario: Go to control panel of community template
39   - Given I am logged in as admin
40   - When I follow "Administration"
41   - And I follow "Profile templates"
42   - And I follow "Community template"
43   - Then I should be on Community template's control panel
  38 + Given I follow "Profile templates"
  39 + When I follow "Community template"
  40 + Then I should be on colivre.net_community_template's control panel
44 41  
  42 + @selenium
45 43 Scenario: Not see link to edit an unexistent template
46   - Given that the default environment have no Inactive Enterprise template
47   - And I am logged in as admin
48   - When I follow "Administration"
49   - And I follow "Profile templates"
50   - Then I should see "Person template" link
51   - And I should see "Community template" link
52   - And I should see "Enterprise template" link
53   - And I should not see "Inactive enterprise template" link
  44 + Given I follow "Profile templates"
  45 + And that the default environment have no Inactive Enterprise template
  46 + Then I should see "Person template"
  47 + And I should see "Community template"
  48 + And I should see "Enterprise template"
  49 + And I should not see "Inactive enterprise template"
... ...
features/edit_language_block.feature
... ... @@ -15,25 +15,25 @@ Feature: edit language of block
15 15 Scenario: display in all languages
16 16 Given I go to edit ArticleBlock of joaosilva
17 17 And I fill in "Custom title for this block" with "Block displayed"
18   - And I select "all languages"
  18 + And I select "all languages" from "Show for"
19 19 And I press "Save"
20   - When I go to Jose Silva's homepage
  20 + When I go to joaosilva's homepage
21 21 Then I should see "Block displayed"
22 22  
23 23 Scenario: display in the selected language
24 24 Given I go to edit LinkListBlock of joaosilva
25 25 And I fill in "Custom title for this block" with "Block displayed"
26   - And I select "English"
  26 + And I select "English" from "Show for"
27 27 And I press "Save"
28 28 And my browser prefers English
29   - When I go to Jose Silva's homepage
  29 + When I go to joaosilva's homepage
30 30 Then I should see "Block displayed"
31 31  
32 32 Scenario: not display in a not selected language
33 33 Given I go to edit LinkListBlock of joaosilva
34 34 And I fill in "Custom title for this block" with "Block not displayed"
35   - And I select "English"
  35 + And I select "English" from "Show for"
36 36 And I press "Save"
37 37 And my browser prefers Portuguese
38   - When I go to Jose Silva's homepage
  38 + When I go to joaosilva's homepage
39 39 Then I should not see "Block displayed"
... ...
features/edit_profile.feature
... ... @@ -12,8 +12,8 @@ Feature: edit profile
12 12 | birth_date |
13 13 When I go to joao's control panel
14 14 And I follow "Edit Profile"
15   - And I select "November"
16   - And I select "15"
  15 + And I select "November" from "profile_data_birth_date_2i"
  16 + And I select "15" from "profile_data_birth_date_3i"
17 17 And I press "Save"
18 18 Then I should see "Birth date is invalid"
19 19 And I should not see "Birth date can't be blank"
... ... @@ -24,8 +24,8 @@ Feature: edit profile
24 24 | birth_date |
25 25 When I go to joao's control panel
26 26 And I follow "Edit Profile"
27   - And I select "November"
28   - And I select "15"
  27 + And I select "November" from "profile_data_birth_date_2i"
  28 + And I select "15" from "profile_data_birth_date_3i"
29 29 And I press "Save"
30 30 Then I should see "Birth date is invalid"
31 31 And I should not see "Birth date can't be blank"
... ... @@ -36,9 +36,9 @@ Feature: edit profile
36 36 | birth_date |
37 37 When I go to joao's control panel
38 38 And I follow "Edit Profile"
39   - And I select "November"
40   - And I select "15"
41   - And I select "1980"
  39 + And I select "November" from "profile_data_birth_date_2i"
  40 + And I select "15" from "profile_data_birth_date_3i"
  41 + And I select "1980" from "profile_data_birth_date_1i"
42 42 And I press "Save"
43 43 Then I should not see "Birth date is invalid"
44 44 And I should not see "Birth date is mandatory"
... ... @@ -49,9 +49,9 @@ Feature: edit profile
49 49 | birth_date |
50 50 When I go to joao's control panel
51 51 And I follow "Edit Profile"
52   - And I select "November"
53   - And I select "15"
54   - And I select "1980"
  52 + And I select "November" from "profile_data_birth_date_2i"
  53 + And I select "15" from "profile_data_birth_date_3i"
  54 + And I select "1980" from "profile_data_birth_date_1i"
55 55 And I press "Save"
56 56 Then I should not see "Birth date is invalid"
57 57 And I should not see "Birth date is mandatory"
... ... @@ -62,11 +62,11 @@ Feature: edit profile
62 62 | identifier | name | owner |
63 63 | o-rappa | O Rappa | joao |
64 64 And feature "enable_organization_url_change" is enabled on environment
65   - When I go to O Rappa's control panel
66   - And I follow "Community Info and settings" and wait
67   - Then the "#identifier-change-confirmation" should not be visible
  65 + When I go to o-rappa's control panel
  66 + And I follow "Community Info and settings"
  67 + And I should not see "identifier-change-confirmation"
68 68 When I fill in "Address" with "banda-o-rappa"
69   - Then the "#identifier-change-confirmation" should be visible
  69 + And I should see "identifier-change-confirmation"
70 70  
71 71 @selenium
72 72 Scenario: Confirm url change
... ... @@ -74,12 +74,12 @@ Feature: edit profile
74 74 | identifier | name | owner |
75 75 | o-rappa | O Rappa | joao |
76 76 And feature "enable_organization_url_change" is enabled on environment
77   - When I go to O Rappa's control panel
78   - And I follow "Community Info and settings" and wait
  77 + When I go to o-rappa's control panel
  78 + And I follow "Community Info and settings"
79 79 When I fill in "Address" with "banda-o-rappa"
80   - Then the "#identifier-change-confirmation" should be visible
  80 + Then I should see "identifier-change-confirmation"
81 81 When I follow "Yes"
82   - Then the "#identifier-change-confirmation" should not be visible
  82 + Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem"
83 83  
84 84 @selenium
85 85 Scenario: Cancel url change
... ... @@ -87,9 +87,9 @@ Feature: edit profile
87 87 | identifier | name | owner |
88 88 | o-rappa | O Rappa | joao |
89 89 And feature "enable_organization_url_change" is enabled on environment
90   - When I go to O Rappa's control panel
91   - And I follow "Community Info and settings" and wait
  90 + When I go to o-rappa's control panel
  91 + And I follow "Community Info and settings"
92 92 When I fill in "Address" with "banda-o-rappa"
93   - Then the "#identifier-change-confirmation" should be visible
  93 + Then I should see "identifier-change-confirmation"
94 94 When I follow "No"
95   - Then the "#identifier-change-confirmation" should not be visible
  95 + Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem"
... ...
features/environment_name.feature
... ... @@ -3,6 +3,7 @@ Feature: setting environment name
3 3 I want to change the name of the environment
4 4 So that it appears in the window's title bar
5 5  
  6 + @fixme
6 7 Scenario: setting environment name through administration panel
7 8 Given I am logged in as admin
8 9 When I follow "Administration"
... ...
features/events.feature
... ... @@ -184,7 +184,7 @@ Feature: events
184 184 And "josesilva" is a member of "Sample Community"
185 185 And I go to josesilva's control panel
186 186 And I follow "Manage Content"
187   - And I follow "Another Conference" and wait
  187 + And I follow "Another Conference"
188 188 And I follow "Spread"
189 189 And I check "Sample Community"
190 190 And I press "Spread this"
... ... @@ -213,15 +213,15 @@ Feature: events
213 213 And I am on josesilva's Event creation
214 214 Then I should see "Lead"
215 215  
216   - @selenium
  216 + @selenium @fixme
217 217 Scenario: events lead should be shown on blogs with short format
218 218 Given I am logged in as "josesilva"
219 219 And I am on josesilva's control panel
220   - And I follow "Configure blog" and wait
  220 + And I follow "Configure blog"
221 221 And I select "First paragraph" from "How to display posts:"
222 222 And I press "Save"
223 223 And I follow "New post"
224   - And I follow "A calendar event" and wait
  224 + And I follow "A calendar event"
225 225 And I fill in "Title" with "Leaded event"
226 226 And I type "This is the abstract." in TinyMCE field "article_abstract"
227 227 And I type "This is the real text." in TinyMCE field "article_body"
... ...
features/step_definitions/custom_web_steps.rb
... ... @@ -4,6 +4,14 @@ Then /^"([^"]*)" should not be visible within "([^"]*)"$/ do |text, selector|
4 4 end
5 5 end
6 6  
  7 +Then /^I should see "([^"]*)" link$/ do |text|
  8 + page.should have_css('a', :text => text)
  9 +end
  10 +
  11 +Then /^I should not see "([^"]*)" link$/ do |text|
  12 + page.should have_no_css('a', :text => text)
  13 +end
  14 +
7 15 When /^I reload and wait for the page$/ do
8 16 raise "Why why need this? Remove!"
9 17 visit page.driver.browser.current_url
... ...
features/step_definitions/internationalization_steps.rb
  1 +# -*- coding: utf-8 -*-
1 2 def language_to_code(name)
2 3 {
3 4 'Brazilian Portuguese' => 'pt-br',
... ... @@ -35,7 +36,7 @@ Given /^a user accessed in (.*) before$/ do |lang|
35 36 end
36 37  
37 38 Given /^my browser prefers (.*)$/ do |lang|
38   - header 'Accept-Language', language_to_code(lang)
  39 + page.driver.header 'Accept-Language', language_to_code(lang)
39 40 end
40 41  
41 42 Then /^the site should be in (.*)$/ do |lang|
... ...
features/support/paths.rb
... ... @@ -46,7 +46,7 @@ module NavigationHelpers
46 46 '/myprofile/%s/cms/new?type=%s' % [Profile.find_by_name($1).identifier,$2]
47 47  
48 48 when /^(.*)'s sitemap/
49   - '/profile/%s/sitemap' % Profile.find_by_name($1).identifier
  49 + '/profile/%s/sitemap' % $1
50 50  
51 51 when /^(.*)'s profile$/
52 52 '/profile/' + $1
... ... @@ -82,7 +82,7 @@ module NavigationHelpers
82 82 '/search/%s' % $1
83 83  
84 84 when /^(.+)'s cms/
85   - '/myprofile/%s/cms' % Profile.find_by_name($1).identifier
  85 + '/myprofile/%s/cms' % $1
86 86  
87 87 when /^"(.+)" edit page/
88 88 article = Article.find_by_name($1)
... ...