Commit c2769f231c376cd10c4bf3bcf137fa78cc69151b

Authored by Daniela Feitosa
1 parent f9a2a05d

Fixed test: features/search_contents.feature

features/search_contents.feature
... ... @@ -26,7 +26,7 @@ Feature: search contents
26 26 Then I should see "whales and dolphins" within ".search-text-article-item"
27 27 And I should see "whales and dolphins" within ".only-one-result-box"
28 28 And I should not see "bees and butterflies"
29   - And I should see content inside ".icon-content-textile-article"
  29 + And The page should contain ".icon-content-textile-article"
30 30 When I follow "whales and dolphins"
31 31 Then I should be on article "whales and dolphins"
32 32  
... ... @@ -155,19 +155,19 @@ Feature: search contents
155 155  
156 156 Scenario: link to author on search results
157 157 When I go to the search articles page
158   - And I fill in "query" with "whales"
  158 + And I fill in "search-input" with "whales"
159 159 And I press "Search"
160 160 Then I should see "Author" within ".search-article-author"
161 161 Then I should see "Joao Silva" within ".search-article-author-name"
162 162 When I follow "Joao Silva"
163   - Then I should be on Joao Silva's profile
  163 + Then I should be on joaosilva's profile
164 164  
165 165 Scenario: show clean description excerpt on search results
166 166 Given the following articles
167 167 | owner | name | body |
168 168 | joaosilva | Herreninsel | The island <b>Herreninsel</b>, with an area of 238 hectares, is the biggest of the three main islands of the Chiemsee, a lake in the state of Bavaria, Germany. Together with the islands of Fraueninsel and Krautinsel it forms the municipality of Chiemsee. |
169 169 When I go to the search articles page
170   - And I fill in "query" with "island"
  170 + And I fill in "search-input" with "island"
171 171 And I press "Search"
172 172 Then I should see "Description" within ".search-article-description"
173 173 And I should see "The island Herreninsel, with" within ".search-article-description"
... ... @@ -178,7 +178,7 @@ Feature: search contents
178 178 | owner | name | body |
179 179 | joaosilva | Herreninsel | |
180 180 When I go to the search articles page
181   - And I fill in "query" with "Herreninsel"
  181 + And I fill in "search-input" with "Herreninsel"
182 182 And I press "Search"
183 183 Then I should see "None" within ".search-article-description"
184 184  
... ... @@ -188,7 +188,7 @@ Feature: search contents
188 188 | bees and butterflies | Hymenoptera |
189 189 | bees and butterflies | Lepidoptera |
190 190 When I go to the search articles page
191   - And I fill in "query" with "bees"
  191 + And I fill in "search-input" with "bees"
192 192 And I press "Search"
193 193 Then I should see "Tags" within ".search-article-tags"
194 194 And I should see "Hymenoptera" within ".search-article-tags"
... ... @@ -198,7 +198,7 @@ Feature: search contents
198 198  
199 199 Scenario: show empty tags in search results
200 200 When I go to the search articles page
201   - And I fill in "query" with "dolphins"
  201 + And I fill in "search-input" with "dolphins"
202 202 And I press "Search"
203 203 Then I should see "None" within ".search-article-tags"
204 204  
... ... @@ -210,14 +210,14 @@ Feature: search contents
210 210 | owner | name | body | category |
211 211 | joaosilva | Sergei Sorokin | Retired ice hockey player | soviet |
212 212 When I go to the search articles page
213   - And I fill in "query" with "hockey"
  213 + And I fill in "search-input" with "hockey"
214 214 And I press "Search"
215 215 Then I should see "Categories" within ".search-article-categories"
216 216 And I should see "Soviet" within ".search-article-category"
217 217  
218 218 Scenario: show empty categories on search results
219 219 When I go to the search articles page
220   - And I fill in "query" with "whales"
  220 + And I fill in "search-input" with "whales"
221 221 And I press "Search"
222 222 Then I should see "whales and dolphins"
223 223 And I should see "None" within ".search-article-categories-container"
... ... @@ -243,7 +243,7 @@ Feature: search contents
243 243 | owner | name | body | category |
244 244 | joaosilva | using noosfero | noosfero is a great CMS | software-livre |
245 245 When I go to the search articles page
246   - And I fill in "query" with "Software"
  246 + And I fill in "search-input" with "Software"
247 247 And I press "Search"
248 248 Then I should see "using noosfero" within "#search-results"
249 249 And I should not see "bees and butterflies"
... ... @@ -255,7 +255,7 @@ Feature: search contents
255 255 | joaosilva | JSilva blog |
256 256 When I search contents for "JSilva"
257 257 Then I should see "JSilva blog" within ".search-result-title"
258   - And I should see content inside ".icon-content-blog"
  258 + And The page should contain ".icon-content-blog"
259 259  
260 260 Scenario: show and link last posts on blog search results
261 261 Given the following blogs
... ... @@ -286,7 +286,7 @@ Feature: search contents
286 286  
287 287 Scenario: see default facets when searching
288 288 When I go to the search articles page
289   - And I fill in "query" with "bees"
  289 + And I fill in "search-input" with "bees"
290 290 And I press "Search"
291 291 Then I should see "Type" within "#facets-menu"
292 292 And I should see "Published date" within "#facets-menu"
... ... @@ -295,7 +295,7 @@ Feature: search contents
295 295  
296 296 Scenario: find enterprises without exact query
297 297 When I go to the search articles page
298   - And I fill in "query" with "article bees"
  298 + And I fill in "search-input" with "article bees"
299 299 And I press "Search"
300 300 Then I should see "bees and butterflies" within "#search-results"
301 301  
... ... @@ -309,7 +309,7 @@ Feature: search contents
309 309 | joaosilva | noosfero and debian | this is an article about noosfero and debian | software-livre |
310 310 | joaosilva | facebook and 1984 | this is an article about facebook and 1984 | big-brother |
311 311 When I go to the search articles page
312   - And I fill in "query" with "this is an article"
  312 + And I fill in "search-input" with "this is an article"
313 313 And I press "Search"
314 314 # Then show me the page
315 315 And I follow "Software Livre" within "#facets-menu"
... ... @@ -329,10 +329,10 @@ Feature: search contents
329 329 | joaosilva | facebook and 1984 | this is an article about facebook and 1984 | big-brother |
330 330 | joaosilva | facebook defense | facebook is not so bad | software-livre |
331 331 When I go to the search articles page
332   - And I fill in "query" with "this is an article"
  332 + And I fill in "search-input" with "this is an article"
333 333 And I press "Search"
334 334 And I follow "Software Livre" within "#facets-menu"
335   - And I fill in "query" with "facebook"
  335 + And I fill in "search-input" with "facebook"
336 336 And I press "Search"
337 337 Then I should see "facebook defense" within "#search-results"
338 338 And I should not see "1984"
... ...
features/step_definitions/noosfero_steps.rb
... ... @@ -422,6 +422,10 @@ Then /^The page title should contain &quot;(.*)&quot;$/ do |text|
422 422 end
423 423 end
424 424  
  425 +Then /^The page should contain "(.*)"$/ do |selector|
  426 + page.should have_css("#{selector}")
  427 +end
  428 +
425 429 Then /^The page should not contain "(.*)"$/ do |selector|
426 430 page.should have_no_css("#{selector}")
427 431 end
... ...