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
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: Array parameters are ignored
357 When sending json search query "Vaduz" with address
358 | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
360 Then result addresses contain
361 | ID | country_code |