]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/reverse/v1_params.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / api / reverse / v1_params.feature
1 Feature: v1/reverse Parameter Tests
2     Tests for parameter inputs for the v1 reverse endpoint.
3     This file contains mostly bad parameter input. Valid parameters
4     are tested in the format tests.
5
6     Scenario: Bad format
7         When sending v1/reverse
8           | lat         | lon           | format |
9           | 47.14122383 | 9.52169581334 | sdf |
10         Then a HTTP 400 is returned
11
12     Scenario: Missing lon parameter
13         When sending v1/reverse
14           | lat   |
15           | 52.52 |
16         Then a HTTP 400 is returned
17
18     Scenario: Missing lat parameter
19         When sending v1/reverse
20           | lon |
21           | 52.52 |
22         Then a HTTP 400 is returned
23
24     Scenario Outline: Bad format for lat or lon
25         When sending v1/reverse
26           | lat   | lon   |
27           | <lat> | <lon> |
28         Then a HTTP 400 is returned
29
30         Examples:
31           | lat      | lon |
32           | 48.9660  | 8,4482 |
33           | 48,9660  | 8.4482 |
34           | 48,9660  | 8,4482 |
35           | 48.966.0 | 8.4482 |
36           | 48.966   | 8.448.2 |
37           | Nan      | 8.448  |
38           | 48.966   | Nan    |
39           | Inf      | 5.6    |
40           | 5.6      | -Inf   |
41           | <script></script> | 3.4 |
42           | 3.4 | <script></script> |
43           | -45.3    | ;      |
44           | gkjd     | 50     |
45
46     Scenario: Non-numerical zoom levels return an error
47         When sending v1/reverse
48           | lat         | lon           | zoom |
49           | 47.14122383 | 9.52169581334 | adfe |
50         Then a HTTP 400 is returned
51
52     Scenario Outline: Truthy values for boolean parameters
53         When sending v1/reverse
54           | lat         | lon           | addressdetails |
55           | 47.14122383 | 9.52169581334 | <value> |
56         Then a HTTP 200 is returned
57         And the result is valid xml
58         And the result has attributes address
59
60         When sending v1/reverse
61           | lat         | lon           | extratags |
62           | 47.14122383 | 9.52169581334 | <value> |
63         Then a HTTP 200 is returned
64         And the result is valid xml
65         And the result has attributes extratags
66
67         When sending v1/reverse
68           | lat         | lon           | namedetails |
69           | 47.14122383 | 9.52169581334 | <value> |
70         Then a HTTP 200 is returned
71         And the result is valid xml
72         And the result has attributes namedetails
73
74         Examples:
75           | value |
76           | yes   |
77           | no    |
78           | -1    |
79           | 100   |
80           | false |
81           | 00    |
82
83     Scenario: Only one geometry can be requested
84         When sending v1/reverse
85           | lat         | lon           | polygon_text | polygon_svg |
86           | 47.14122383 | 9.52169581334 | 1            | 1           |
87         Then a HTTP 400 is returned
88
89     Scenario Outline: Illegal jsonp are not allowed
90         When sending v1/reverse with format json
91           | lat         | lon           | json_callback |
92           | 47.14122383 | 9.52169581334 | <data> |
93         Then a HTTP 400 is returned
94
95         Examples:
96           | data |
97           | 1asd |
98           | bar(foo) |
99           | XXX['bad'] |
100           | foo; evil |
101
102     Scenario Outline: Reverse debug mode produces valid HTML
103         When sending v1/reverse
104           | lat   | lon   | debug |
105           | <lat> | <lon> | 1 |
106         Then a HTTP 200 is returned
107         And the result is valid html
108
109         Examples:
110           | lat      | lon     |
111           | 0.0      | 0.0     |
112           | 47.06645 | 9.56601 |
113           | 47.14081 | 9.52267 |
114
115     Scenario Outline: Full address display for city housenumber-level address with street
116         When sending v1/reverse with format <format>
117           | lat        | lon        |
118           | 47.1068011 | 9.52810091 |
119         Then a HTTP 200 is returned
120         And the result is valid <outformat>
121         And the result contains in field address
122           | param          | value     |
123           | house_number   | 8         |
124           | road           | Im Winkel |
125           | neighbourhood  | Oberdorf  |
126           | village        | Triesen   |
127           | ISO3166-2-lvl8 | LI-09     |
128           | county         | Oberland  |
129           | postcode       | 9495      |
130           | country        | Liechtenstein |
131           | country_code   | li        |
132
133         Examples:
134           | format  | outformat |
135           | json    | json |
136           | jsonv2  | json |
137           | xml     | xml |
138
139     Scenario Outline: Results with name details
140         When sending v1/reverse with format <format>
141           | lat      | lon     | zoom | namedetails |
142           | 47.14052 | 9.52202 | 14   | 1           |
143         Then a HTTP 200 is returned
144         And the result is valid <outformat>
145         And the result contains in field namedetails
146           | name     |
147           | Ebenholz |
148
149         Examples:
150           | format  | outformat |
151           | json    | json |
152           | jsonv2  | json |
153           | xml     | xml |
154
155     Scenario Outline: Results with extratags
156         When sending v1/reverse with format <format>
157           | lat      | lon     | zoom | extratags |
158           | 47.14052 | 9.52202 | 14   | 1         |
159         Then a HTTP 200 is returned
160         And the result is valid <outformat>
161         And the result contains in field extratags
162           | wikidata |
163           | Q4529531 |
164
165         Examples:
166           | format | outformat |
167           | json   | json |
168           | jsonv2 | json |
169           | xml    | xml |