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,77,33
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,45.13,77,33
126 Scenario: Empty XML search with viewboxlbrt and viewbox
127 Given the request parameters
128 | viewbox | viewboxblrt
129 | 12,45.13,77,33 | 1,2,3,4
130 When sending xml search query "pub"
131 Then result header contains
135 | viewbox | 12,45.13,77,33
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 Outline: Wrapping of legal jsonp search requests
170 Given the request parameters
173 When sending json search query "Tokyo"
174 Then there is a json wrapper "<data>"
185 Scenario Outline: Wrapping of illegal jsonp search requests
186 Given the request parameters
189 When sending json search query "Tokyo"
190 Then a HTTP 400 is returned
199 Scenario Outline: Ignore jsonp parameter for anything but json
200 Given the request parameters
203 When sending json search query "Malibu"
204 Then a HTTP 400 is returned
205 Given the request parameters
208 When sending xml search query "Malibu"
209 Then the result is valid xml
210 Given the request parameters
213 When sending html search query "Malibu"
214 Then the result is valid html
216 Scenario: Empty JSON search
217 When sending json search query "YHlERzzx"
218 Then exactly 0 results are returned
220 Scenario: Empty JSONv2 search
221 When sending jsonv2 search query "Flubb XdfESSaZx"
222 Then exactly 0 results are returned
224 Scenario: Search for non-existing coordinates
225 When sending json search query "-21.0,-33.0"
226 Then exactly 0 results are returned