Commit 5b7d7777ae2f285525c544ca49a1089ef7964035
1 parent
c5363ef0
Exists in
master
and in
22 other branches
Cucumber feature for searching contents (articles, etc.)
Showing
1 changed file
with
95 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,95 @@ | @@ -0,0 +1,95 @@ | ||
| 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 | + | ||
| 6 | + Background: | ||
| 7 | + Given the search index is empty | ||
| 8 | + And the following users | ||
| 9 | + | login | name | | ||
| 10 | + | joaosilva | Joao Silva | | ||
| 11 | + And the following articles | ||
| 12 | + | owner | name | body | | ||
| 13 | + | joaosilva | bees and butterflies | this is an article about bees and butterflies | | ||
| 14 | + | joaosilva | whales and dolphins | this is an article about whales and dolphins | | ||
| 15 | + | ||
| 16 | + Scenario: show recent contents on index (empty query) | ||
| 17 | + When I go to the search contents page | ||
| 18 | + Then I should see "bees and butterflies" within "#search-results" | ||
| 19 | + And I should see "whales and dolphins" within "#search-results" | ||
| 20 | + | ||
| 21 | + Scenario: simple search for content | ||
| 22 | + When I go to the search contents page | ||
| 23 | + And I fill in "query" with "whales" | ||
| 24 | + And I press "Search" | ||
| 25 | + Then I should see "whales and dolphins" within "#search-results" | ||
| 26 | + And I should not see "bees and butterflies" | ||
| 27 | + | ||
| 28 | + Scenario: search contents by category | ||
| 29 | + Given the following category | ||
| 30 | + | name | | ||
| 31 | + | Software Livre | | ||
| 32 | + And the following articles | ||
| 33 | + | owner | name | body | category | | ||
| 34 | + | joaosilva | using noosfero | noosfero is a great CMS | software-livre | | ||
| 35 | + When I go to the search articles page | ||
| 36 | + And I fill in "query" with "software livre" | ||
| 37 | + And I press "Search" | ||
| 38 | + Then I should see "using noosfero" within "#search-results" | ||
| 39 | + And I should not see "bees and butterflies" | ||
| 40 | + And I should not see "whales and dolphins" | ||
| 41 | + | ||
| 42 | + Scenario: see default facets when searching | ||
| 43 | + When I go to the search articles page | ||
| 44 | + And I fill in "query" with "bees" | ||
| 45 | + And I press "Search" | ||
| 46 | + Then I should see "Type" within "#facets-menu" | ||
| 47 | + Then I should see "Published date" within "#facets-menu" | ||
| 48 | + Then I should see "Profile" within "#facets-menu" | ||
| 49 | + Then I should see "Categories" within "#facets-menu" | ||
| 50 | + | ||
| 51 | + Scenario: find enterprises without exact query | ||
| 52 | + When I go to the search articles page | ||
| 53 | + And I fill in "query" with "article bees" | ||
| 54 | + And I press "Search" | ||
| 55 | + Then I should see "bees and butterflies" within "#search-results" | ||
| 56 | + | ||
| 57 | + Scenario: filter contents by facet | ||
| 58 | + Given the following categories as facets | ||
| 59 | + | name | | ||
| 60 | + | Temáticas | | ||
| 61 | + And the following categories | ||
| 62 | + | name | parent | | ||
| 63 | + | Software Livre | tematicas | | ||
| 64 | + | Big Brother | tematicas | | ||
| 65 | + And the following articles | ||
| 66 | + | owner | name | body | category | | ||
| 67 | + | joaosilva | noosfero and debian | this is an article about noosfero and debian | software-livre | | ||
| 68 | + | joaosilva | facebook and 1984 | this is an article about facebook and 1984 | big-brother | | ||
| 69 | + When I go to the search articles page | ||
| 70 | + And I fill in "query" with "this is an article" | ||
| 71 | + And I press "Search" | ||
| 72 | + And I follow "Software Livre" within "#facets-menu" | ||
| 73 | + Then I should see "noosfero and debian" within "#search-results" | ||
| 74 | + And I should not see "facebook and 1984" | ||
| 75 | + | ||
| 76 | + Scenario: remember facet filter when searching new query | ||
| 77 | + Given the following categories as facets | ||
| 78 | + | name | | ||
| 79 | + | Temáticas | | ||
| 80 | + And the following category | ||
| 81 | + | name | parent | | ||
| 82 | + | Software Livre | tematicas | | ||
| 83 | + And the following articles | ||
| 84 | + | owner | name | body | category | | ||
| 85 | + | joaosilva | noosfero and debian | this is an article about noosfero and debian | software-livre | | ||
| 86 | + | joaosilva | facebook and 1984 | this is an article about facebook and 1984 | big-brother | | ||
| 87 | + | joaosilva | facebook defense | facebook is not so bad | software-livre | | ||
| 88 | + When I go to the search articles page | ||
| 89 | + And I fill in "query" with "this is an article" | ||
| 90 | + And I press "Search" | ||
| 91 | + And I follow "Software Livre" within "#facets-menu" | ||
| 92 | + And I fill in "query" with "facebook" | ||
| 93 | + And I press "Search" | ||
| 94 | + Then I should see "facebook defense" within "#search-results" | ||
| 95 | + And I should not see "1984" |