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
59 Scenario: Search with invalid output format
60 Given the request parameters
63 When sending search query "Berlin"
64 Then a HTTP 400 is returned
66 Scenario Outline: Simple Searches
67 When sending search query "<query>"
68 Then the result is valid html
69 When sending html search query "<query>"
70 Then the result is valid html
71 When sending xml search query "<query>"
72 Then the result is valid xml
73 When sending json search query "<query>"
74 Then the result is valid json
75 When sending jsonv2 search query "<query>"
76 Then the result is valid json
82 | 12, Main Street, Houston
92 Scenario: Empty XML search
93 When sending xml search query "xnznxvcx"
94 Then result header contains
96 | querystring | xnznxvcx
98 | more_url | .*format=xml.*q=xnznxvcx.*
100 Scenario: Empty XML search with special XML characters
101 When sending xml search query "xfdghn&zxn"xvbyx<vxx>cssdex"
102 Then result header contains
104 | querystring | xfdghn&zxn"xvbyx<vxx>cssdex
106 | more_url | .*format=xml.*q=xfdghn&zxn"xvbyx<vxx>cssdex.*
108 Scenario: Empty XML search with viewbox
109 Given the request parameters
112 When sending xml search query "xnznxvcx"
113 Then result header contains
115 | querystring | xnznxvcx
117 | viewbox | 12,45.13,77,33
119 Scenario: Empty XML search with viewboxlbrt
120 Given the request parameters
123 When sending xml search query "xnznxvcx"
124 Then result header contains
126 | querystring | xnznxvcx
128 | viewbox | 12,45.13,77,33
130 Scenario: Empty XML search with viewboxlbrt and viewbox
131 Given the request parameters
132 | viewbox | viewboxblrt
133 | 12,45.13,77,33 | 1,2,3,4
134 When sending xml search query "pub"
135 Then result header contains
139 | viewbox | 12,45.13,77,33
142 Scenario Outline: Empty XML search with polygon values
143 Given the request parameters
146 When sending xml search query "xnznxvcx"
147 Then result header contains
161 | true | '; delete from foobar; select '
164 Scenario: Empty XML search with exluded place ids
165 Given the request parameters
168 When sending xml search query "jghrleoxsbwjer"
169 Then result header contains
171 | exclude_place_ids | 123,76,342565
173 Scenario: Empty XML search with bad exluded place ids
174 Given the request parameters
177 When sending xml search query "jghrleoxsbwjer"
178 Then result header has no attribute exclude_place_ids
180 Scenario Outline: Wrapping of legal jsonp search requests
181 Given the request parameters
184 When sending json search query "Tokyo"
185 Then there is a json wrapper "<data>"
196 Scenario Outline: Wrapping of illegal jsonp search requests
197 Given the request parameters
200 When sending json search query "Tokyo"
201 Then a HTTP 400 is returned
210 Scenario Outline: Ignore jsonp parameter for anything but json
211 Given the request parameters
214 When sending json search query "Malibu"
215 Then a HTTP 400 is returned
216 Given the request parameters
219 When sending xml search query "Malibu"
220 Then the result is valid xml
221 Given the request parameters
224 When sending html search query "Malibu"
225 Then the result is valid html
227 Scenario: Empty JSON search
228 When sending json search query "YHlERzzx"
229 Then exactly 0 results are returned
231 Scenario: Empty JSONv2 search
232 When sending jsonv2 search query "Flubb XdfESSaZx"
233 Then exactly 0 results are returned
235 Scenario: Search for non-existing coordinates
236 When sending json search query "-21.0,-33.0"
237 Then exactly 0 results are returned