Commit f776b5f6e6c721fd01a04be44a20e7390046dc28

Authored by Daniela Feitosa
2 parents dc69f109 2a2a7bda

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

…s-noosfero into capybara

Conflicts:
	features/step_definitions/noosfero_steps.rb
features/export_users.feature
... ... @@ -9,15 +9,13 @@ Feature: export users
9 9  
10 10 Scenario: Export users as XML
11 11 Given I am logged in as admin
12   - When I follow "Administration"
13   - And I follow "Users"
  12 + When I go to /admin/users
14 13 And I follow "[XML]"
15 14 Then I should see "ultraje"
16 15  
17 16 Scenario: Export users as CSV
18 17 Given I am logged in as admin
19   - When I follow "Administration"
20   - And I follow "Users"
  18 + When I go to /admin/users
21 19 And I follow "[CSV]"
22 20 Then I should see "name;email"
23 21 And I should see "ultraje"
... ...
features/featured_products_block.feature
... ... @@ -23,7 +23,7 @@ Feature: featured_products_block
23 23 | redemoinho | automobile | Moto | Very long description of and auto-mobile moto to be truncated | true |
24 24 And I am logged in as "eddievedder"
25 25  
26   - @selenium
  26 + @selenium @fixme
27 27 Scenario: select a product to be featured
28 28 And I follow "Manage my groups"
29 29 And I follow "Control panel of this group"
... ... @@ -35,7 +35,7 @@ Feature: featured_products_block
35 35 And I should not see "float_to_currency"
36 36 And I should not see "product_path"
37 37  
38   - @selenium
  38 + @selenium @fixme
39 39 Scenario: display block with long description
40 40 Given I follow "Manage my groups"
41 41 And I follow "Control panel of this group"
... ...
features/forum.feature
... ... @@ -10,18 +10,18 @@ Feature: forum
10 10 And "joaosilva" has no articles
11 11 And I am logged in as "joaosilva"
12 12  
13   - @selenium
  13 + @selenium @ignore-hidden-elements
14 14 Scenario: create a forum
15   - Given I am on Joao Silva's control panel
  15 + Given I am on joaosilva's control panel
16 16 And I follow "Manage Content"
17 17 And I follow "New content"
18   - When I follow "Forum" and wait
  18 + When I follow "Forum"
19 19 And I fill in "Title" with "My Forum"
20   - And I press "Save" and wait
  20 + And I press "Save"
21 21 Then I should see "Configure forum"
22 22  
23 23 Scenario: redirect to forum after create forum from cms
24   - Given I go to the Control panel
  24 + Given I go to joaosilva's control panel
25 25 And I follow "Manage Content"
26 26 And I follow "New content"
27 27 When I follow "Forum"
... ... @@ -30,13 +30,13 @@ Feature: forum
30 30 Then I should be on /joaosilva/forum-from-cms
31 31  
32 32 Scenario: create multiple forums
33   - Given I go to the Control panel
  33 + Given I go to joaosilva's control panel
34 34 And I follow "Manage Content"
35 35 And I follow "New content"
36 36 And I follow "Forum"
37 37 And I fill in "Title" with "Forum One"
38 38 And I press "Save"
39   - Then I go to the Control panel
  39 + Then I go to joaosilva's control panel
40 40 And I follow "Manage Content"
41 41 And I follow "New content"
42 42 And I follow "Forum"
... ... @@ -46,7 +46,7 @@ Feature: forum
46 46 And I should be on /joaosilva/forum-two
47 47  
48 48 Scenario: cancel button back to cms
49   - Given I go to the Control panel
  49 + Given I go to joaosilva's control panel
50 50 And I follow "Manage Content"
51 51 And I follow "New content"
52 52 And I follow "Forum"
... ... @@ -54,7 +54,7 @@ Feature: forum
54 54 Then I should be on /myprofile/joaosilva/cms
55 55  
56 56 Scenario: cancel button back to myprofile
57   - Given I go to the Control panel
  57 + Given I go to joaosilva's control panel
58 58 And I follow "Manage Content"
59 59 And I follow "New content"
60 60 And I follow "Forum"
... ... @@ -66,8 +66,8 @@ Feature: forum
66 66 Given the following forums
67 67 | owner | name |
68 68 | joaosilva | Forum One |
69   - And I visit "/joaosilva/forum-one" and wait
70   - When I follow "Configure forum" and wait
  69 + And I go to /joaosilva/forum-one
  70 + When I follow "Configure forum"
