PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/features/search_contents.feature

https://gitlab.com/noosfero-mes/noosfero-mes
Gherkin Specification | 271 lines | 246 code | 25 blank | 0 comment | 21 complexity | cef10014b29e5cdf6a264b5d280be046 MD5 | raw file
  1. Feature: search contents
  2. As a noosfero user
  3. I want to search contents
  4. In order to find ones that interest me
  5. Background:
  6. Given the following users
  7. | login | name |
  8. | joaosilva | Joao Silva |
  9. And the following articles
  10. | owner | name | body |
  11. | joaosilva | bees and butterflies | this is an article about bees and butterflies |
  12. | joaosilva | whales and dolphins | this is an article about whales and dolphins |
  13. Scenario: show recent content on index
  14. When I go to the search articles page
  15. Then I should see "bees and butterflies" within "#search-results"
  16. And I should see "whales and dolphins" within "#search-results"
  17. Scenario: simple search for text articles
  18. When I search contents for "whales"
  19. Then I should see "whales and dolphins" within ".search-text-article-item"
  20. And I should see "whales and dolphins" within ".only-one-result-box"
  21. And I should not see "bees and butterflies"
  22. When I follow "whales and dolphins"
  23. Then I should be on article "whales and dolphins"
  24. Scenario: simple search for event
  25. Given the following communities
  26. | identifier | name |
  27. | nice-people | Nice people |
  28. And the following events
  29. | owner | name | start_date | end_date |
  30. | nice-people | Group meeting | 2009-01-01 | 2009-01-02 |
  31. | nice-people | John Doe's birthday | 2009-09-01 | 2009-09-02 |
  32. When I search contents for "birthday"
  33. Then I should see "John Doe's birthday" within ".search-event-item"
  34. And I should see "Start date"
  35. And I should see "2009-09-01"
  36. And I should see "End date"
  37. And I should see "2009-09-02"
  38. And I should not see "Group meeting"
  39. When I follow "John Doe's birthday"
  40. Then I should be on article "John Doe's birthday"
  41. Scenario: simple search for folder
  42. Given the following folders
  43. | owner | name |
  44. | joaosilva | Music Folder |
  45. | joaosilva | Videos Folder |
  46. When I search contents for "Music"
  47. Then I should see "Music Folder" within ".search-folder-item"
  48. And I should see "None" within ".search-folder-items"
  49. And I should not see "Videos Folder"
  50. When I follow "Music Folder"
  51. Then I should be on article "Music Folder"
  52. Scenario: simple search for forum
  53. Given the following forums
  54. | owner | name |
  55. | joaosilva | Games Forum |
  56. | joaosilva | Movies Folder |
  57. When I search contents for "Games"
  58. Then I should see "Games Forum" within ".search-forum-item"
  59. And I should see "None" within ".search-forum-items"
  60. And I should not see "Movies Folder"
  61. When I follow "Games Forum"
  62. Then I should be on article "Games Forum"
  63. Scenario: simple search for gallery
  64. Given the following galleries
  65. | owner | name |
  66. | joaosilva | Landscape Photos |
  67. | joaosilva | People Photos |
  68. When I search contents for "Landscape"
  69. Then I should see "Landscape Photos" within ".search-gallery"
  70. And I should not see "People Photos"
  71. When I follow "Landscape Photos"
  72. Scenario: simple search for uploaded file
  73. Given the following uploaded files
  74. | owner | filename |
  75. | joaosilva | rails.png |
  76. | joaosilva | shoes.png |
  77. When I search contents for "rails.png"
  78. Then I should see "rails.png" within ".search-uploaded-file-item"
  79. And I should not see "shoes.png"
  80. When I follow "rails.png"
  81. Then I should be on article "rails.png"
  82. Scenario: show event search results without end date
  83. Given the following communities
  84. | identifier | name |
  85. | nice-people | Nice people |
  86. And the following events
  87. | owner | name |
  88. | nice-people | John Doe's birthday |
  89. When I search contents for "birthday"
  90. Then I should see "John Doe's birthday" within ".search-event-item"
  91. And I should not see "End date"
  92. Scenario: show and link last items on folder search results
  93. Given the following folders
  94. | owner | name |
  95. | joaosilva | Music Folder |
  96. And the following articles
  97. | owner | name | parent |
  98. | joaosilva | Steven Wilson | Music Folder |
  99. | joaosilva | Porcupine Tree | Music Folder |
  100. | joaosilva | Blackfield | Music Folder |
  101. When I search contents for "Music"
  102. Then I should see "Last items" within ".search-folder-items"
  103. And I should see "Blackfield"
  104. And I should see "Porcupine Tree"
  105. And I should see "Steven Wilson"
  106. When I follow "Porcupine Tree"
  107. Then I should be on article "Porcupine Tree"
  108. Scenario: show and link last topics on forum search results
  109. Given the following forums
  110. | owner | name |
  111. | joaosilva | Games Forum |
  112. And the following articles
  113. | owner | name | parent |
  114. | joaosilva | Mass Effect 3 | Games Forum |
  115. | joaosilva | The Witcher 2 | Games Forum |
  116. | joaosilva | Syndicate | Games Forum |
  117. And the following rss feeds
  118. | joaosilva | Diablo 3 News Feed | Games Forum |
  119. When I search contents for "Games"
  120. Then I should see "Last topics" within ".search-forum-items"
  121. And I should see "Syndicate"
  122. And I should see "The Witcher 2"
  123. And I should see "Mass Effect 3"
  124. And I should not see "Diablo 3"
  125. When I follow "The Witcher 2"
  126. Then I should be on article "The Witcher 2"
  127. Scenario: link to parent in uploaded file search results
  128. Given the following folders
  129. | owner | name |
  130. | joaosilva | Folder for Uploaded Files |
  131. Given the following uploaded files
  132. | owner | parent | filename |
  133. | joaosilva | Folder for Uploaded Files | rails.png |
  134. When I search contents for "rails.png"
  135. Then I should see "Folder for Uploaded Files" within ".search-uploaded-file-parent"
  136. When I follow "Folder for Uploaded Files"
  137. Then I should be on article "Folder for Uploaded Files"
  138. Scenario: link to author on search results
  139. When I go to the search articles page
  140. And I fill in "search-input" with "whales"
  141. And I press "Search"
  142. Then I should see "Author" within ".search-article-author"
  143. Then I should see "Joao Silva" within ".search-article-author-name"
  144. When I follow "Joao Silva"
  145. Then I should be on joaosilva's profile
  146. Scenario: show clean description excerpt on search results
  147. Given the following articles
  148. | owner | name | body |
  149. | 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. |
  150. When I go to the search articles page
  151. And I fill in "search-input" with "island"
  152. And I press "Search"
  153. Then I should see "Description" within ".search-article-description"
  154. And I should see "The island Herreninsel, with" within ".search-article-description"
  155. And I should see "and Kraut..." within ".search-article-description"
  156. Scenario: show empty description on search results
  157. Given the following articles
  158. | owner | name | body |
  159. | joaosilva | Herreninsel | |
  160. When I go to the search articles page
  161. And I fill in "search-input" with "Herreninsel"
  162. And I press "Search"
  163. Then I should see "None" within ".search-article-description"
  164. Scenario: link to tags on search results
  165. Given the following tags
  166. | article | name |
  167. | bees and butterflies | Hymenoptera |
  168. | bees and butterflies | Lepidoptera |
  169. When I go to the search articles page
  170. And I fill in "search-input" with "bees"
  171. And I press "Search"
  172. Then I should see "Tags" within ".search-article-tags"
  173. And I should see "Hymenoptera" within ".search-article-tags"
  174. And I should see "Lepidoptera" within ".search-article-tags"
  175. When I follow "Hymenoptera"
  176. Then I should be on Hymenoptera's tag page
  177. Scenario: show empty tags in search results
  178. When I go to the search articles page
  179. And I fill in "search-input" with "dolphins"
  180. And I press "Search"
  181. Then I should see "None" within ".search-article-tags"
  182. Scenario: link to categories on search results
  183. Given the following category
  184. | name |
  185. | Soviet |
  186. And the following articles
  187. | owner | name | body | category |
  188. | joaosilva | Sergei Sorokin | Retired ice hockey player | soviet |
  189. When I go to the search articles page
  190. And I fill in "search-input" with "hockey"
  191. And I press "Search"
  192. Then I should see "Categories" within ".search-article-categories"
  193. And I should see "Soviet" within ".search-article-category"
  194. Scenario: show empty categories on search results
  195. When I go to the search articles page
  196. And I fill in "search-input" with "whales"
  197. And I press "Search"
  198. Then I should see "whales and dolphins"
  199. And I should see "None" within ".search-article-categories-container"
  200. Scenario: show date of last update from original author
  201. When I search contents for "whales"
  202. Then I should see "Last update:" within ".search-article-author-changes"
  203. Scenario: show date of last update from another author
  204. Given the following users
  205. | login | name |
  206. | sglaspell | Susan Glaspell |
  207. And the article "whales and dolphins" is updated by "Susan Glaspell"
  208. When I search contents for "whales"
  209. Then I should see "by Susan Glaspell at" within ".search-article-author-changes"
  210. Scenario: show basic info on blog search results
  211. Given the following blogs
  212. | owner | name |
  213. | joaosilva | JSilva blog |
  214. When I search contents for "JSilva"
  215. Then I should see "JSilva blog" within ".search-result-title"
  216. And The page should contain ".icon-content-blog"
  217. Scenario: show and link last posts on blog search results
  218. Given the following blogs
  219. | owner | name |
  220. | joaosilva | JSilva blog |
  221. And the following articles
  222. | owner | parent | name |
  223. | joaosilva | JSilva blog | post #1 |
  224. | joaosilva | JSilva blog | post #2 |
  225. | joaosilva | JSilva blog | post #4 |
  226. And the following rss feeds
  227. | joaosilva | JSilva blog | post #3 |
  228. When I search contents for "JSilva"
  229. Then I should see "Last posts" within ".search-blog-items"
  230. And I should see "post #1"
  231. And I should see "post #2"
  232. And I should not see "post #3"
  233. And I should see "post #4"
  234. When I follow "post #1"
  235. Then I should be on article "post #1"
  236. Scenario: show empty last posts on blog search results
  237. Given the following blogs
  238. | owner | name |
  239. | joaosilva | JSilva blog |
  240. When I search contents for "JSilva"
  241. Then I should see "None" within ".search-blog-items"
  242. Scenario: find enterprises without exact query
  243. When I go to the search articles page
  244. And I fill in "search-input" with "bees and"
  245. And I press "Search"
  246. Then I should see "bees and butterflies" within "#search-results"