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
34 | state | Northwest Territories
38 Scenario: Address details with unknown class types
39 When sending json search query "foobar, Essen" with address
42 | 0 | leisure | hackerspace
43 And result addresses contain
46 And address of result 0 does not contain leisure,hackerspace
48 Scenario: Disabling deduplication
49 When sending json search query "Oxford Street, London"
50 Then there are no duplicates
51 Given the request parameters
54 When sending json search query "Oxford Street, London"
55 Then there are duplicates
57 Scenario: Search with bounded viewbox in right area
58 Given the request parameters
60 | 1 | -87.7,41.9,-87.57,41.85
61 When sending json search query "restaurant" with address
62 Then result addresses contain
66 Scenario: Search with bounded viewboxlbrt in right area
67 Given the request parameters
68 | bounded | viewboxlbrt
69 | 1 | -87.7,41.85,-87.57,41.9
70 When sending json search query "restaurant" with address
71 Then result addresses contain
75 Scenario: No POI search with unbounded viewbox
76 Given the request parameters
78 | -87.7,41.9,-87.57,41.85
79 When sending json search query "restaurant"
82 | [^,]*(?i)restaurant.*
84 Scenario: bounded search remains within viewbox, even with no results
85 Given the request parameters
87 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003
88 When sending json search query "restaurant"
89 Then less than 1 result is returned
91 Scenario: bounded search remains within viewbox with results
92 Given the request parameters
94 | 1 | -5.662003,43.55,-5.6563282,43.5403125
95 When sending json search query "restaurant"
97 | >= -5.662003 | >= 43.5403125
98 | <= -5.6563282| <= 43.55
100 Scenario: Prefer results within viewbox
101 Given the request parameters
104 When sending json search query "royan" with address
105 Then result addresses contain
108 Given the request parameters
109 | accept-language | viewbox
110 | en | 51.94,36.59,51.99,36.56
111 When sending json search query "royan" with address
112 Then result addresses contain
116 Scenario: Overly large limit number for search results
117 Given the request parameters
120 When sending json search query "Neustadt"
121 Then at most 50 results are returned
123 Scenario: Limit number of search results
124 Given the request parameters
127 When sending json search query "Neustadt"
128 Then exactly 4 results are returned
130 Scenario: Restrict to feature type country
131 Given the request parameters
134 When sending xml search query "Monaco"
139 Scenario: Restrict to feature type state
140 When sending xml search query "Berlin"
144 Given the request parameters
147 When sending xml search query "Berlin"
152 Scenario: Restrict to feature type city
153 Given the request parameters
156 When sending xml search query "Monaco"
162 Scenario: Restrict to feature type settlement
163 When sending json search query "Everest"
166 | 0 | Mount Everest.*
167 Given the request parameters
170 When sending json search query "Everest"
175 Scenario Outline: Search with polygon threshold (json)
176 Given the request parameters
177 | polygon_geojson | polygon_threshold
179 When sending json search query "switzerland"
180 Then at least 1 result is returned
181 And result 0 has attributes geojson
190 Scenario Outline: Search with polygon threshold (xml)
191 Given the request parameters
192 | polygon_geojson | polygon_threshold
194 When sending xml search query "switzerland"
195 Then at least 1 result is returned
196 And result 0 has attributes geojson
205 Scenario Outline: Search with invalid polygon threshold (xml)
206 Given the request parameters
207 | polygon_geojson | polygon_threshold
209 When sending xml search query "switzerland"
210 Then a HTTP 400 is returned
213 Scenario Outline: Search with extratags
214 Given the request parameters
217 When sending <format> search query "Hauptstr"
218 Then result 0 has attributes extratags
219 And result 1 has attributes extratags
227 Scenario Outline: Search with namedetails
228 Given the request parameters
231 When sending <format> search query "Hauptstr"
232 Then result 0 has attributes namedetails
233 And result 1 has attributes namedetails
242 Scenario Outline: Search result with contains TEXT geometry
243 Given the request parameters
246 When sending <format> search query "switzerland"
247 Then result 0 has attributes <response_attribute>
250 | format | response_attribute
255 Scenario Outline: Search result contains polygon-as-points geometry
256 Given the request parameters
259 When sending <format> search query "switzerland"
260 Then result 0 has attributes <response_attribute>
263 | format | response_attribute
264 | xml | polygonpoints
265 | json | polygonpoints
266 | jsonv2 | polygonpoints
270 Scenario Outline: Search result contains SVG geometry
271 Given the request parameters
274 When sending <format> search query "switzerland"
275 Then result 0 has attributes <response_attribute>
278 | format | response_attribute
284 Scenario Outline: Search result contains KML geometry
285 Given the request parameters
288 When sending <format> search query "switzerland"
289 Then result 0 has attributes <response_attribute>
292 | format | response_attribute
298 Scenario Outline: Search result contains GEOJSON geometry
299 Given the request parameters
302 When sending <format> search query "switzerland"
303 Then result 0 has attributes <response_attribute>
306 | format | response_attribute