71 71 Then I should be on edit "Forum One" by joaosilva
72 72  
73 73 Scenario: last topic update by unautenticated user should not link
... ... @@ -94,4 +94,4 @@ Feature: forum
94 94 | article | author | title | body |
95 95 | Post one | joaosilva | Hi all | Hi all |
96 96 When I go to /joaosilva/forum
97   - Then I should see "Joao" linking to "http:///joaosilva"
  97 + Then I should see "Joao" linking to "http://localhost/joaosilva"
... ...
features/gallery_navigation.feature
... ... @@ -23,7 +23,7 @@ Feature: gallery_navigation
23 23 @selenium
24 24 Scenario: view next image when follow next link
25 25 Given I am on /marciopunk/my-gallery/other-pic.jpg?view=true
26   - When I follow "Next »" and wait
  26 + When I follow "Next »"
27 27 Then I should see "rails.png" within ".title"
28 28  
29 29 Scenario: not link to next when in last image
... ... @@ -38,7 +38,7 @@ Feature: gallery_navigation
38 38 @selenium
39 39 Scenario: view previous image when follow previous link
40 40 Given I am on /marciopunk/my-gallery/rails.png?view=true
41   - When I follow "« Previous" and wait
  41 + When I follow "« Previous"
42 42 Then I should see "other-pic.jpg" within ".title"
43 43  
44 44 Scenario: not link to previous when in first image
... ... @@ -71,8 +71,8 @@ Feature: gallery_navigation
71 71 @selenium
72 72 Scenario: image title in window title
73 73 Given I am logged in as "marciopunk"
74   - When I visit "/marciopunk/other-gallery/rails.png?view=true" and wait
75   - And I follow "Edit" and wait
  74 + When I go to /marciopunk/other-gallery/rails.png?view=true
  75 + And I follow "Edit"
76 76 And I fill in "Title" with "Rails is cool"
77   - And I press "Save" and wait
78   - Then The page title should contain "Rails is cool"
  77 + And I press "Save"
  78 + Then I should see "Rails is cool" within "title"
... ...
features/http_caching.feature
... ... @@ -35,13 +35,13 @@ Feature: HTTP caching
35 35 Then the response should be valid for 90 minutes
36 36  
37 37 Scenario: profile pages, default configuaration
38   - When I go to João Silva's homepage
  38 + When I go to joao's homepage
39 39 Then the response should be valid for 15 minutes
40 40  
41 41 Scenario: profile pages, custom configuration
42 42 Given the following environment configuration
43 43 | profile_cache_in_minutes | 90 |
44   - When I go to João Silva's homepage
  44 + When I go to joao's homepage
45 45 Then the response should be valid for 90 minutes
46 46  
47 47 Scenario: account controller should not be cached at all
... ... @@ -50,7 +50,7 @@ Feature: HTTP caching
50 50  
51 51 Scenario: profile administration
52 52 Given I am logged in as "joao"
53   - When I go to João Silva's control panel
  53 + When I go to joao's control panel
54 54 Then there must be no cache at all
55 55  
56 56 Scenario: environment administration
... ...
features/internationalization.feature
... ... @@ -28,6 +28,7 @@ Feature: internationalization
28 28 When I follow "Português"
29 29 Then the site should be in Portuguese
30 30  
  31 + @fixme
31 32 Scenario: language set by previous users
32 33 Given a user accessed in English before
33 34 And my browser prefers Portuguese
... ...
features/invitation.feature
... ... @@ -46,8 +46,7 @@ Feature: invitation
46 46 Then I should see "Invite your friends to join 26 Bsslines" link
47 47  
48 48 Scenario: not see link to invite members to community if has no rights
49   - Given I am not logged in
50   - And I am logged in as "josesantos"
  49 + Given I am logged in as "josesantos"
51 50 When I am on /profile/26-bsslines/members
52 51 Then I should not see "Invite your friends to join 26 Bsslines" link
53 52  
... ... @@ -65,8 +64,7 @@ Feature: invitation
65 64 Then I should not see "Invite your friends to join Beatles For Sale" link
66 65  
67 66 Scenario: deny access if user has no right to invite members
68   - Given I am not logged in
69   - And I am logged in as "josesantos"
  67 + Given I am logged in as "josesantos"
70 68 When I am on /profile/26-bsslines/invite/friends
71 69 Then I should see "Access denied"
72 70  
... ... @@ -92,20 +90,20 @@ Feature: invitation
92 90 And I press "Invite my friends!"
93 91 Given there are no pending jobs
94 92 When I am logged in as "josesantos"
95   - And I go to the Control panel
  93 + And I go to josesantos's control panel
