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
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,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: Unknown formats returns a user error
23 When sending search query "Vaduz"
26 Then a HTTP 400 is returned
28 Scenario Outline: Search with addressdetails
29 When sending <format> search query "Triesen" with address
30 Then address of result 0 is
35 | country | Liechtenstein |
45 Scenario: Coordinate search with addressdetails
46 When sending json search query "47.12400621,9.6047552"
51 | Guschg, Valorschstrasse, Balzers, Oberland, 9497, Liechtenstein |
53 Scenario: Address details with unknown class types
54 When sending json search query "Kloster St. Elisabeth" with address
57 | 0 | amenity | monastery |
58 And result addresses contain
60 | 0 | Kloster St. Elisabeth |
62 Scenario: Disabling deduplication
63 When sending json search query "Malbunstr"
64 Then there are no duplicates
65 When sending json search query "Malbunstr"
68 Then there are duplicates
70 Scenario: Search with bounded viewbox in right area
71 When sending json search query "bar" with address
74 Then result addresses contain
77 When sending json search query "bar" with address
79 | 1 | 9.49712,47.17122,9.52605,47.16242 |
80 Then result addresses contain
84 Scenario: Country search with bounded viewbox remain in the area
85 When sending json search query "" with address
86 | bounded | viewbox | country |
87 | 1 | 9.49712,47.17122,9.52605,47.16242 | de |
88 Then less than 1 result is returned
90 Scenario: Search with bounded viewboxlbrt in right area
91 When sending json search query "bar" with address
92 | bounded | viewboxlbrt |
93 | 1 | 9.49712,47.16242,9.52605,47.17122 |
94 Then result addresses contain
99 Scenario: No POI search with unbounded viewbox
100 When sending json search query "restaurant"
102 | 9.93027,53.61634,10.10073,53.54500 |
105 | ^[^,]*[Rr]estaurant.* |
107 Scenario: bounded search remains within viewbox, even with no results
108 When sending json search query "[restaurant]"
109 | bounded | viewbox |
110 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
111 Then less than 1 result is returned
113 Scenario: bounded search remains within viewbox with results
114 When sending json search query "restaurant"
115 | bounded | viewbox |
116 | 1 | 9.49712,47.17122,9.52605,47.16242 |
117 Then result has centroid in 9.49712,47.16242,9.52605,47.17122
119 Scenario: Prefer results within viewbox
120 When sending json search query "Gässle" with address
123 Then result addresses contain
126 When sending json search query "Gässle" with address
127 | accept-language | viewbox |
128 | en | 9.52413,47.10759,9.53140,47.10539 |
129 Then result addresses contain
133 Scenario: viewboxes cannot be points
134 When sending json search query "foo"
136 | 1.01,34.6,1.01,34.6 |
137 Then a HTTP 400 is returned
139 Scenario Outline: viewbox must have four coordinate numbers
140 When sending json search query "foo"
143 Then a HTTP 400 is returned
150 | 23.1,-6,0.11,44.2,9.1 |
152 Scenario Outline: viewboxlbrt must have four coordinate numbers
153 When sending json search query "foo"
156 Then a HTTP 400 is returned
163 | 23.1,-6,0.11,44.2,9.1 |
165 Scenario: Overly large limit number for search results
166 When sending json search query "restaurant"
169 Then at most 50 results are returned
171 Scenario: Limit number of search results
172 When sending json search query "landstr"
173 Then more than 4 results are returned
174 When sending json search query "landstr"
177 Then exactly 4 results are returned
179 Scenario: Limit parameter must be a number
180 When sending search query "Blue Laguna"
183 Then a HTTP 400 is returned
185 Scenario: Restrict to feature type country
186 When sending xml search query "fürstentum"
190 When sending xml search query "fürstentum"
197 Scenario: Restrict to feature type state
198 When sending xml search query "Wangerberg"
199 Then more than 1 result is returned
200 When sending xml search query "Wangerberg"
203 Then exactly 0 results are returned
205 Scenario: Restrict to feature type city
206 When sending xml search query "vaduz"
210 When sending xml search query "vaduz"
217 Scenario: Restrict to feature type settlement
218 When sending json search query "Malbun"
222 When sending json search query "Malbun"
229 Scenario Outline: Search with polygon threshold (json)
230 When sending json search query "triesenberg"
231 | polygon_geojson | polygon_threshold |
233 Then at least 1 result is returned
234 And result 0 has attributes geojson
243 Scenario Outline: Search with polygon threshold (xml)
244 When sending xml search query "triesenberg"
245 | polygon_geojson | polygon_threshold |
247 Then at least 1 result is returned
248 And result 0 has attributes geojson
257 Scenario Outline: Search with invalid polygon threshold (xml)
258 When sending xml search query "triesenberg"
259 | polygon_geojson | polygon_threshold |
261 Then a HTTP 400 is returned
269 Scenario Outline: Search with extratags
270 When sending <format> search query "Landstr"
273 Then result has attributes extratags
282 Scenario Outline: Search with namedetails
283 When sending <format> search query "Landstr"
286 Then result has attributes namedetails
295 Scenario Outline: Search result with contains TEXT geometry
296 When sending <format> search query "triesenberg"
299 Then result has attributes <response_attribute>
302 | format | response_attribute |
307 Scenario Outline: Search result contains SVG geometry
308 When sending <format> search query "triesenberg"
311 Then result has attributes <response_attribute>
314 | format | response_attribute |
319 Scenario Outline: Search result contains KML geometry
320 When sending <format> search query "triesenberg"
323 Then result has attributes <response_attribute>
326 | format | response_attribute |
331 Scenario Outline: Search result contains GEOJSON geometry
332 When sending <format> search query "triesenberg"
335 Then result has attributes <response_attribute>
338 | format | response_attribute |
342 | geojson | geojson |
344 Scenario Outline: Search result in geojson format contains no non-geojson geometry
345 When sending geojson search query "triesenberg"
346 | polygon_text | polygon_svg | polygon_geokml |
348 Then result 0 has not attributes <response_attribute>
351 | response_attribute |
357 Scenario: Search along a route
358 When sending json search query "rathaus" with address
359 Then result addresses contain
362 When sending json search query "rathaus" with address
363 | bounded | routewidth | route |
364 | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 |
365 Then result addresses contain