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