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
12 Scenario: Simple JSON search
13 When sending json search query "Vaduz"
14 And result 0 has attributes place_id,licence,icon,class,type
15 And result 0 has attributes osm_type,osm_id,boundingbox
16 And result 0 has attributes lat,lon,display_name,importance
17 And result 0 has not attributes address
19 Scenario: JSON search with addressdetails
20 When sending json search query "Montevideo" with address
21 Then address of result 0 is
28 Scenario: XML search with addressdetails
29 When sending xml search query "Inuvik" with address
30 Then address of result 0 contains
33 | state | Northwest Territories
37 Scenario: Address details with unknown class types
38 When sending json search query "foobar, Essen" with address
41 | 0 | leisure | hackerspace
42 And result addresses contain
45 And address of result 0 does not contain leisure,hackerspace
47 Scenario: Disabling deduplication
48 When sending json search query "Oxford Street, London"
49 Then there are no duplicates
50 Given the request parameters
53 When sending json search query "Oxford Street, London"
54 Then there are duplicates
56 Scenario: Search with bounded viewbox in right area
57 Given the request parameters
59 | 1 | -87.7,41.9,-87.57,41.85
60 When sending json search query "restaurant" with address
61 Then result addresses contain
65 Scenario: Search with bounded viewboxlbrt in right area
66 Given the request parameters
67 | bounded | viewboxlbrt
68 | 1 | -87.7,41.85,-87.57,41.9
69 When sending json search query "restaurant" with address
70 Then result addresses contain
74 Scenario: No POI search with unbounded viewbox
75 Given the request parameters
77 | -87.7,41.9,-87.57,41.85
78 When sending json search query "restaurant"
81 | [^,]*(?i)restaurant.*
83 Scenario: bounded search remains within viewbox, even with no results
84 Given the request parameters
86 | 1 | 43.54285,-5.662003,43.5403125,-5.6563282
87 When sending json search query "restaurant"
88 Then less than 1 result is returned
90 Scenario: bounded search remains within viewbox with results
91 Given the request parameters
93 | 1 | -5.662003,43.55,-5.6563282,43.5403125
94 When sending json search query "restaurant"
96 | >= -5.662003 | >= 43.5403125
97 | <= -5.6563282| <= 43.55
99 Scenario: Prefer results within viewbox
100 Given the request parameters
103 When sending json search query "royan" with address
104 Then result addresses contain
107 Given the request parameters
108 | accept-language | viewbox
109 | en | 51.94,36.59,51.99,36.56
110 When sending json search query "royan" with address
111 Then result addresses contain
115 Scenario: Overly large limit number for search results
116 Given the request parameters
119 When sending json search query "Neustadt"
120 Then at most 50 results are returned
122 Scenario: Limit number of search results
123 Given the request parameters
126 When sending json search query "Neustadt"
127 Then exactly 4 results are returned
129 Scenario: Restrict to feature type country
130 Given the request parameters
133 When sending xml search query "Monaco"
138 Scenario: Restrict to feature type state
139 When sending xml search query "Berlin"
143 Given the request parameters
146 When sending xml search query "Berlin"
151 Scenario: Restrict to feature type city
152 Given the request parameters
155 When sending xml search query "Monaco"
161 Scenario: Restrict to feature type settlement
162 When sending json search query "Everest"
165 | 0 | Mount Everest.*
166 Given the request parameters
169 When sending json search query "Everest"
174 Scenario Outline: Search with polygon threshold (json)
175 Given the request parameters
176 | polygon_geojson | polygon_threshold
178 When sending json search query "switzerland"
179 Then at least 1 result is returned
180 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
206 Scenario Outline: Search with extratags
207 Given the request parameters
210 When sending <format> search query "Hauptstr"
211 Then result 0 has attributes extratags
212 And result 1 has attributes extratags
220 Scenario Outline: Search with namedetails
221 Given the request parameters
224 When sending <format> search query "Hauptstr"
225 Then result 0 has attributes namedetails
226 And result 1 has attributes namedetails