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 "restaurant" with address
71 | 1 | 9.93027,53.61634,10.10073,53.54500 |
72 Then result addresses contain
76 Scenario: Search with bounded viewboxlbrt in right area
77 When sending json search query "restaurant" with address
78 | bounded | viewboxlbrt |
79 | 1 | 9.93027,53.54500,10.10073,53.61634 |
80 Then result addresses contain
84 Scenario: No POI search with unbounded viewbox
85 When sending json search query "restaurant"
87 | 9.93027,53.61634,10.10073,53.54500 |
90 | ^[^,]*[Rr]estaurant.* |
92 Scenario: bounded search remains within viewbox, even with no results
93 When sending json search query "restaurant"
95 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
96 Then less than 1 result is returned
98 Scenario: bounded search remains within viewbox with results
99 When sending json search query "restaurant"
100 | bounded | viewbox |
101 | 1 | 9.93027,53.61634,10.10073,53.54500 |
102 Then result has bounding box in 53.54500,53.61634,9.93027,10.10073
104 Scenario: Prefer results within viewbox
105 When sending json search query "25 de Mayo" with address
108 Then result addresses contain
111 When sending json search query "25 de Mayo" with address
112 | accept-language | viewbox |
113 | en | -56.35879,-34.18330,-56.31618,-34.20815 |
114 Then result addresses contain
118 Scenario: Overly large limit number for search results
119 When sending json search query "restaurant"
122 Then at most 50 results are returned
124 Scenario: Limit number of search results
125 When sending json search query "restaurant"
128 Then exactly 4 results are returned
130 Scenario: Restrict to feature type country
131 When sending xml search query "Uruguay"
135 When sending xml search query "Uruguay"
142 Scenario: Restrict to feature type state
143 When sending xml search query "Dakota"
147 When sending xml search query "Dakota"
154 Scenario: Restrict to feature type city
155 When sending xml search query "vaduz"
159 When sending xml search query "vaduz"
166 Scenario: Restrict to feature type settlement
167 When sending json search query "Burg"
171 When sending json search query "Burg"
176 | boundary | administrative |
178 Scenario Outline: Search with polygon threshold (json)
179 When sending json search query "switzerland"
180 | polygon_geojson | polygon_threshold |
182 Then at least 1 result is returned
183 And result 0 has attributes geojson
192 Scenario Outline: Search with polygon threshold (xml)
193 When sending xml search query "switzerland"
194 | polygon_geojson | polygon_threshold |
196 Then at least 1 result is returned
197 And result 0 has attributes geojson
206 Scenario Outline: Search with invalid polygon threshold (xml)
207 When sending xml search query "switzerland"
208 | polygon_geojson | polygon_threshold |
210 Then a HTTP 400 is returned
218 Scenario Outline: Search with extratags
219 When sending <format> search query "Hauptstr"
222 Then result has attributes extratags
230 Scenario Outline: Search with namedetails
231 When sending <format> search query "Hauptstr"
234 Then result has attributes namedetails
242 Scenario Outline: Search result with contains TEXT geometry
243 When sending <format> search query "Highmore"
246 Then result has attributes <response_attribute>
249 | format | response_attribute |
254 Scenario Outline: Search result contains polygon-as-points geometry
255 When sending <format> search query "Highmore"
258 Then result has attributes <response_attribute>
261 | format | response_attribute |
262 | xml | polygonpoints |
263 | json | polygonpoints |
264 | jsonv2 | polygonpoints |
266 Scenario Outline: Search result contains SVG geometry
267 When sending <format> search query "Highmore"
270 Then result has attributes <response_attribute>
273 | format | response_attribute |
278 Scenario Outline: Search result contains KML geometry
279 When sending <format> search query "Highmore"
282 Then result has attributes <response_attribute>
285 | format | response_attribute |
290 Scenario Outline: Search result contains GEOJSON geometry
291 When sending <format> search query "Highmore"
294 Then result has attributes <response_attribute>
297 | format | response_attribute |