1 Feature: Search queries
 
   2     Testing different queries and parameters
 
   4     Scenario: Simple XML search
 
   5         When sending xml search query "Schaan"
 
   6         Then result 0 has attributes place_id,osm_type,osm_id
 
   7         And result 0 has attributes place_rank,boundingbox
 
   8         And result 0 has attributes lat,lon,display_name
 
   9         And result 0 has attributes class,type,importance,icon
 
  10         And result 0 has not attributes address
 
  11         And results contain valid boundingboxes
 
  13     Scenario: Simple JSON search
 
  14         When sending json search query "Vaduz"
 
  15         And result 0 has attributes place_id,licence,icon,class,type
 
  16         And result 0 has attributes osm_type,osm_id,boundingbox
 
  17         And result 0 has attributes lat,lon,display_name,importance
 
  18         And result 0 has not attributes address
 
  19         And results contain valid boundingboxes
 
  21     Scenario: JSON search with addressdetails
 
  22         When sending json search query "Montevideo" with address
 
  23         Then address of result 0 is
 
  30     Scenario: XML search with addressdetails
 
  31         When sending xml search query "Inuvik" with address
 
  32         Then address of result 0 contains
 
  35           | state        | Northwest Territories
 
  39     Scenario: Address details with unknown class types
 
  40         When sending json search query "foobar, Essen" with address
 
  43           | 0  | leisure | hackerspace
 
  44         And result addresses contain
 
  47         And address of result 0 does not contain leisure,hackerspace
 
  49     Scenario: Disabling deduplication
 
  50         When sending json search query "Oxford Street, London"
 
  51         Then there are no duplicates
 
  52         Given the request parameters
 
  55         When sending json search query "Oxford Street, London"
 
  56         Then there are duplicates
 
  58     Scenario: Search with bounded viewbox in right area
 
  59         Given the request parameters
 
  61           | 1       | -87.7,41.9,-87.57,41.85
 
  62         When sending json search query "restaurant" with address
 
  63         Then result addresses contain
 
  67     Scenario: Search with bounded viewboxlbrt in right area
 
  68         Given the request parameters
 
  69           | bounded | viewboxlbrt
 
  70           | 1       | -87.7,41.85,-87.57,41.9
 
  71         When sending json search query "restaurant" with address
 
  72         Then result addresses contain
 
  76     Scenario: No POI search with unbounded viewbox
 
  77         Given the request parameters
 
  79           | -87.7,41.9,-87.57,41.85
 
  80         When sending json search query "restaurant"
 
  83           | [^,]*(?i)restaurant.*
 
  85     Scenario: bounded search remains within viewbox, even with no results
 
  86         Given the request parameters
 
  88          | 1       | 43.54285,-5.662003,43.5403125,-5.6563282
 
  89          When sending json search query "restaurant"
 
  90         Then less than 1 result is returned
 
  92     Scenario: bounded search remains within viewbox with results
 
  93         Given the request parameters
 
  95          | 1       | -5.662003,43.55,-5.6563282,43.5403125
 
  96         When sending json search query "restaurant"
 
  98          | >= -5.662003 | >= 43.5403125
 
  99          | <= -5.6563282| <= 43.55
 
 101     Scenario: Prefer results within viewbox
 
 102         Given the request parameters
 
 105         When sending json search query "royan" with address
 
 106         Then result addresses contain
 
 109         Given the request parameters
 
 110           | accept-language | viewbox
 
 111           | en              | 51.94,36.59,51.99,36.56
 
 112         When sending json search query "royan" with address
 
 113         Then result addresses contain
 
 117     Scenario: Overly large limit number for search results
 
 118         Given the request parameters
 
 121         When sending json search query "Neustadt"
 
 122         Then at most 50 results are returned
 
 124     Scenario: Limit number of search results
 
 125         Given the request parameters
 
 128         When sending json search query "Neustadt"
 
 129         Then exactly 4 results are returned
 
 131     Scenario: Restrict to feature type country
 
 132         Given the request parameters
 
 135         When sending xml search query "Monaco"
 
 140     Scenario: Restrict to feature type state
 
 141         When sending xml search query "Berlin"
 
 145         Given the request parameters
 
 148         When sending xml search query "Berlin"
 
 153     Scenario: Restrict to feature type city
 
 154         Given the request parameters
 
 157         When sending xml search query "Monaco"
 
 163     Scenario: Restrict to feature type settlement
 
 164         When sending json search query "Everest"
 
 167           | 0  | Mount Everest.*
 
 168         Given the request parameters
 
 171         When sending json search query "Everest"
 
 176     Scenario Outline: Search with polygon threshold (json)
 
 177         Given the request parameters
 
 178           | polygon_geojson | polygon_threshold
 
 180         When sending json search query "switzerland"
 
 181         Then at least 1 result is returned
 
 182         And result 0 has attributes geojson
 
 192     Scenario Outline: Search with polygon threshold (xml)
 
 193         Given the request parameters
 
 194           | polygon_geojson | polygon_threshold
 
 196         When sending xml search query "switzerland"
 
 197         Then at least 1 result is returned
 
 198         And result 0 has attributes geojson
 
 208     Scenario Outline: Search with extratags
 
 209         Given the request parameters
 
 212         When sending <format> search query "Hauptstr"
 
 213         Then result 0 has attributes extratags
 
 214         And result 1 has attributes extratags
 
 222     Scenario Outline: Search with namedetails
 
 223         Given the request parameters
 
 226         When sending <format> search query "Hauptstr"
 
 227         Then result 0 has attributes namedetails
 
 228         And result 1 has attributes namedetails
 
 237    Scenario Outline: Search result with contains TEXT geometry
 
 238         Given the request parameters
 
 241         When sending <format> search query "switzerland"
 
 242         Then result 0 has attributes <response_attribute>
 
 245         | format   | response_attribute
 
 250    Scenario Outline: Search result contains polygon-as-points geometry
 
 251         Given the request parameters
 
 254         When sending <format> search query "switzerland"
 
 255         Then result 0 has attributes <response_attribute>
 
 258         | format   | response_attribute
 
 259         | xml      | polygonpoints
 
 260         | json     | polygonpoints
 
 261         | jsonv2   | polygonpoints
 
 265    Scenario Outline: Search result contains SVG geometry
 
 266         Given the request parameters
 
 269         When sending <format> search query "switzerland"
 
 270         Then result 0 has attributes <response_attribute>
 
 273         | format   | response_attribute
 
 279    Scenario Outline: Search result contains KML geometry
 
 280         Given the request parameters
 
 283         When sending <format> search query "switzerland"
 
 284         Then result 0 has attributes <response_attribute>
 
 287         | format   | response_attribute
 
 293    Scenario Outline: Search result contains GEOJSON geometry
 
 294         Given the request parameters
 
 297         When sending <format> search query "switzerland"
 
 298         Then result 0 has attributes <response_attribute>
 
 301         | format   | response_attribute