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"
177 Then more than 4 results are returned
178 When sending json search query "landstr"
181 Then exactly 4 results are returned
183 Scenario: Limit parameter must be a number
184 When sending search query "Blue Laguna"
187 Then a HTTP 400 is returned
189 Scenario: Restrict to feature type country
190 When sending xml search query "fürstentum"
197 Scenario: Restrict to feature type state
198 When sending xml search query "Wangerberg"
199 Then at least 1 result is returned
200 When sending xml search query "Wangerberg"
203 Then exactly 0 results are returned
205 Scenario: Restrict to feature type city
206 When sending xml search query "vaduz"
207 Then at least 1 result is returned
208 When sending xml search query "vaduz"
215 Scenario: Restrict to feature type settlement
216 When sending json search query "Malbun"
220 When sending json search query "Malbun"
227 Scenario Outline: Search with polygon threshold (json)
228 When sending json search query "triesenberg"
229 | polygon_geojson | polygon_threshold |
231 Then at least 1 result is returned
232 And result 0 has attributes geojson
241 Scenario Outline: Search with polygon threshold (xml)
242 When sending xml search query "triesenberg"
243 | polygon_geojson | polygon_threshold |
245 Then at least 1 result is returned
246 And result 0 has attributes geojson
255 Scenario Outline: Search with invalid polygon threshold (xml)
256 When sending xml search query "triesenberg"
257 | polygon_geojson | polygon_threshold |
259 Then a HTTP 400 is returned
267 Scenario Outline: Search with extratags
268 When sending <format> search query "Landstr"
271 Then result has attributes extratags
280 Scenario Outline: Search with namedetails
281 When sending <format> search query "Landstr"
284 Then result has attributes namedetails
293 Scenario Outline: Search result with contains TEXT geometry
294 When sending <format> search query "triesenberg"
297 Then result has attributes <response_attribute>
300 | format | response_attribute |
305 Scenario Outline: Search result contains SVG geometry
306 When sending <format> search query "triesenberg"
309 Then result has attributes <response_attribute>
312 | format | response_attribute |
317 Scenario Outline: Search result contains KML geometry
318 When sending <format> search query "triesenberg"
321 Then result has attributes <response_attribute>
324 | format | response_attribute |
329 Scenario Outline: Search result contains GEOJSON geometry
330 When sending <format> search query "triesenberg"
333 Then result has attributes <response_attribute>
336 | format | response_attribute |
340 | geojson | geojson |
342 Scenario Outline: Search result in geojson format contains no non-geojson geometry
343 When sending geojson search query "triesenberg"
344 | polygon_text | polygon_svg | polygon_geokml |
346 Then result 0 has not attributes <response_attribute>
349 | response_attribute |
356 Scenario: Search along a route
357 When sending json search query "rathaus" with address
358 Then result addresses contain
361 When sending json search query "rathaus" with address
362 | bounded | routewidth | route |
363 | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 |
364 Then result addresses contain
369 Scenario: Array parameters are ignored
370 When sending json search query "Vaduz" with address
371 | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
373 Then result addresses contain
374 | ID | country_code |