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
33 Then address of result 0 is
37 | country | Mauritania |
40 Scenario: coordinate search with addressdetails
41 When sending json search query "14.271104294939,107.69828796387"
44 | Plei Ya RĂȘ, Kon Tum province, Vietnam |
46 Scenario: Address details with unknown class types
47 When sending json search query "Hundeauslauf, Hamburg" with address
50 | 0 | leisure | dog_park |
51 And result addresses contain
54 And address of result 0 has no types leisure,dog_park
56 Scenario: Disabling deduplication
57 When sending json search query "Sievekingsallee, Hamburg"
58 Then there are no duplicates
59 When sending json search query "Sievekingsallee, Hamburg"
62 Then there are duplicates
64 Scenario: Search with bounded viewbox in right area
65 When sending json search query "restaurant" with address
67 | 1 | 9.93027,53.61634,10.10073,53.54500 |
68 Then result addresses contain
72 Scenario: Search with bounded viewboxlbrt in right area
73 When sending json search query "restaurant" with address
74 | bounded | viewboxlbrt |
75 | 1 | 9.93027,53.54500,10.10073,53.61634 |
76 Then result addresses contain
80 Scenario: No POI search with unbounded viewbox
81 When sending json search query "restaurant"
83 | 9.93027,53.61634,10.10073,53.54500 |
86 | ^[^,]*[Rr]estaurant.* |
88 Scenario: bounded search remains within viewbox, even with no results
89 When sending json search query "restaurant"
91 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
92 Then less than 1 result is returned
94 Scenario: bounded search remains within viewbox with results
95 When sending json search query "restaurant"
97 | 1 | 9.93027,53.61634,10.10073,53.54500 |
98 Then result has bounding box in 53.54500,53.61634,9.93027,10.10073
100 Scenario: Prefer results within viewbox
101 When sending json search query "25 de Mayo" with address
104 Then result addresses contain
107 When sending json search query "25 de Mayo" with address
108 | accept-language | viewbox |
109 | en | -56.35879,-34.18330,-56.31618,-34.20815 |
110 Then result addresses contain
114 Scenario: Overly large limit number for search results
115 When sending json search query "restaurant"
118 Then at most 50 results are returned
120 Scenario: Limit number of search results
121 When sending json search query "restaurant"
124 Then exactly 4 results are returned
126 Scenario: Restrict to feature type country
127 When sending xml search query "Uruguay"
131 When sending xml search query "Uruguay"
138 Scenario: Restrict to feature type state
139 When sending xml search query "Dakota"
143 When sending xml search query "Dakota"
150 Scenario: Restrict to feature type city
151 When sending xml search query "vaduz"
155 When sending xml search query "vaduz"
162 Scenario: Restrict to feature type settlement
163 When sending json search query "Burg"
167 When sending json search query "Burg"
172 | boundary | administrative |
174 Scenario Outline: Search with polygon threshold (json)
175 When sending json search query "switzerland"
176 | polygon_geojson | polygon_threshold |
178 Then at least 1 result is returned
179 And result 0 has attributes geojson
188 Scenario Outline: Search with polygon threshold (xml)
189 When sending xml search query "switzerland"
190 | polygon_geojson | polygon_threshold |
192 Then at least 1 result is returned
193 And result 0 has attributes geojson
202 Scenario Outline: Search with invalid polygon threshold (xml)
203 When sending xml search query "switzerland"
204 | polygon_geojson | polygon_threshold |
206 Then a HTTP 400 is returned
214 Scenario Outline: Search with extratags
215 When sending <format> search query "Hauptstr"
218 Then result has attributes extratags
226 Scenario Outline: Search with namedetails
227 When sending <format> search query "Hauptstr"
230 Then result has attributes namedetails
238 Scenario Outline: Search result with contains TEXT geometry
239 When sending <format> search query "Highmore"
242 Then result has attributes <response_attribute>
245 | format | response_attribute |
250 Scenario Outline: Search result contains polygon-as-points geometry
251 When sending <format> search query "Highmore"
254 Then result has attributes <response_attribute>
257 | format | response_attribute |
258 | xml | polygonpoints |
259 | json | polygonpoints |
260 | jsonv2 | polygonpoints |
262 Scenario Outline: Search result contains SVG geometry
263 When sending <format> search query "Highmore"
266 Then result has attributes <response_attribute>
269 | format | response_attribute |
274 Scenario Outline: Search result contains KML geometry
275 When sending <format> search query "Highmore"
278 Then result has attributes <response_attribute>
281 | format | response_attribute |
286 Scenario Outline: Search result contains GEOJSON geometry
287 When sending <format> search query "Highmore"
290 Then result has attributes <response_attribute>
293 | format | response_attribute |