2 Simple tests for internal server errors and response format.
3 These tests should pass on any Nominatim installation.
5 Scenario Outline: Testing different parameters
6 Given the request parameters
9 When sending search query "Manchester"
10 Then the result is valid html
11 Given the request parameters
14 When sending html search query "Manchester"
15 Then the result is valid html
16 Given the request parameters
19 When sending xml search query "Manchester"
20 Then the result is valid xml
21 Given the request parameters
24 When sending json search query "Manchester"
25 Then the result is valid json
26 Given the request parameters
29 When sending jsonv2 search query "Manchester"
30 Then the result is valid json
46 | accept-language | de,en
47 | countrycodes | uk,ir
50 | exclude_place_ids| 385252,1234515
55 Scenario: Search with invalid output format
56 Given the request parameters
59 When sending search query "Berlin"
60 Then the result is valid html
62 Scenario Outline: Simple Searches
63 When sending search query "<query>"
64 Then the result is valid html
65 When sending html search query "<query>"
66 Then the result is valid html
67 When sending xml search query "<query>"
68 Then the result is valid xml
69 When sending json search query "<query>"
70 Then the result is valid json
71 When sending jsonv2 search query "<query>"
72 Then the result is valid json
78 | 12, Main Street, Houston
88 Scenario: Empty XML search
89 When sending xml search query "xnznxvcx"
90 Then result header contains
92 | querystring | xnznxvcx
94 | more_url | .*format=xml.*q=xnznxvcx.*
96 Scenario: Empty XML search with special XML characters
97 When sending xml search query "xfdghn&zxn"xvbyx<vxx>cssdex"
98 Then result header contains
100 | querystring | xfdghn&zxn"xvbyx<vxx>cssdex
102 | more_url | .*format=xml.*q=xfdghn&zxn"xvbyx<vxx>cssdex.*
104 Scenario: Empty XML search with viewbox
105 Given the request parameters
108 When sending xml search query "xnznxvcx"
109 Then result header contains
111 | querystring | xnznxvcx
113 | viewbox | 12,45.13,13,44
115 Scenario: Empty XML search with viewboxlbrt
116 Given the request parameters
119 When sending xml search query "xnznxvcx"
120 Then result header contains
122 | querystring | xnznxvcx
124 | viewbox | 12,34.13,13,35
126 Scenario: Empty XML search with viewboxlbrt and viewbox
127 Given the request parameters
128 | viewbox | viewboxblrt
129 | 12,45.13,13.5,44 | 1,0,2,1
130 When sending xml search query "pub"
131 Then result header contains
135 | viewbox | 12,45.13,13.5,44
138 Scenario Outline: Empty XML search with polygon values
139 Given the request parameters
142 When sending xml search query "xnznxvcx"
143 Then result header contains
157 | true | '; delete from foobar; select '
160 Scenario: Empty XML search with exluded place ids
161 Given the request parameters
164 When sending xml search query "jghrleoxsbwjer"
165 Then result header contains
167 | exclude_place_ids | 123,76,342565
169 Scenario: Empty XML search with bad exluded place ids
170 Given the request parameters
173 When sending xml search query "jghrleoxsbwjer"
174 Then result header has no attribute exclude_place_ids
176 Scenario Outline: Wrapping of legal jsonp search requests
177 Given the request parameters
180 When sending json search query "Tokyo"
181 Then there is a json wrapper "<data>"
192 Scenario Outline: Wrapping of illegal jsonp search requests
193 Given the request parameters
196 When sending json search query "Tokyo"
197 Then a HTTP 400 is returned
206 Scenario Outline: Ignore jsonp parameter for anything but json
207 Given the request parameters
210 When sending json search query "Malibu"
211 Then a HTTP 400 is returned
212 Given the request parameters
215 When sending xml search query "Malibu"
216 Then the result is valid xml
217 Given the request parameters
220 When sending html search query "Malibu"
221 Then the result is valid html
223 Scenario: Empty JSON search
224 When sending json search query "YHlERzzx"
225 Then exactly 0 results are returned
227 Scenario: Empty JSONv2 search
228 When sending jsonv2 search query "Flubb XdfESSaZx"
229 Then exactly 0 results are returned
231 Scenario: Search for non-existing coordinates
232 When sending json search query "-21.0,-33.0"
233 Then exactly 0 results are returned