3 Feature: Search queries
4 Testing different queries and parameters
6 Scenario: Simple XML search
7 When sending xml search query "Schaan"
8 Then result 0 has attributes place_id,osm_type,osm_id
9 And result 0 has attributes place_rank,boundingbox
10 And result 0 has attributes lat,lon,display_name
11 And result 0 has attributes class,type,importance
12 And result 0 has not attributes address
13 And result 0 has bounding box in 46.5,47.5,9,10
15 Scenario: Simple JSON search
16 When sending json search query "Vaduz"
17 Then result 0 has attributes place_id,licence,class,type
18 And result 0 has attributes osm_type,osm_id,boundingbox
19 And result 0 has attributes lat,lon,display_name,importance
20 And result 0 has not attributes address
21 And result 0 has bounding box in 46.5,47.5,9,10
23 Scenario: Unknown formats returns a user error
24 When sending search query "Vaduz"
27 Then a HTTP 400 is returned
29 Scenario Outline: Search with addressdetails
30 When sending <format> search query "Triesen" with address
31 Then address of result 0 is
36 | country | Liechtenstein |
38 | ISO3166-2-lvl8 | LI-09 |
47 Scenario: Coordinate search with addressdetails
48 When sending json search query "47.12400621,9.6047552"
53 | Guschg, Valorschstrasse, Balzers, Oberland, 9497, Liechtenstein |
55 Scenario: Address details with unknown class types
56 When sending json search query "Kloster St. Elisabeth" with address
59 | 0 | amenity | monastery |
60 And result addresses contain
62 | 0 | Kloster St. Elisabeth |
64 Scenario: Disabling deduplication
65 When sending json search query "Malbunstr"
66 Then there are no duplicates
67 When sending json search query "Malbunstr"
70 Then there are duplicates
73 Scenario: Search with bounded viewbox in right area
74 When sending json search query "post" with address
77 Then result addresses contain
80 When sending json search query "post" with address
82 | 1 | 9.49712,47.17122,9.52605,47.16242 |
83 Then result addresses contain
87 Scenario: Country search with bounded viewbox remain in the area
88 When sending json search query "" with address
89 | bounded | viewbox | country |
90 | 1 | 9.49712,47.17122,9.52605,47.16242 | de |
91 Then less than 1 result is returned
93 Scenario: Search with bounded viewboxlbrt in right area
94 When sending json search query "bar" with address
95 | bounded | viewboxlbrt |
96 | 1 | 9.49712,47.16242,9.52605,47.17122 |
97 Then result addresses contain
102 Scenario: No POI search with unbounded viewbox
103 When sending json search query "restaurant"
105 | 9.93027,53.61634,10.10073,53.54500 |
108 | ^[^,]*[Rr]estaurant.* |
110 Scenario: bounded search remains within viewbox, even with no results
111 When sending json search query "[restaurant]"
112 | bounded | viewbox |
113 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
114 Then less than 1 result is returned
116 Scenario: bounded search remains within viewbox with results
117 When sending json search query "restaurant"
118 | bounded | viewbox |
119 | 1 | 9.49712,47.17122,9.52605,47.16242 |
120 Then result has centroid in 9.49712,47.16242,9.52605,47.17122
122 Scenario: Prefer results within viewbox
123 When sending json search query "Gässle" with address
124 | accept-language | viewbox |
125 | en | 9.52413,47.10759,9.53140,47.10539 |
126 Then result addresses contain
129 When sending json search query "Gässle" with address
130 | accept-language | viewbox |
131 | en | 9.45949,47.08421,9.54094,47.05466 |
132 Then result addresses contain
136 Scenario: viewboxes cannot be points
137 When sending json search query "foo"
139 | 1.01,34.6,1.01,34.6 |
140 Then a HTTP 400 is returned
142 Scenario Outline: viewbox must have four coordinate numbers
143 When sending json search query "foo"
146 Then a HTTP 400 is returned
153 | 23.1,-6,0.11,44.2,9.1 |
155 Scenario Outline: viewboxlbrt must have four coordinate numbers
156 When sending json search query "foo"
159 Then a HTTP 400 is returned
166 | 23.1,-6,0.11,44.2,9.1 |
168 Scenario: Overly large limit number for search results
169 When sending json search query "restaurant"
172 Then at most 50 results are returned
174 Scenario: Limit number of search results
175 When sending json search query "landstr"
178 Then more than 4 results are returned
179 When sending json search query "landstr"
182 Then exactly 4 results are returned
184 Scenario: Limit parameter must be a number
185 When sending search query "Blue Laguna"
188 Then a HTTP 400 is returned
190 Scenario: Restrict to feature type country
191 When sending xml search query "fürstentum"
198 Scenario: Restrict to feature type state
199 When sending xml search query "Wangerberg"
200 Then at least 1 result is returned
201 When sending xml search query "Wangerberg"
204 Then exactly 0 results are returned
206 Scenario: Restrict to feature type city
207 When sending xml search query "vaduz"
208 Then at least 1 result is returned
209 When sending xml search query "vaduz"
216 Scenario: Restrict to feature type settlement
217 When sending json search query "Malbun"
221 When sending json search query "Malbun"
228 Scenario Outline: Search with polygon threshold (json)
229 When sending json search query "triesenberg"
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 "triesenberg"
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 "triesenberg"
258 | polygon_geojson | polygon_threshold |
260 Then a HTTP 400 is returned
268 Scenario Outline: Search with extratags
269 When sending <format> search query "Landstr"
272 Then result has attributes extratags
281 Scenario Outline: Search with namedetails
282 When sending <format> search query "Landstr"
285 Then result has attributes namedetails
294 Scenario Outline: Search result with contains TEXT geometry
295 When sending <format> search query "triesenberg"
298 Then result has attributes <response_attribute>
301 | format | response_attribute |
306 Scenario Outline: Search result contains SVG geometry
307 When sending <format> search query "triesenberg"
310 Then result has attributes <response_attribute>
313 | format | response_attribute |
318 Scenario Outline: Search result contains KML geometry
319 When sending <format> search query "triesenberg"
322 Then result has attributes <response_attribute>
325 | format | response_attribute |
330 Scenario Outline: Search result contains GEOJSON geometry
331 When sending <format> search query "triesenberg"
334 Then result has attributes <response_attribute>
337 | format | response_attribute |
341 | geojson | geojson |
343 Scenario Outline: Search result in geojson format contains no non-geojson geometry
344 When sending geojson search query "triesenberg"
345 | polygon_text | polygon_svg | polygon_geokml |
347 Then result 0 has not attributes <response_attribute>
350 | response_attribute |
357 Scenario: Array parameters are ignored
358 When sending json search query "Vaduz" with address
359 | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
361 Then result addresses contain
362 | ID | country_code |