cirandas.net

ref: master

plugins/solr/features/search_enterprises.feature


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Feature: search enterprises
  As a noosfero user
  I want to search enterprises
  In order to find ones that interest me

  Background:
    Given the search index is empty
    And plugin Solr is enabled on environment
    And the following enterprises
      | identifier | name        | img |
      | shop1      | Shoes shop  | shoes |
      | shop2      | Fruits shop | fruits |
    And the following categories as facets
      | name      |
      | Temáticas |

  Scenario: see default facets when searching
    When I go to the search enterprises page
    And I fill in "search-input" with "shoes"
    And I press "Search"
    Then I should see "City" within "#facets-menu"

  Scenario: see category facets when searching
    When I go to the search enterprises page
    And I fill in "search-input" with "shoes"
    And I press "Search"
    Then I should see "Temáticas" within "#facets-menu"

  Scenario: see region on facets and results
    Given the following cities
      | name           | state |
      | Pres. Prudente | SP    |
    And the following enterprises
      | identifier | name          | region           |
      | art-pp     | Artesanato PP | Pres. Prudente |
    When I go to the search enterprises page
    And I fill in "search-input" with "Artesanato"
    And I press "Search"
    Then I should see "Pres. Prudente" within "#facet-menu-solr_f_region"
    And I should see ", SP" within "#facet-menu-solr_f_region"
    And I should see "City" within ".facet-menu-label"
    And I should see "Pres. Prudente, SP" within ".facet-menu-item"

  Scenario: find enterprise by region
    Given the following cities
      | name           | state |
      | Pres. Prudente | SP    |
    And the following enterprises
      | identifier | name          | region         |
      | art-pp     | Artesanato PP | Pres. Prudente |
    When I go to the search enterprises page
    And I fill in "search-input" with "Prudente"
    And I press "Search"
    Then I should see "Artesanato PP" within "#search-results"

  Scenario: find enterprise by category
    Given the following categories
      | name           |
      | Software Livre |
    And the following enterprises
      | identifier | name     | category       |
      | noosfero   | Noosfero | software-livre |
    When I go to the search enterprises page
    And I fill in "search-input" with "software"
    And I press "Search"
    Then I should see "Noosfero" within "#search-results"
    And I should see "Software Livre" within ".search-enterprise-category"

  Scenario: show category hierarchy on search results
    Given the following categories
      | name           | parent |
      | Software Livre |        |
      | Rails          | software-livre |
    And the following enterprises
      | identifier | name     | category       |
      | noosfero   | Noosfero | rails |
    When I search enterprises for "Rails"
    Then I should see "Software Livre" within ".search-enterprise-category"
    And I should see "Rails" within ".search-enterprise-category"

  Scenario: find enterprises without exact query
    Given the following enterprises
      | identifier | name                            |
      | noosfero   | Noosfero Developers Association |
    When I go to the search enterprises page
    And I fill in "search-input" with "Noosfero Association"
    And I press "Search"
    Then I should see "Noosfero Developers Association" within "#search-results"

  Scenario: filter enterprises by facet
    Given the following category
      | name           | parent    |
      | Software Livre | tematicas |
    And the following enterprises
      | identifier | name                | category       |
      | noosfero   | Noosfero Developers | software-livre |
      | facebook   | Facebook Developers |                |
    When I go to the search enterprises page
    And I fill in "search-input" with "Developers"
    And I press "Search"
    And I follow "Software Livre" within "#facets-menu"
    Then I should see "Noosfero Developers" within "#search-results"
    And I should not see "Facebook Developers"
    # facet should also be de-selectable
    When I follow "remove facet" within ".facet-selected"
    Then I should see "Facebook Developers"

  Scenario: remember facet filter when searching new query
    Given the following category
      | name           | parent    |
      | Software Livre | tematicas |
    And the following enterprises
      | identifier | name                | category       |
      | noosfero   | Noosfero Developers | software-livre |
      | rails-dev  | Rails Developers    |                |
      | rails-usr  | Rails Users         | software-livre |
    When I go to the search enterprises page
    And I fill in "search-input" with "Developers"
    And I press "Search"
    And I follow "Software Livre" within "#facets-menu"
    And I fill in "search-input" with "Rails"
    And I press "Search"
    Then I should see "Rails Users" within "#search-results"
    And I should not see "Rails Developers"