Commit 63a1f9a0e2c1f06d99aa158302f16c801ddad68c
1 parent
3f97f285
Exists in
master
and in
23 other branches
Cucumber feature for searching people
Showing
1 changed file
with
94 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,94 @@ |
| 1 | +Feature: search people | |
| 2 | + As a noosfero user | |
| 3 | + I want to search people | |
| 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 | + | josearaujo | Jose Araujo | | |
| 12 | + | |
| 13 | + Scenario: show recent people on index (empty query) | |
| 14 | + When I go to the search people page | |
| 15 | + Then I should see "Joao Silva" within "#search-results" | |
| 16 | + And I should see "Jose Araujo" within "#search-results" | |
| 17 | + | |
| 18 | + Scenario: simple search for person | |
| 19 | + When I go to the search people page | |
| 20 | + And I fill in "query" with "Silva" | |
| 21 | + And I press "Search" | |
| 22 | + Then I should see "Joao Silva" within "#search-results" | |
| 23 | + And I should not see "Jose Araujo" | |
| 24 | + | |
| 25 | + Scenario: see category facets when searching | |
| 26 | + Given the following categories as facets | |
| 27 | + | name | | |
| 28 | + | Temáticas | | |
| 29 | + When I go to the search people page | |
| 30 | + And I fill in "query" with "joao" | |
| 31 | + And I press "Search" | |
| 32 | + Then I should see "Temáticas" within "#facets-menu" | |
| 33 | + | |
| 34 | + Scenario: search people by category | |
| 35 | + Given the following category | |
| 36 | + | name | | |
| 37 | + | Software Livre | | |
| 38 | + And the following users | |
| 39 | + | login | name | category | | |
| 40 | + | linus | Linus Torvalds | software-livre | | |
| 41 | + When I go to the search people page | |
| 42 | + And I fill in "query" with "software livre" | |
| 43 | + And I press "Search" | |
| 44 | + Then I should see "Linus Torvalds" within "#search-results" | |
| 45 | + And I should not see "Joao Silva" | |
| 46 | + And I should not see "Jose Araujo" | |
| 47 | + | |
| 48 | + Scenario: find person without exact query | |
| 49 | + Given the following users | |
| 50 | + | login | name | | |
| 51 | + | jsilva | Joao Adalberto de Oliveira Silva | | |
| 52 | + When I go to the search people page | |
| 53 | + And I fill in "query" with "Adalberto Silva" | |
| 54 | + And I press "Search" | |
| 55 | + Then I should see "Joao Adalberto de Oliveira Silva" within "#search-results" | |
| 56 | + | |
| 57 | + Scenario: filter people by facet | |
| 58 | + Given the following categories as facets | |
| 59 | + | name | | |
| 60 | + | Temáticas | | |
| 61 | + And the following category | |
| 62 | + | name | parent | | |
| 63 | + | Software Livre | tematicas | | |
| 64 | + And the following users | |
| 65 | + | login | name | category | | |
| 66 | + | linus | Linus Torvalds | software-livre | | |
| 67 | + | other | Other Linus | | | |
| 68 | + When I go to the search people page | |
| 69 | + And I fill in "query" with "Linus" | |
| 70 | + And I press "Search" | |
| 71 | + And I follow "Software Livre" within "#facets-menu" | |
| 72 | + Then I should see "Linus Torvalds" within "#search-results" | |
| 73 | + And I should not see "Other Linus" | |
| 74 | + | |
| 75 | + Scenario: remember facet filter when searching new query | |
| 76 | + Given the following categories as facets | |
| 77 | + | name | | |
| 78 | + | Temáticas | | |
| 79 | + And the following category | |
| 80 | + | name | parent | | |
| 81 | + | Software Livre | tematicas | | |
| 82 | + And the following users | |
| 83 | + | login | name | category | | |
| 84 | + | linus | Linus Torvalds | software-livre | | |
| 85 | + | rilin | Richard Linus | | | |
| 86 | + | stall | Richard Stallman | software-livre | | |
| 87 | + When I go to the search people page | |
| 88 | + And I fill in "query" with "Linus" | |
| 89 | + And I press "Search" | |
| 90 | + And I follow "Software Livre" within "#facets-menu" | |
| 91 | + And I fill in "query" with "Richard" | |
| 92 | + And I press "Search" | |
| 93 | + Then I should see "Richard Stallman" within "#search-results" | |
| 94 | + And I should not see "Richard Linus" | ... | ... |