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: JSON search with addressdetails
29 When sending json search query "Montevideo" with address
30 Then address of result 0 is
33 | state | Montevideo |
37 Scenario: XML search with addressdetails
38 When sending xml search query "Aleg" with address
41 Then address of result 0 is
45 | country | Mauritania |
48 Scenario: coordinate search with addressdetails
49 When sending json search query "14.271104294939,107.69828796387"
54 | Plei Ya RĂȘ, Vietnam |
56 Scenario: Address details with unknown class types
57 When sending json search query "Hundeauslauf, Hamburg" with address
60 | 0 | leisure | dog_park |
61 And result addresses contain
65 Scenario: Disabling deduplication
66 When sending json search query "Sievekingsallee, Hamburg"
67 Then there are no duplicates
68 When sending json search query "Sievekingsallee, Hamburg"
71 Then there are duplicates
73 Scenario: Search with bounded viewbox in right area
74 When sending json search query "bar" with address
76 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 |
77 Then result addresses contain
81 Scenario: Country search with bounded viewbox remain in the area
82 When sending json search query "" with address
83 | bounded | viewbox | country |
84 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 | de |
85 Then less than 1 result is returned
87 Scenario: Search with bounded viewboxlbrt in right area
88 When sending json search query "bar" with address
89 | bounded | viewboxlbrt |
90 | 1 | -56.16786,-34.86526,-56.12525,-34.84061 |
91 Then result addresses contain
95 Scenario: No POI search with unbounded viewbox
96 When sending json search query "restaurant"
98 | 9.93027,53.61634,10.10073,53.54500 |
101 | ^[^,]*[Rr]estaurant.* |
103 Scenario: bounded search remains within viewbox, even with no results
104 When sending json search query "[restaurant]"
105 | bounded | viewbox |
106 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
107 Then less than 1 result is returned
109 Scenario: bounded search remains within viewbox with results
110 When sending json search query "restaurant"
111 | bounded | viewbox |
112 | 1 | 9.93027,53.61634,10.10073,53.54500 |
113 Then result has centroid in 53.54500,53.61634,9.93027,10.10073
115 Scenario: Prefer results within viewbox
116 When sending json search query "25 de Mayo" with address
119 Then result addresses contain
122 When sending json search query "25 de Mayo" with address
123 | accept-language | viewbox |
124 | en | -57.95468,-31.39261,-57.94741,-31.39490 |
125 Then result addresses contain
129 Scenario: viewboxes cannot be points
130 When sending json search query "foo"
132 | 1.01,34.6,1.01,34.6 |
133 Then a HTTP 400 is returned
135 Scenario Outline: viewbox must have four coordinate numbers
136 When sending json search query "foo"
139 Then a HTTP 400 is returned
146 | 23.1,-6,0.11,44.2,9.1 |
148 Scenario Outline: viewboxlbrt must have four coordinate numbers
149 When sending json search query "foo"
152 Then a HTTP 400 is returned
159 | 23.1,-6,0.11,44.2,9.1 |
161 Scenario: Overly large limit number for search results
162 When sending json search query "restaurant"
165 Then at most 50 results are returned
167 Scenario: Limit number of search results
168 When sending json search query "restaurant"
171 Then exactly 4 results are returned
173 Scenario: Limit parameter must be a number
174 When sending search query "Blue Laguna"
177 Then a HTTP 400 is returned
179 Scenario: Restrict to feature type country
180 When sending xml search query "Uruguay"
184 When sending xml search query "Uruguay"
191 Scenario: Restrict to feature type state
192 When sending xml search query "Dakota"
196 When sending xml search query "Dakota"
203 Scenario: Restrict to feature type city
204 When sending xml search query "vaduz"
208 When sending xml search query "vaduz"
215 Scenario: Restrict to feature type settlement
216 When sending json search query "Burg"
220 When sending json search query "Burg"
225 | boundary | administrative |
227 Scenario Outline: Search with polygon threshold (json)
228 When sending json search query "switzerland"
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 "switzerland"
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 "switzerland"
257 | polygon_geojson | polygon_threshold |
259 Then a HTTP 400 is returned
267 Scenario Outline: Search with extratags
268 When sending <format> search query "Hauptstr"
271 Then result has attributes extratags
280 Scenario Outline: Search with namedetails
281 When sending <format> search query "Hauptstr"
284 Then result has attributes namedetails
293 Scenario Outline: Search result with contains TEXT geometry
294 When sending <format> search query "Highmore"
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 "Highmore"
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 "Highmore"
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 "Highmore"
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 "Highmore"
344 | polygon_text | polygon_svg | polygon_geokml |
346 Then result 0 has not attributes <response_attribute>
349 | response_attribute |
355 Scenario: Search along a route
356 When sending json search query "restaurant" with address
357 | bounded | routewidth | route |
358 | 1 | 0.1 | -103.23255,44.08198,-103.22516,44.08079 |
359 Then result addresses contain