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 |
37 | ISO3166-2-lvl8 | LI-09 |
46 Scenario: Coordinate search with addressdetails
47 When sending json search query "47.12400621,9.6047552"
52 | Guschg, Valorschstrasse, Balzers, Oberland, 9497, Liechtenstein |
54 Scenario: Address details with unknown class types
55 When sending json search query "Kloster St. Elisabeth" with address
58 | 0 | amenity | monastery |
59 And result addresses contain
61 | 0 | Kloster St. Elisabeth |
63 Scenario: Disabling deduplication
64 When sending json search query "Malbunstr"
65 Then there are no duplicates
66 When sending json search query "Malbunstr"
69 Then there are duplicates
71 Scenario: Search with bounded viewbox in right area
72 When sending json search query "bar" with address
75 Then result addresses contain
78 When sending json search query "bar" with address
80 | 1 | 9.49712,47.17122,9.52605,47.16242 |
81 Then result addresses contain
85 Scenario: Country search with bounded viewbox remain in the area
86 When sending json search query "" with address
87 | bounded | viewbox | country |
88 | 1 | 9.49712,47.17122,9.52605,47.16242 | de |
89 Then less than 1 result is returned
91 Scenario: Search with bounded viewboxlbrt in right area
92 When sending json search query "bar" with address
93 | bounded | viewboxlbrt |
94 | 1 | 9.49712,47.16242,9.52605,47.17122 |
95 Then result addresses contain
100 Scenario: No POI search with unbounded viewbox
101 When sending json search query "restaurant"
103 | 9.93027,53.61634,10.10073,53.54500 |
106 | ^[^,]*[Rr]estaurant.* |
108 Scenario: bounded search remains within viewbox, even with no results
109 When sending json search query "[restaurant]"
110 | bounded | viewbox |
111 | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 |
112 Then less than 1 result is returned
114 Scenario: bounded search remains within viewbox with results
115 When sending json search query "restaurant"
116 | bounded | viewbox |
117 | 1 | 9.49712,47.17122,9.52605,47.16242 |
118 Then result has centroid in 9.49712,47.16242,9.52605,47.17122
120 Scenario: Prefer results within viewbox
121 When sending json search query "Gässle" with address
124 Then result addresses contain
127 When sending json search query "Gässle" with address
128 | accept-language | viewbox |
129 | en | 9.52413,47.10759,9.53140,47.10539 |
130 Then result addresses contain
134 Scenario: viewboxes cannot be points
135 When sending json search query "foo"
137 | 1.01,34.6,1.01,34.6 |
138 Then a HTTP 400 is returned
140 Scenario Outline: viewbox must have four coordinate numbers
141 When sending json search query "foo"
144 Then a HTTP 400 is returned
151 | 23.1,-6,0.11,44.2,9.1 |
153 Scenario Outline: viewboxlbrt must have four coordinate numbers
154 When sending json search query "foo"
157 Then a HTTP 400 is returned
164 | 23.1,-6,0.11,44.2,9.1 |
166 Scenario: Overly large limit number for search results
167 When sending json search query "restaurant"
170 Then at most 50 results are returned
172 Scenario: Limit number of search results
173 When sending json search query "landstr"
174 Then more than 4 results are returned
175 When sending json search query "landstr"
178 Then exactly 4 results are returned
180 Scenario: Limit parameter must be a number
181 When sending search query "Blue Laguna"
184 Then a HTTP 400 is returned
186 Scenario: Restrict to feature type country
187 When sending xml search query "fürstentum"
191 When sending xml search query "fürstentum"
198 Scenario: Restrict to feature type state
199 When sending xml search query "Wangerberg"
200 Then more than 1 result is returned
201 When sending xml search query "Wangerberg"
204 Then exactly 0 results are returned
206 Scenario: Restrict to feature type city
207 When sending xml search query "vaduz"
211 When sending xml search query "vaduz"
218 Scenario: Restrict to feature type settlement
219 When sending json search query "Malbun"
223 When sending json search query "Malbun"
230 Scenario Outline: Search with polygon threshold (json)
231 When sending json search query "triesenberg"
232 | polygon_geojson | polygon_threshold |
234 Then at least 1 result is returned
235 And result 0 has attributes geojson
244 Scenario Outline: Search with polygon threshold (xml)
245 When sending xml search query "triesenberg"
246 | polygon_geojson | polygon_threshold |
248 Then at least 1 result is returned
249 And result 0 has attributes geojson
258 Scenario Outline: Search with invalid polygon threshold (xml)
259 When sending xml search query "triesenberg"
260 | polygon_geojson | polygon_threshold |
262 Then a HTTP 400 is returned
270 Scenario Outline: Search with extratags
271 When sending <format> search query "Landstr"
274 Then result has attributes extratags
283 Scenario Outline: Search with namedetails
284 When sending <format> search query "Landstr"
287 Then result has attributes namedetails
296 Scenario Outline: Search result with contains TEXT geometry
297 When sending <format> search query "triesenberg"
300 Then result has attributes <response_attribute>
303 | format | response_attribute |
308 Scenario Outline: Search result contains SVG geometry
309 When sending <format> search query "triesenberg"
312 Then result has attributes <response_attribute>
315 | format | response_attribute |
320 Scenario Outline: Search result contains KML geometry
321 When sending <format> search query "triesenberg"
324 Then result has attributes <response_attribute>
327 | format | response_attribute |
332 Scenario Outline: Search result contains GEOJSON geometry
333 When sending <format> search query "triesenberg"
336 Then result has attributes <response_attribute>
339 | format | response_attribute |
343 | geojson | geojson |
345 Scenario Outline: Search result in geojson format contains no non-geojson geometry
346 When sending geojson search query "triesenberg"
347 | polygon_text | polygon_svg | polygon_geokml |
349 Then result 0 has not attributes <response_attribute>
352 | response_attribute |
358 Scenario: Search along a route
359 When sending json search query "rathaus" with address
360 Then result addresses contain
363 When sending json search query "rathaus" with address
364 | bounded | routewidth | route |
365 | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 |
366 Then result addresses contain