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 is
33 | 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 | -5.662003,43.54285,-5.6563282,43.5403125
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"