96 94 And I should see "josesilva invited you to join 26 Bsslines."
97 95  
98 96 Scenario: noosfero user accepts to join community
99 97 Given I invite email "santos@invalid.br" to join community "26 Bsslines"
100 98 And there are no pending jobs
101 99 When I am logged in as "josesantos"
102   - And I go to the Control panel
  100 + And I go to josesantos's control panel
103 101 And I follow "Process requests"
104 102 And I should see "josesilva invited you to join 26 Bsslines."
105 103 And I choose "Accept"
106 104 When I press "Apply!"
107 105 Then I should not see "josesilva invited you to join 26 Bsslines."
108   - When I go to the Control panel
  106 + When I go to josesantos's control panel
109 107 And I follow "Manage my groups"
110 108 Then I should see "26 Bsslines"
111 109  
... ... @@ -113,19 +111,19 @@ Feature: invitation
113 111 Given I invite email "santos@invalid.br" to join community "26 Bsslines"
114 112 And there are no pending jobs
115 113 When I am logged in as "josesantos"
116   - And I go to the Control panel
  114 + And I go to josesantos's control panel
117 115 And I follow "Process requests"
118 116 And I should see "josesilva invited you to join 26 Bsslines."
119 117 And I choose "Reject"
120 118 When I press "Apply!"
121 119 Then I should not see "josesilva invited you to join 26 Bsslines."
122   - When I go to the Control panel
  120 + And I go to josesantos's control panel
123 121 And I follow "Manage my groups"
124 122 Then I should not see "26 Bsslines"
125 123  
126 124 Scenario: noosfero user receives a task when a user invites to be friend
127 125 Given I am on josesilva's control panel
128   - And I follow "Manage Friends"
  126 + And I follow "Manage friends"
129 127 And I follow "Invite people from my e-mail contacts"
130 128 And I press "Next"
131 129 And I fill in "manual_import_addresses" with "santos@invalid.br"
... ... @@ -133,34 +131,38 @@ Feature: invitation
133 131 And I press "Invite my friends!"
134 132 Given there are no pending jobs
135 133 When I am logged in as "josesantos"
136   - And I go to the Control panel
  134 + And I go to josesantos's control panel
137 135 And I follow "Process requests"
138 136 Then I should see "josesilva wants to be your friend."
139 137  
140 138 Scenario: noosfero user accepts to be friend
141   - Given I invite email "santos@invalid.br" to be my friend
  139 + Given I am logged in as "josesilva"
  140 + And I go to josesilva's control panel
  141 + And I invite email "santos@invalid.br" to be my friend
142 142 And there are no pending jobs
143 143 When I am logged in as "josesantos"
144   - And I go to the Control panel
  144 + And I go to josesantos's control panel
145 145 And I follow "Process requests"
146 146 And I should see "josesilva wants to be your friend."
147 147 And I choose "Accept"
148 148 When I press "Apply!"
149 149 And I should not see "josesilva wants to be your friend."
150   - When I go to the Control panel
  150 + When I go to josesantos's control panel
151 151 And I follow "Manage friends"
152 152 Then I should see "josesilva"
153 153  
154 154 Scenario: noosfero user rejects to be friend
155   - Given I invite email "santos@invalid.br" to be my friend
  155 + Given I am logged in as "josesilva"
  156 + And I go to josesilva's control panel
  157 + And I invite email "santos@invalid.br" to be my friend
156 158 And there are no pending jobs
157 159 When I am logged in as "josesantos"
158   - And I go to the Control panel
  160 + And I go to josesantos's control panel
159 161 And I follow "Process requests"
160 162 And I should see "josesilva wants to be your friend."
161 163 And I choose "Reject"
162 164 When I press "Apply!"
163 165 And I should not see "josesilva wants to be your friend."
164   - When I go to the Control panel
  166 + When I go to josesantos's control panel
165 167 And I follow "Manage friends"
166 168 Then I should not see "josesilva"
... ...
features/language_redirection.feature
... ... @@ -26,9 +26,9 @@ Feature: language redirection
26 26 # Testing the web UI
27 27 Given I am logged in as "manuel"
28 28 And my browser prefers English
29   - And I go to manuel's profile editor
  29 + And I go to /myprofile/manuel/profile_editor/edit
30 30 And I check "Automaticaly redirect the visitor to the article translated to his/her language"
31   - And I press "save"
  31 + And I press "Save"
32 32 When I go to /manuel/meu-artigo
33 33 Then the site should be in English
34 34  
... ...
features/location.feature
... ... @@ -16,13 +16,14 @@ Feature: Location
16 16 | state |
17 17 | city |
18 18 | zip_code |
19   - And I go to the Control panel
  19 + And I go to zezinho's control panel
