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 |
32 Scenario: XML search with addressdetails
33 When sending xml search query "Aleg" with address
36 Then address of result 0 is
40 | country | Mauritania |
43 Scenario: coordinate search with addressdetails
44 When sending json search query "14.271104294939,107.69828796387"
49 | Plei Ya RĂȘ, Kon Tum province, Vietnam |
51 Scenario: Address details with unknown class types
52 When sending json search query "Hundeauslauf, Hamburg" with address
55 | 0 | leisure | dog_park |
56 And result addresses contain
59 And address of result 0 has no types leisure,dog_park
61 Scenario: Disabling deduplication
62 When sending json search query "Sievekingsallee, Hamburg"
63 Then there are no duplicates
64 When sending json search query "Sievekingsallee, Hamburg"
67 Then there are duplicates
69 Scenario: Search with bounded viewbox in right area
70 When sending json search query "restaurant" with address
72 | 1 | -56.16786,-34.84061,-56.12525,-34.86526 |
73 Then result addresses contain
77 Scenario: Search with bounded viewboxlbrt in right area
78 When sending json search query "restaurant" with address
79 | bounded | viewboxlbrt |
80 | 1 | -56.16786,-34.86526,-56.12525,-34.84061 |
81 Then result addresses contain
85 Scenario: No POI search with unbounded viewbox
86 When sending json search query "restaurant"
88 | 9.93027,53.61634,10.10073,53.54500 |
91 | ^[^,]*[Rr]estaurant.* |
93 Scenario: bounded search remains within viewbox, even with no results
94 When sending json search query "restaurant"
96 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
97 Then less than 1 result is returned
99 Scenario: bounded search remains within viewbox with results
100 When sending json search query "restaurant"
101 | bounded | viewbox |
102 | 1 | 9.93027,53.61634,10.10073,53.54500 |
103 Then result has bounding box in 53.54500,53.61634,9.93027,10.10073
105 Scenario: Prefer results within viewbox
106 When sending json search query "25 de Mayo" with address
109 Then result addresses contain
112 When sending json search query "25 de Mayo" with address
113 | accept-language | viewbox |
114 | en | -56.35879,-34.18330,-56.31618,-34.20815 |
115 Then result addresses contain
119 Scenario: Overly large limit number for search results
120 When sending json search query "restaurant"
123 Then at most 50 results are returned
125 Scenario: Limit number of search results
126 When sending json search query "restaurant"
129 Then exactly 4 results are returned
131 Scenario: Restrict to feature type country
132 When sending xml search query "Uruguay"
136 When sending xml search query "Uruguay"
143 Scenario: Restrict to feature type state
144 When sending xml search query "Dakota"
148 When sending xml search query "Dakota"
155 Scenario: Restrict to feature type city
156 When sending xml search query "vaduz"
160 When sending xml search query "vaduz"
167 Scenario: Restrict to feature type settlement
168 When sending json search query "Burg"
172 When sending json search query "Burg"
177 | boundary | administrative |
179 Scenario Outline: Search with polygon threshold (json)
180 When sending json search query "switzerland"
181 | polygon_geojson | polygon_threshold |
183 Then at least 1 result is returned
184 And result 0 has attributes geojson
193 Scenario Outline: Search with polygon threshold (xml)
194 When sending xml search query "switzerland"
195 | polygon_geojson | polygon_threshold |
197 Then at least 1 result is returned
198 And result 0 has attributes geojson
207 Scenario Outline: Search with invalid polygon threshold (xml)
208 When sending xml search query "switzerland"
209 | polygon_geojson | polygon_threshold |
211 Then a HTTP 400 is returned
219 Scenario Outline: Search with extratags
220 When sending <format> search query "Hauptstr"
223 Then result has attributes extratags
231 Scenario Outline: Search with namedetails
232 When sending <format> search query "Hauptstr"
235 Then result has attributes namedetails
243 Scenario Outline: Search result with contains TEXT geometry
244 When sending <format> search query "Highmore"
247 Then result has attributes <response_attribute>
250 | format | response_attribute |
255 Scenario Outline: Search result contains polygon-as-points geometry
256 When sending <format> search query "Highmore"
259 Then result has attributes <response_attribute>
262 | format | response_attribute |
263 | xml | polygonpoints |
264 | json | polygonpoints |
265 | jsonv2 | polygonpoints |
267 Scenario Outline: Search result contains SVG geometry
268 When sending <format> search query "Highmore"
271 Then result has attributes <response_attribute>
274 | format | response_attribute |
279 Scenario Outline: Search result contains KML geometry
280 When sending <format> search query "Highmore"
283 Then result has attributes <response_attribute>
286 | format | response_attribute |
291 Scenario Outline: Search result contains GEOJSON geometry
292 When sending <format> search query "Highmore"
295 Then result has attributes <response_attribute>
298 | format | response_attribute |