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
34 | state | Northwest Territories
38 Scenario: coordinate search with addressdetails
39 When sending json search query "51.193058013916,15.5245780944824" with address
40 Then result addresses contain
41 | village | country | country_code
42 | Kraszowice | Polska | pl
44 Scenario: Address details with unknown class types
45 When sending json search query "foobar, Essen" with address
48 | 0 | leisure | hackerspace
49 And result addresses contain
52 And address of result 0 does not contain leisure,hackerspace
54 Scenario: Disabling deduplication
55 When sending json search query "Oxford Street, London"
56 Then there are no duplicates
57 Given the request parameters
60 When sending json search query "Oxford Street, London"
61 Then there are duplicates
63 Scenario: Search with bounded viewbox in right area
64 Given the request parameters
66 | 1 | -87.7,41.9,-87.57,41.85
67 When sending json search query "restaurant" with address
68 Then result addresses contain
72 Scenario: Search with bounded viewboxlbrt in right area
73 Given the request parameters
74 | bounded | viewboxlbrt
75 | 1 | -87.7,41.85,-87.57,41.9
76 When sending json search query "restaurant" with address
77 Then result addresses contain
81 Scenario: No POI search with unbounded viewbox
82 Given the request parameters
84 | -87.7,41.9,-87.57,41.85
85 When sending json search query "restaurant"
88 | [^,]*(?i)restaurant.*
90 Scenario: bounded search remains within viewbox, even with no results
91 Given the request parameters
93 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003
94 When sending json search query "restaurant"
95 Then less than 1 result is returned
97 Scenario: bounded search remains within viewbox with results
98 Given the request parameters
100 | 1 | -5.662003,43.55,-5.6563282,43.5403125
101 When sending json search query "restaurant"
103 | >= -5.662003 | >= 43.5403125
104 | <= -5.6563282| <= 43.55
106 Scenario: Prefer results within viewbox
107 Given the request parameters
110 When sending json search query "royan" with address
111 Then result addresses contain
114 Given the request parameters
115 | accept-language | viewbox
116 | en | 51.94,36.59,51.99,36.56
117 When sending json search query "royan" with address
118 Then result addresses contain
122 Scenario: Overly large limit number for search results
123 Given the request parameters
126 When sending json search query "Neustadt"
127 Then at most 50 results are returned
129 Scenario: Limit number of search results
130 Given the request parameters
133 When sending json search query "Neustadt"
134 Then exactly 4 results are returned
136 Scenario: Restrict to feature type country
137 Given the request parameters
140 When sending xml search query "Monaco"
145 Scenario: Restrict to feature type state
146 When sending xml search query "Berlin"
150 Given the request parameters
153 When sending xml search query "Berlin"
158 Scenario: Restrict to feature type city
159 Given the request parameters
162 When sending xml search query "Monaco"
168 Scenario: Restrict to feature type settlement
169 When sending json search query "Everest"
172 | 0 | Mount Everest.*
173 Given the request parameters
176 When sending json search query "Everest"
181 Scenario Outline: Search with polygon threshold (json)
182 Given the request parameters
183 | polygon_geojson | polygon_threshold
185 When sending json search query "switzerland"
186 Then at least 1 result is returned
187 And result 0 has attributes geojson
196 Scenario Outline: Search with polygon threshold (xml)
197 Given the request parameters
198 | polygon_geojson | polygon_threshold
200 When sending xml search query "switzerland"
201 Then at least 1 result is returned
202 And result 0 has attributes geojson
211 Scenario Outline: Search with invalid polygon threshold (xml)
212 Given the request parameters
213 | polygon_geojson | polygon_threshold
215 When sending xml search query "switzerland"
216 Then a HTTP 400 is returned
219 Scenario Outline: Search with extratags
220 Given the request parameters
223 When sending <format> search query "Hauptstr"
224 Then result 0 has attributes extratags
225 And result 1 has attributes extratags
233 Scenario Outline: Search with namedetails
234 Given the request parameters
237 When sending <format> search query "Hauptstr"
238 Then result 0 has attributes namedetails
239 And result 1 has attributes namedetails
248 Scenario Outline: Search result with contains TEXT geometry
249 Given the request parameters
252 When sending <format> search query "switzerland"
253 Then result 0 has attributes <response_attribute>
256 | format | response_attribute
261 Scenario Outline: Search result contains polygon-as-points geometry
262 Given the request parameters
265 When sending <format> search query "switzerland"
266 Then result 0 has attributes <response_attribute>
269 | format | response_attribute
270 | xml | polygonpoints
271 | json | polygonpoints
272 | jsonv2 | polygonpoints
276 Scenario Outline: Search result contains SVG geometry
277 Given the request parameters
280 When sending <format> search query "switzerland"
281 Then result 0 has attributes <response_attribute>
284 | format | response_attribute
290 Scenario Outline: Search result contains KML geometry
291 Given the request parameters
294 When sending <format> search query "switzerland"
295 Then result 0 has attributes <response_attribute>
298 | format | response_attribute
304 Scenario Outline: Search result contains GEOJSON geometry
305 Given the request parameters
308 When sending <format> search query "switzerland"
309 Then result 0 has attributes <response_attribute>
312 | format | response_attribute