1 Feature: Search queries
2 Testing different queries and parameters
4 Scenario: Simple XML search
5 When sending xml search query "Schaan"
6 Then result 0 has attributes place_id,osm_type,osm_id
7 And result 0 has attributes place_rank,boundingbox
8 And result 0 has attributes lat,lon,display_name
9 And result 0 has attributes class,type,importance,icon
10 And result 0 has not attributes address
11 And results contain valid boundingboxes
13 Scenario: Simple JSON search
14 When sending json search query "Vaduz"
15 And result 0 has attributes place_id,licence,icon,class,type
16 And result 0 has attributes osm_type,osm_id,boundingbox
17 And result 0 has attributes lat,lon,display_name,importance
18 And result 0 has not attributes address
19 And results contain valid boundingboxes
21 Scenario: JSON search with addressdetails
22 When sending json search query "Montevideo" with address
23 Then address of result 0 is
30 Scenario: XML search with addressdetails
31 When sending xml search query "Inuvik" with address
32 Then address of result 0 contains
35 | state | Northwest Territories
39 Scenario: Address details with unknown class types
40 When sending json search query "foobar, Essen" with address
43 | 0 | leisure | hackerspace
44 And result addresses contain
47 And address of result 0 does not contain leisure,hackerspace
49 Scenario: Disabling deduplication
50 When sending json search query "Oxford Street, London"
51 Then there are no duplicates
52 Given the request parameters
55 When sending json search query "Oxford Street, London"
56 Then there are duplicates
58 Scenario: Search with bounded viewbox in right area
59 Given the request parameters
61 | 1 | -87.7,41.9,-87.57,41.85
62 When sending json search query "restaurant" with address
63 Then result addresses contain
67 Scenario: Search with bounded viewboxlbrt in right area
68 Given the request parameters
69 | bounded | viewboxlbrt
70 | 1 | -87.7,41.85,-87.57,41.9
71 When sending json search query "restaurant" with address
72 Then result addresses contain
76 Scenario: No POI search with unbounded viewbox
77 Given the request parameters
79 | -87.7,41.9,-87.57,41.85
80 When sending json search query "restaurant"
83 | [^,]*(?i)restaurant.*
85 Scenario: bounded search remains within viewbox, even with no results
86 Given the request parameters
88 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003
89 When sending json search query "restaurant"
90 Then less than 1 result is returned
92 Scenario: bounded search remains within viewbox with results
93 Given the request parameters
95 | 1 | -5.662003,43.55,-5.6563282,43.5403125
96 When sending json search query "restaurant"
98 | >= -5.662003 | >= 43.5403125
99 | <= -5.6563282| <= 43.55
101 Scenario: Prefer results within viewbox
102 Given the request parameters
105 When sending json search query "royan" with address
106 Then result addresses contain
109 Given the request parameters
110 | accept-language | viewbox
111 | en | 51.94,36.59,51.99,36.56
112 When sending json search query "royan" with address
113 Then result addresses contain
117 Scenario: Overly large limit number for search results
118 Given the request parameters
121 When sending json search query "Neustadt"
122 Then at most 50 results are returned
124 Scenario: Limit number of search results
125 Given the request parameters
128 When sending json search query "Neustadt"
129 Then exactly 4 results are returned
131 Scenario: Restrict to feature type country
132 Given the request parameters
135 When sending xml search query "Monaco"
140 Scenario: Restrict to feature type state
141 When sending xml search query "Berlin"
145 Given the request parameters
148 When sending xml search query "Berlin"
153 Scenario: Restrict to feature type city
154 Given the request parameters
157 When sending xml search query "Monaco"
163 Scenario: Restrict to feature type settlement
164 When sending json search query "Everest"
167 | 0 | Mount Everest.*
168 Given the request parameters
171 When sending json search query "Everest"
176 Scenario Outline: Search with polygon threshold (json)
177 Given the request parameters
178 | polygon_geojson | polygon_threshold
180 When sending json search query "switzerland"
181 Then at least 1 result is returned
182 And result 0 has attributes geojson
191 Scenario Outline: Search with polygon threshold (xml)
192 Given the request parameters
193 | polygon_geojson | polygon_threshold
195 When sending xml search query "switzerland"
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 Given the request parameters
208 | polygon_geojson | polygon_threshold
210 When sending xml search query "switzerland"
211 Then a HTTP 400 is returned
214 Scenario Outline: Search with extratags
215 Given the request parameters
218 When sending <format> search query "Hauptstr"
219 Then result 0 has attributes extratags
220 And result 1 has attributes extratags
228 Scenario Outline: Search with namedetails
229 Given the request parameters
232 When sending <format> search query "Hauptstr"
233 Then result 0 has attributes namedetails
234 And result 1 has attributes namedetails
243 Scenario Outline: Search result with contains TEXT geometry
244 Given the request parameters
247 When sending <format> search query "switzerland"
248 Then result 0 has attributes <response_attribute>
251 | format | response_attribute
256 Scenario Outline: Search result contains polygon-as-points geometry
257 Given the request parameters
260 When sending <format> search query "switzerland"
261 Then result 0 has attributes <response_attribute>
264 | format | response_attribute
265 | xml | polygonpoints
266 | json | polygonpoints
267 | jsonv2 | polygonpoints
271 Scenario Outline: Search result contains SVG geometry
272 Given the request parameters
275 When sending <format> search query "switzerland"
276 Then result 0 has attributes <response_attribute>
279 | format | response_attribute
285 Scenario Outline: Search result contains KML geometry
286 Given the request parameters
289 When sending <format> search query "switzerland"
290 Then result 0 has attributes <response_attribute>
293 | format | response_attribute
299 Scenario Outline: Search result contains GEOJSON geometry
300 Given the request parameters
303 When sending <format> search query "switzerland"
304 Then result 0 has attributes <response_attribute>
307 | format | response_attribute