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
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,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 Outline: Search with addressdetails
29 When sending <format> search query "Triesen" with address
30 Then address of result 0 is
35 | country | Liechtenstein |
37 | ISO3166-2-lvl8 | LI-09 |
46 Scenario: Coordinate search with addressdetails
47 When sending json search query "47.12400621,9.6047552"
52 | Guschg, Valorschstrasse, Balzers, Oberland, 9497, Liechtenstein |
54 Scenario: Address details with unknown class types
55 When sending json search query "Kloster St. Elisabeth" with address
58 | 0 | amenity | monastery |
59 And result addresses contain
61 | 0 | Kloster St. Elisabeth |
63 Scenario: Disabling deduplication
64 When sending json search query "Malbunstr"
65 Then there are no duplicates
66 When sending json search query "Malbunstr"
69 Then there are duplicates
72 Scenario: Search with bounded viewbox in right area
73 When sending json search query "post" with address
76 Then result addresses contain
79 When sending json search query "post" with address
81 | 1 | 9.49712,47.17122,9.52605,47.16242 |
82 Then result addresses contain
86 Scenario: Country search with bounded viewbox remain in the area
87 When sending json search query "" with address
88 | bounded | viewbox | country |
89 | 1 | 9.49712,47.17122,9.52605,47.16242 | de |
90 Then less than 1 result is returned
92 Scenario: Search with bounded viewboxlbrt in right area
93 When sending json search query "bar" with address
94 | bounded | viewboxlbrt |
95 | 1 | 9.49712,47.16242,9.52605,47.17122 |
96 Then result addresses contain
101 Scenario: No POI search with unbounded viewbox
102 When sending json search query "restaurant"
104 | 9.93027,53.61634,10.10073,53.54500 |
107 | ^[^,]*[Rr]estaurant.* |
109 Scenario: bounded search remains within viewbox, even with no results
110 When sending json search query "[restaurant]"
111 | bounded | viewbox |
112 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
113 Then less than 1 result is returned
115 Scenario: bounded search remains within viewbox with results
116 When sending json search query "restaurant"
117 | bounded | viewbox |
118 | 1 | 9.49712,47.17122,9.52605,47.16242 |
119 Then result has centroid in 9.49712,47.16242,9.52605,47.17122
121 Scenario: Prefer results within viewbox
122 When sending json search query "Gässle" with address
123 | accept-language | viewbox |
124 | en | 9.52413,47.10759,9.53140,47.10539 |
125 Then result addresses contain
128 When sending json search query "Gässle" with address
129 | accept-language | viewbox |
130 | en | 9.45949,47.08421,9.54094,47.05466 |
131 Then result addresses contain
135 Scenario: viewboxes cannot be points
136 When sending json search query "foo"
138 | 1.01,34.6,1.01,34.6 |
139 Then a HTTP 400 is returned
141 Scenario Outline: viewbox must have four coordinate numbers
142 When sending json search query "foo"
145 Then a HTTP 400 is returned
152 | 23.1,-6,0.11,44.2,9.1 |
154 Scenario Outline: viewboxlbrt must have four coordinate numbers
155 When sending json search query "foo"
158 Then a HTTP 400 is returned
165 | 23.1,-6,0.11,44.2,9.1 |
167 Scenario: Overly large limit number for search results
168 When sending json search query "restaurant"
171 Then at most 50 results are returned
173 Scenario: Limit number of search results
174 When sending json search query "landstr"
175 Then more than 4 results are returned
176 When sending json search query "landstr"
179 Then exactly 4 results are returned
181 Scenario: Limit parameter must be a number
182 When sending search query "Blue Laguna"
185 Then a HTTP 400 is returned
187 Scenario: Restrict to feature type country
188 When sending xml search query "fürstentum"
192 When sending xml search query "fürstentum"
199 Scenario: Restrict to feature type state
200 When sending xml search query "Wangerberg"
201 Then more than 1 result is returned
202 When sending xml search query "Wangerberg"
205 Then exactly 0 results are returned
207 Scenario: Restrict to feature type city
208 When sending xml search query "vaduz"
212 When sending xml search query "vaduz"
219 Scenario: Restrict to feature type settlement
220 When sending json search query "Malbun"
224 When sending json search query "Malbun"
231 Scenario Outline: Search with polygon threshold (json)
232 When sending json search query "triesenberg"
233 | polygon_geojson | polygon_threshold |
235 Then at least 1 result is returned
236 And result 0 has attributes geojson
245 Scenario Outline: Search with polygon threshold (xml)
246 When sending xml search query "triesenberg"
247 | polygon_geojson | polygon_threshold |
249 Then at least 1 result is returned
250 And result 0 has attributes geojson
259 Scenario Outline: Search with invalid polygon threshold (xml)
260 When sending xml search query "triesenberg"
261 | polygon_geojson | polygon_threshold |
263 Then a HTTP 400 is returned
271 Scenario Outline: Search with extratags
272 When sending <format> search query "Landstr"
275 Then result has attributes extratags
284 Scenario Outline: Search with namedetails
285 When sending <format> search query "Landstr"
288 Then result has attributes namedetails
297 Scenario Outline: Search result with contains TEXT geometry
298 When sending <format> search query "triesenberg"
301 Then result has attributes <response_attribute>
304 | format | response_attribute |
309 Scenario Outline: Search result contains SVG geometry
310 When sending <format> search query "triesenberg"
313 Then result has attributes <response_attribute>
316 | format | response_attribute |
321 Scenario Outline: Search result contains KML geometry
322 When sending <format> search query "triesenberg"
325 Then result has attributes <response_attribute>
328 | format | response_attribute |
333 Scenario Outline: Search result contains GEOJSON geometry
334 When sending <format> search query "triesenberg"
337 Then result has attributes <response_attribute>
340 | format | response_attribute |
344 | geojson | geojson |
346 Scenario Outline: Search result in geojson format contains no non-geojson geometry
347 When sending geojson search query "triesenberg"
348 | polygon_text | polygon_svg | polygon_geokml |
350 Then result 0 has not attributes <response_attribute>
353 | response_attribute |
359 Scenario: Search along a route
360 When sending json search query "rathaus" with address
361 Then result addresses contain
364 When sending json search query "rathaus" with address
365 | bounded | routewidth | route |
366 | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 |
367 Then result addresses contain
372 Scenario: Array parameters are ignored
373 When sending json search query "Vaduz" with address
374 | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
376 Then result addresses contain
377 | ID | country_code |