]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/api/reverse_simple.feature
make path to wikipedia files configurable
[nominatim.git] / tests / features / api / reverse_simple.feature
1 Feature: Simple Reverse Tests
2     Simple tests for internal server errors and response format.
3     These tests should pass on any Nominatim installation.
4
5     Scenario Outline: Simple reverse-geocoding
6         When looking up xml coordinates <lat>,<lon>
7         Then the result is valid xml
8         When looking up json coordinates <lat>,<lon>
9         Then the result is valid json
10         When looking up jsonv2 coordinates <lat>,<lon>
11         Then the result is valid json
12
13     Examples:
14      | lat      | lon
15      | 0.0      | 0.0
16      | 45.3     | 3.5
17      | -79.34   | 23.5
18      | 0.23     | -178.555
19
20     Scenario Outline: Testing different parameters
21         Given the request parameters
22           | <parameter>
23           | <value>
24         When sending search query "Manchester"
25         Then the result is valid html
26         Given the request parameters
27           | <parameter>
28           | <value>
29         When sending html search query "Manchester"
30         Then the result is valid html
31         Given the request parameters
32           | <parameter>
33           | <value>
34         When sending xml search query "Manchester"
35         Then the result is valid xml
36         Given the request parameters
37           | <parameter>
38           | <value>
39         When sending json search query "Manchester"
40         Then the result is valid json
41         Given the request parameters
42           | <parameter>
43           | <value>
44         When sending jsonv2 search query "Manchester"
45         Then the result is valid json
46
47     Examples:
48      | parameter        | value
49      | polygon          | 1
50      | polygon          | 0
51      | polygon_text     | 1
52      | polygon_text     | 0
53      | polygon_kml      | 1
54      | polygon_kml      | 0
55      | polygon_geojson  | 1
56      | polygon_geojson  | 0
57      | polygon_svg      | 1
58      | polygon_svg      | 0
59
60
61
62
63     Scenario Outline: Wrapping of legal jsonp requests
64         Given the request parameters
65         | json_callback
66         | foo
67         When looking up <format> coordinates 67.3245,0.456
68         Then the result is valid json
69
70     Examples:
71       | format
72       | json
73       | jsonv2
74
75     Scenario: Reverse-geocoding without address
76         Given the request parameters
77           | addressdetails
78           | 0
79         When looking up xml coordinates 36.791966,127.171726
80         Then the result is valid xml
81         When looking up json coordinates 36.791966,127.171726
82         Then the result is valid json
83         When looking up jsonv2 coordinates 36.791966,127.171726
84         Then the result is valid json
85
86     Scenario: Reverse-geocoding with zoom
87         Given the request parameters
88           | zoom
89           | 10
90         When looking up xml coordinates 36.791966,127.171726
91         Then the result is valid xml
92         When looking up json coordinates 36.791966,127.171726
93         Then the result is valid json
94         When looking up jsonv2 coordinates 36.791966,127.171726
95         Then the result is valid json
96
97     Scenario: Missing lon parameter
98         Given the request parameters
99           | lat
100           | 51.51
101         When sending an API call reverse
102         Then a HTTP 400 is returned
103
104     Scenario: Missing lat parameter
105         Given the request parameters
106           | lon
107           | -79.39114
108         When sending an API call reverse
109         Then a HTTP 400 is returned
110
111     Scenario: Missing osm_id parameter
112         Given the request parameters
113           | osm_type
114           | N
115         When sending an API call reverse
116         Then a HTTP 400 is returned
117
118     Scenario: Missing osm_type parameter
119         Given the request parameters
120           | osm_id
121           | 3498564
122         When sending an API call reverse
123         Then a HTTP 400 is returned
124
125     Scenario Outline: Bad format for lat or lon
126         Given the request parameters
127           | lat   | lon   |
128           | <lat> | <lon> |
129         When sending an API call reverse
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