]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/reverse/simple.feature
Merge branch 'patch-1' of https://github.com/ganeshkrishnan1/Nominatim into ganeshkri...
[nominatim.git] / test / bdd / api / reverse / simple.feature
1 @APIDB
2 Feature: Simple Reverse Tests
3     Simple tests for internal server errors and response format.
4
5     Scenario Outline: Simple reverse-geocoding
6         When sending reverse coordinates <lat>,<lon>
7         Then the result is valid xml
8         When sending xml reverse coordinates <lat>,<lon>
9         Then the result is valid xml
10         When sending json reverse coordinates <lat>,<lon>
11         Then the result is valid json
12         When sending jsonv2 reverse coordinates <lat>,<lon>
13         Then the result is valid json
14         When sending geojson reverse coordinates <lat>,<lon>
15         Then the result is valid geojson
16         When sending html reverse coordinates <lat>,<lon>
17         Then the result is valid html
18
19     Examples:
20      | lat      | lon |
21      | 0.0      | 0.0 |
22      | -34.830  | -56.105 |
23      | 45.174   | -103.072 |
24      | 21.156   | -12.2744 |
25
26     Scenario Outline: Testing different parameters
27         When sending reverse coordinates 53.603,10.041
28           | param       | value   |
29           | <parameter> | <value> |
30         Then the result is valid xml
31         When sending html reverse coordinates 53.603,10.041
32           | param       | value   |
33           | <parameter> | <value> |
34         Then the result is valid html
35         When sending xml reverse coordinates 53.603,10.041
36           | param       | value   |
37           | <parameter> | <value> |
38         Then the result is valid xml
39         When sending json reverse coordinates 53.603,10.041
40           | param       | value   |
41           | <parameter> | <value> |
42         Then the result is valid json
43         When sending jsonv2 reverse coordinates 53.603,10.041
44           | param       | value   |
45           | <parameter> | <value> |
46         Then the result is valid json
47         When sending geojson reverse coordinates 53.603,10.041
48           | param       | value   |
49           | <parameter> | <value> |
50         Then the result is valid geojson
51         When sending geocodejson reverse coordinates 53.603,10.041
52           | param       | value   |
53           | <parameter> | <value> |
54         Then the result is valid geocodejson
55
56     Examples:
57      | parameter        | value |
58      | polygon_text     | 1 |
59      | polygon_text     | 0 |
60      | polygon_kml      | 1 |
61      | polygon_kml      | 0 |
62      | polygon_geojson  | 1 |
63      | polygon_geojson  | 0 |
64      | polygon_svg      | 1 |
65      | polygon_svg      | 0 |
66
67     Scenario Outline: Wrapping of legal jsonp requests
68         When sending <format> reverse coordinates 67.3245,0.456
69         | json_callback |
70         | foo |
71         Then the result is valid <outformat>
72
73     Examples:
74       | format | outformat |
75       | json | json |
76       | jsonv2 | json |
77       | geojson | geojson |
78
79     Scenario Outline: Boundingbox is returned
80         When sending <format> reverse coordinates 14.62,108.1
81           | zoom |
82           | 8 |
83         Then result has bounding box in 9,20,102,113
84
85     Examples:
86       | format |
87       | json |
88       | jsonv2 |
89       | geojson |
90       | xml |
91
92     Scenario Outline: Reverse-geocoding with zoom
93         When sending <format> reverse coordinates 53.603,10.041
94           | zoom |
95           | 10 |
96         Then exactly 1 result is returned
97
98     Examples:
99       | format |
100       | json |
101       | jsonv2 |
102       | geojson |
103       | html |
104       | xml |
105
106     Scenario: Missing lon parameter
107         When sending reverse coordinates 52.52,
108         Then a HTTP 400 is returned
109
110     Scenario: Missing lat parameter
111         When sending reverse coordinates ,52.52
112         Then a HTTP 400 is returned
113
114     Scenario: Missing osm_id parameter
115         When sending reverse coordinates ,
116           | osm_type |
117           | N |
118         Then a HTTP 400 is returned
119
120     Scenario: Missing osm_type parameter
121         When sending reverse coordinates ,
122           | osm_id |
123           | 3498564 |
124         Then a HTTP 400 is returned
125
126     Scenario Outline: Bad format for lat or lon
127         When sending reverse coordinates ,
128           | lat   | lon   |
129           | <lat> | <lon> |
130         Then a HTTP 400 is returned
131
132     Examples:
133      | lat      | lon |
134      | 48.9660  | 8,4482 |
135      | 48,9660  | 8.4482 |
136      | 48,9660  | 8,4482 |
137      | 48.966.0 | 8.4482 |
138      | 48.966   | 8.448.2 |
139      | Nan      | 8.448 |
140      | 48.966   | Nan |