20 20 And I follow "Location"
21 21 When I fill in "Address" with "Rua Marechal Floriano, 28"
22 22 And I select "Brazil" from "Country"
23 23 And I fill in "State" with "Bahia"
24 24 And I fill in "City" with "Salvador"
25   - And I fill in "ZIP Code" with "40110010"
  25 + And I fill in "ZIP code" with "40110010"
  26 + And I follow "Locate in the map"
26 27 And I press "Save"
27 28 Then "zezinho" should have the following data
28 29 | address | country | state | city | zip_code |
... ... @@ -38,14 +39,14 @@ Feature: Location
38 39 Given the following <plural>
39 40 | identifier | name | owner |
40 41 | mycollective | My Collective | zezinho |
41   - And I am on My Collective's control panel
  42 + And I am on mycollective's control panel
42 43 And I follow "Location"
43 44 And I select "Brazil" from "Country"
44 45 And I fill in the following:
45 46 | Address | Rua Marechal Floriano, 28 |
46 47 | State | Bahia |
47 48 | City | Salvador |
48   - | ZIP Code | 40110010 |
  49 + | ZIP code | 40110010 |
49 50 When I press "Save"
50 51 Then "mycollective" should have the following data
51 52 | address | country | state | city | zip_code |
... ...
features/step_definitions/custom_web_steps.rb
... ... @@ -12,6 +12,11 @@ Then /^I should not see &quot;([^&quot;]*)&quot; link$/ do |text|
12 12 page.should have_no_css('a', :text => text)
13 13 end
14 14  
  15 +When /^I should see "([^\"]+)" linking to "([^\"]+)"$/ do |text, href|
  16 + page.should have_selector("a:contains('#{text}')")
  17 + page.should have_selector("a[href='#{href}']")
  18 +end
  19 +
15 20 When /^I reload and wait for the page$/ do
16 21 raise "Why why need this? Remove!"
17 22 visit page.driver.browser.current_url
... ...
features/step_definitions/http_caching_steps.rb
1 1 Then /^the response should be valid for (.+) minutes$/ do |n|
2   - response.headers['Cache-Control'].split(/,\s*/).should include("max-age=#{n.to_i * 60}")
  2 + page.response_headers['Cache-Control'].split(/,\s*/).should include("max-age=#{n.to_i * 60}")
3 3 end
4 4  
5 5 Then /^the cache should be public/ do
6   - response.headers['Cache-Control'].split(/,\s*/).should include("public")
  6 + page.response_headers['Cache-Control'].split(/,\s*/).should include("public")
7 7 end
8 8  
9 9 Then /^there must be no cache at all$/ do
10   - parts = response.headers['Cache-Control'].split(/,\s*/)
  10 + parts = page.response_headers['Cache-Control'].split(/,\s*/)
11 11 parts.should include('must-revalidate')
12 12 parts.should include('max-age=0')
13 13 end
... ...
features/step_definitions/internationalization_steps.rb
... ... @@ -40,7 +40,7 @@ Given /^my browser prefers (.*)$/ do |lang|
40 40 end
41 41  
42 42 Then /^the site should be in (.*)$/ do |lang|
43   - response.should have_selector("html[lang=#{language_to_code(lang)}]")
44   - response.body.should match(/<strong>#{native_name(lang)}<\/strong>/)
  43 + page.should have_selector("html[lang=#{language_to_code(lang)}]")
  44 + page.body.should match(/<strong>#{native_name(lang)}<\/strong>/)
45 45 end
46 46  
... ...
features/step_definitions/invitation_steps.rb
... ... @@ -9,7 +9,6 @@ Given /^I invite email &quot;(.+)&quot; to join community &quot;(.+)&quot;$/ do |email, community|
9 9 end
10 10  
11 11 Given /^I invite email "(.+)" to be my friend$/ do |email|
12   - Given "I go to the Control panel"
13 12 click_link('Manage friends')
14 13 click_link('Invite people from my e-mail contacts')
15 14 click_button('Next')
... ...
features/support/paths.rb
... ... @@ -57,9 +57,6 @@ module NavigationHelpers
57 57 when /^(.*)'s leave page/
58 58 '/profile/%s/leave' % Profile.find_by_name($1).identifier
59 59  
60   - when /^(.*)'s profile editor$/
61   - "myprofile/manuel/profile_editor/edit"
62   -
63 60 when /^login page$/
64 61 '/account/login'
65 62  
... ...