2 Feature: Search queries
3 Testing different queries and parameters
5 Scenario: Simple XML search
6 When sending xml search query "Schaan"
7 Then result 0 has attributes place_id,osm_type,osm_id
8 And result 0 has attributes place_rank,boundingbox
9 And result 0 has attributes lat,lon,display_name
10 And result 0 has attributes class,type,importance,icon
11 And result 0 has not attributes address
12 And result 0 has bounding box in 46.5,47.5,9,10
14 Scenario: Simple JSON search
15 When sending json search query "Vaduz"
16 Then result 0 has attributes place_id,licence,icon,class,type
17 And result 0 has attributes osm_type,osm_id,boundingbox
18 And result 0 has attributes lat,lon,display_name,importance
19 And result 0 has not attributes address
20 And result 0 has bounding box in 46.5,47.5,9,10
22 Scenario: Unknown formats returns a user error
23 When sending search query "Vaduz"
26 Then a HTTP 400 is returned
28 Scenario: JSON search with addressdetails
29 When sending json search query "Montevideo" with address
30 Then address of result 0 is
33 | state | Montevideo |
37 Scenario: XML search with addressdetails
38 When sending xml search query "Aleg" with address
41 Then address of result 0 is
45 | country | Mauritania |
48 Scenario: coordinate search with addressdetails
49 When sending json search query "14.271104294939,107.69828796387"
54 | Plei Ya RĂȘ, Kon Tum province, Vietnam |
56 Scenario: Address details with unknown class types
57 When sending json search query "Hundeauslauf, Hamburg" with address
60 | 0 | leisure | dog_park |
61 And result addresses contain
64 And address of result 0 has no types leisure,dog_park
66 Scenario: Disabling deduplication
67 When sending json search query "Sievekingsallee, Hamburg"
68 Then there are no duplicates
69 When sending json search query "Sievekingsallee, Hamburg"
72 Then there are duplicates
74 Scenario: Search with bounded viewbox in right area
75 When sending json search query "bar" with address
77 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 |
78 Then result addresses contain
82 Scenario: Country search with bounded viewbox remain in the area
83 When sending json search query "" with address
84 | bounded | viewbox | country |
85 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 | de |
86 Then less than 1 result is returned
88 Scenario: Search with bounded viewboxlbrt in right area
89 When sending json search query "bar" with address
90 | bounded | viewboxlbrt |
91 | 1 | -56.16786,-34.86526,-56.12525,-34.84061 |
92 Then result addresses contain
96 Scenario: No POI search with unbounded viewbox
97 When sending json search query "restaurant"
99 | 9.93027,53.61634,10.10073,53.54500 |
102 | ^[^,]*[Rr]estaurant.* |
104 Scenario: bounded search remains within viewbox, even with no results
105 When sending json search query "[restaurant]"
106 | bounded | viewbox |
107 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
108 Then less than 1 result is returned
110 Scenario: bounded search remains within viewbox with results
111 When sending json search query "restaurant"
112 | bounded | viewbox |
113 | 1 | 9.93027,53.61634,10.10073,53.54500 |
114 Then result has bounding box in 53.54500,53.61634,9.93027,10.10073
116 Scenario: Prefer results within viewbox
117 When sending json search query "25 de Mayo" with address
120 Then result addresses contain
123 When sending json search query "25 de Mayo" with address
124 | accept-language | viewbox |
125 | en | -56.35879,-34.18330,-56.31618,-34.20815 |
126 Then result addresses contain
130 Scenario: viewboxes cannot be points
131 When sending json search query "foo"
133 | 1.01,34.6,1.01,34.6 |
134 Then a HTTP 400 is returned
136 Scenario Outline: viewbox must have four coordinate numbers
137 When sending json search query "foo"
140 Then a HTTP 400 is returned
147 | 23.1,-6,0.11,44.2,9.1 |
149 Scenario Outline: viewboxlbrt must have four coordinate numbers
150 When sending json search query "foo"
153 Then a HTTP 400 is returned
160 | 23.1,-6,0.11,44.2,9.1 |
162 Scenario: Overly large limit number for search results
163 When sending json search query "restaurant"
166 Then at most 50 results are returned
168 Scenario: Limit number of search results
169 When sending json search query "restaurant"
172 Then exactly 4 results are returned
174 Scenario: Limit parameter must be a number
175 When sending search query "Blue Laguna"
178 Then a HTTP 400 is returned
180 Scenario: Restrict to feature type country
181 When sending xml search query "Uruguay"
185 When sending xml search query "Uruguay"
192 Scenario: Restrict to feature type state
193 When sending xml search query "Dakota"
197 When sending xml search query "Dakota"
204 Scenario: Restrict to feature type city
205 When sending xml search query "vaduz"
209 When sending xml search query "vaduz"
216 Scenario: Restrict to feature type settlement
217 When sending json search query "Burg"
221 When sending json search query "Burg"
226 | boundary | administrative |
228 Scenario Outline: Search with polygon threshold (json)
229 When sending json search query "switzerland"
230 | polygon_geojson | polygon_threshold |
232 Then at least 1 result is returned
233 And result 0 has attributes geojson
242 Scenario Outline: Search with polygon threshold (xml)
243 When sending xml search query "switzerland"
244 | polygon_geojson | polygon_threshold |
246 Then at least 1 result is returned
247 And result 0 has attributes geojson
256 Scenario Outline: Search with invalid polygon threshold (xml)
257 When sending xml search query "switzerland"
258 | polygon_geojson | polygon_threshold |
260 Then a HTTP 400 is returned
268 Scenario Outline: Search with extratags
269 When sending <format> search query "Hauptstr"
272 Then result has attributes extratags
281 Scenario Outline: Search with namedetails
282 When sending <format> search query "Hauptstr"
285 Then result has attributes namedetails
294 Scenario Outline: Search result with contains TEXT geometry
295 When sending <format> search query "Highmore"
298 Then result has attributes <response_attribute>
301 | format | response_attribute |
306 Scenario Outline: Search result contains polygon-as-points geometry
307 When sending <format> search query "Highmore"
310 Then result has attributes <response_attribute>
313 | format | response_attribute |
314 | xml | polygonpoints |
315 | json | polygonpoints |
316 | jsonv2 | polygonpoints |
318 Scenario Outline: Search result contains SVG geometry
319 When sending <format> search query "Highmore"
322 Then result has attributes <response_attribute>
325 | format | response_attribute |
330 Scenario Outline: Search result contains KML geometry
331 When sending <format> search query "Highmore"
334 Then result has attributes <response_attribute>
337 | format | response_attribute |
342 Scenario Outline: Search result contains GEOJSON geometry
343 When sending <format> search query "Highmore"
346 Then result has attributes <response_attribute>
349 | format | response_attribute |
353 | geojson | geojson |
355 Scenario Outline: Search result in geojson format contains no non-geojson geometry
356 When sending geojson search query "Highmore"
357 | polygon_text | polygon | polygon_svg | polygon_geokml |
359 Then result 0 has not attributes <response_attribute>
362 | response_attribute |
368 Scenario: Search along a route
369 When sending json search query "restaurant" with address
370 | bounded | routewidth | route |
371 | 1 | 0.1 | -103.23255,44.08198,-103.22516,44.08079 |
372 Then result addresses contain