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"
194 When sending xml search query "fürstentum"
201 Scenario: Restrict to feature type state
202 When sending xml search query "Wangerberg"
203 Then more than 1 result is returned
204 When sending xml search query "Wangerberg"
207 Then exactly 0 results are returned
209 Scenario: Restrict to feature type city
210 When sending xml search query "vaduz"
214 When sending xml search query "vaduz"
221 Scenario: Restrict to feature type settlement
222 When sending json search query "Malbun"
226 When sending json search query "Malbun"
233 Scenario Outline: Search with polygon threshold (json)
234 When sending json search query "triesenberg"
235 | polygon_geojson | polygon_threshold |
237 Then at least 1 result is returned
238 And result 0 has attributes geojson
247 Scenario Outline: Search with polygon threshold (xml)
248 When sending xml search query "triesenberg"
249 | polygon_geojson | polygon_threshold |
251 Then at least 1 result is returned
252 And result 0 has attributes geojson
261 Scenario Outline: Search with invalid polygon threshold (xml)
262 When sending xml search query "triesenberg"
263 | polygon_geojson | polygon_threshold |
265 Then a HTTP 400 is returned
273 Scenario Outline: Search with extratags
274 When sending <format> search query "Landstr"
277 Then result has attributes extratags
286 Scenario Outline: Search with namedetails
287 When sending <format> search query "Landstr"
290 Then result has attributes namedetails
299 Scenario Outline: Search result with contains TEXT geometry
300 When sending <format> search query "triesenberg"
303 Then result has attributes <response_attribute>
306 | format | response_attribute |
311 Scenario Outline: Search result contains SVG geometry
312 When sending <format> search query "triesenberg"
315 Then result has attributes <response_attribute>
318 | format | response_attribute |
323 Scenario Outline: Search result contains KML geometry
324 When sending <format> search query "triesenberg"
327 Then result has attributes <response_attribute>
330 | format | response_attribute |
335 Scenario Outline: Search result contains GEOJSON geometry
336 When sending <format> search query "triesenberg"
339 Then result has attributes <response_attribute>
342 | format | response_attribute |
346 | geojson | geojson |
348 Scenario Outline: Search result in geojson format contains no non-geojson geometry
349 When sending geojson search query "triesenberg"
350 | polygon_text | polygon_svg | polygon_geokml |
352 Then result 0 has not attributes <response_attribute>
355 | response_attribute |
361 Scenario: Search along a route
362 When sending json search query "rathaus" with address
363 Then result addresses contain
366 When sending json search query "rathaus" with address
367 | bounded | routewidth | route |
368 | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 |
369 Then result addresses contain
374 Scenario: Array parameters are ignored
375 When sending json search query "Vaduz" with address
376 | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
378 Then result addresses contain
379 | ID | country_code |