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,icon
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,icon,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: JSON search with addressdetails
23 When sending json search query "Montevideo" with address
24 Then address of result 0 is
27 | state | Montevideo |
31 Scenario: XML search with addressdetails
32 When sending xml search query "Aleg" with address
35 Then address of result 0 is
39 | country | Mauritania |
42 Scenario: coordinate search with addressdetails
43 When sending json search query "14.271104294939,107.69828796387"
48 | Plei Ya RĂȘ, Kon Tum province, Vietnam |
50 Scenario: Address details with unknown class types
51 When sending json search query "Hundeauslauf, Hamburg" with address
54 | 0 | leisure | dog_park |
55 And result addresses contain
58 And address of result 0 has no types leisure,dog_park
60 Scenario: Disabling deduplication
61 When sending json search query "Sievekingsallee, Hamburg"
62 Then there are no duplicates
63 When sending json search query "Sievekingsallee, Hamburg"
66 Then there are duplicates
68 Scenario: Search with bounded viewbox in right area
69 When sending json search query "bar" with address
71 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 |
72 Then result addresses contain
76 Scenario: Country search with bounded viewbox remain in the area
77 When sending json search query "" with address
78 | bounded | viewbox | country |
79 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 | de |
80 Then less than 1 result is returned
82 Scenario: Search with bounded viewboxlbrt in right area
83 When sending json search query "bar" with address
84 | bounded | viewboxlbrt |
85 | 1 | -56.16786,-34.86526,-56.12525,-34.84061 |
86 Then result addresses contain
90 Scenario: No POI search with unbounded viewbox
91 When sending json search query "restaurant"
93 | 9.93027,53.61634,10.10073,53.54500 |
96 | ^[^,]*[Rr]estaurant.* |
98 Scenario: bounded search remains within viewbox, even with no results
99 When sending json search query "[restaurant]"
100 | bounded | viewbox |
101 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
102 Then less than 1 result is returned
104 Scenario: bounded search remains within viewbox with results
105 When sending json search query "restaurant"
106 | bounded | viewbox |
107 | 1 | 9.93027,53.61634,10.10073,53.54500 |
108 Then result has bounding box in 53.54500,53.61634,9.93027,10.10073
110 Scenario: Prefer results within viewbox
111 When sending json search query "25 de Mayo" with address
114 Then result addresses contain
117 When sending json search query "25 de Mayo" with address
118 | accept-language | viewbox |
119 | en | -56.35879,-34.18330,-56.31618,-34.20815 |
120 Then result addresses contain
124 Scenario: viewboxes cannot be points
125 When sending json search query "foo"
127 | 1.01,34.6,1.01,34.6 |
128 Then a HTTP 400 is returned
130 Scenario Outline: viewbox must have four coordinate numbers
131 When sending json search query "foo"
134 Then a HTTP 400 is returned
141 | 23.1,-6,0.11,44.2,9.1 |
143 Scenario Outline: viewboxlbrt must have four coordinate numbers
144 When sending json search query "foo"
147 Then a HTTP 400 is returned
154 | 23.1,-6,0.11,44.2,9.1 |
156 Scenario: Overly large limit number for search results
157 When sending json search query "restaurant"
160 Then at most 50 results are returned
162 Scenario: Limit number of search results
163 When sending json search query "restaurant"
166 Then exactly 4 results are returned
168 Scenario: Restrict to feature type country
169 When sending xml search query "Uruguay"
173 When sending xml search query "Uruguay"
180 Scenario: Restrict to feature type state
181 When sending xml search query "Dakota"
185 When sending xml search query "Dakota"
192 Scenario: Restrict to feature type city
193 When sending xml search query "vaduz"
197 When sending xml search query "vaduz"
204 Scenario: Restrict to feature type settlement
205 When sending json search query "Burg"
209 When sending json search query "Burg"
214 | boundary | administrative |
216 Scenario Outline: Search with polygon threshold (json)
217 When sending json search query "switzerland"
218 | polygon_geojson | polygon_threshold |
220 Then at least 1 result is returned
221 And result 0 has attributes geojson
230 Scenario Outline: Search with polygon threshold (xml)
231 When sending xml search query "switzerland"
232 | polygon_geojson | polygon_threshold |
234 Then at least 1 result is returned
235 And result 0 has attributes geojson
244 Scenario Outline: Search with invalid polygon threshold (xml)
245 When sending xml search query "switzerland"
246 | polygon_geojson | polygon_threshold |
248 Then a HTTP 400 is returned
256 Scenario Outline: Search with extratags
257 When sending <format> search query "Hauptstr"
260 Then result has attributes extratags
268 Scenario Outline: Search with namedetails
269 When sending <format> search query "Hauptstr"
272 Then result has attributes namedetails
280 Scenario Outline: Search result with contains TEXT geometry
281 When sending <format> search query "Highmore"
284 Then result has attributes <response_attribute>
287 | format | response_attribute |
292 Scenario Outline: Search result contains polygon-as-points geometry
293 When sending <format> search query "Highmore"
296 Then result has attributes <response_attribute>
299 | format | response_attribute |
300 | xml | polygonpoints |
301 | json | polygonpoints |
302 | jsonv2 | polygonpoints |
304 Scenario Outline: Search result contains SVG geometry
305 When sending <format> search query "Highmore"
308 Then result has attributes <response_attribute>
311 | format | response_attribute |
316 Scenario Outline: Search result contains KML geometry
317 When sending <format> search query "Highmore"
320 Then result has attributes <response_attribute>
323 | format | response_attribute |
328 Scenario Outline: Search result contains GEOJSON geometry
329 When sending <format> search query "Highmore"
332 Then result has attributes <response_attribute>
335 | format | response_attribute |
340 Scenario: Search along a route
341 When sending json search query "restaurant" with address
342 | bounded | routewidth | route |
343 | 1 | 0.1 | -103.23255,44.08198,-103.22516,44.08079 |
344 Then result addresses contain