]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/reverse/params.feature
bdd: add tests for valid debug output
[nominatim.git] / test / bdd / api / reverse / params.feature
1 @APIDB
2 Feature: Parameters for Reverse API
3     Testing different parameter options for reverse API.
4
5     Scenario Outline: Reverse-geocoding without address
6         When sending <format> reverse coordinates 47.13,9.56
7           | addressdetails |
8           | 0 |
9         Then exactly 1 result is returned
10         And result has not attributes address
11
12     Examples:
13       | format |
14       | json |
15       | jsonv2 |
16       | geojson |
17       | xml |
18
19     Scenario Outline: Coordinates must be floating-point numbers
20         When sending reverse coordinates <coords>
21         Then a HTTP 400 is returned
22
23     Examples:
24       | coords    |
25       | -45.3,;   |
26       | gkjd,50   |
27
28     Scenario Outline: Zoom levels between 4 and 18 are allowed
29         When sending reverse coordinates 47.14122383,9.52169581334
30           | zoom |
31           | <zoom> |
32         Then exactly 1 result is returned
33         And result addresses contain
34           | country_code |
35           | li |
36
37     Examples:
38       | zoom |
39       | 4 |
40       | 5 |
41       | 6 |
42       | 7 |
43       | 8 |
44       | 9 |
45       | 10 |
46       | 11 |
47       | 12 |
48       | 13 |
49       | 14 |
50       | 15 |
51       | 16 |
52       | 17 |
53       | 18 |
54
55     Scenario: Non-numerical zoom levels return an error
56         When sending reverse coordinates 47.14122383,9.52169581334
57           | zoom |
58           | adfe |
59         Then a HTTP 400 is returned
60
61     Scenario Outline: Reverse Geocoding with extratags
62         When sending <format> reverse coordinates 47.1395013150811,9.522098077031046
63           | extratags |
64           | 1 |
65         Then result 0 has attributes extratags
66
67     Examples:
68         | format |
69         | xml |
70         | json |
71         | jsonv2 |
72         | geojson |
73
74     Scenario Outline: Reverse Geocoding with namedetails
75         When sending <format> reverse coordinates 47.1395013150811,9.522098077031046
76           | namedetails |
77           | 1 |
78         Then result 0 has attributes namedetails
79
80     Examples:
81         | format |
82         | xml |
83         | json |
84         | jsonv2 |
85         | geojson |
86
87     Scenario Outline: Reverse Geocoding contains TEXT geometry
88         When sending <format> reverse coordinates 47.165989816710066,9.515774846076965
89           | polygon_text |
90           | 1 |
91         Then result 0 has attributes <response_attribute>
92
93     Examples:
94         | format   | response_attribute |
95         | xml      | geotext |
96         | json     | geotext |
97         | jsonv2   | geotext |
98
99     Scenario Outline: Reverse Geocoding contains SVG geometry
100         When sending <format> reverse coordinates 47.165989816710066,9.515774846076965
101           | polygon_svg |
102           | 1 |
103         Then result 0 has attributes <response_attribute>
104
105     Examples:
106         | format   | response_attribute |
107         | xml      | geosvg |
108         | json     | svg |
109         | jsonv2   | svg |
110
111     Scenario Outline: Reverse Geocoding contains KML geometry
112         When sending <format> reverse coordinates 47.165989816710066,9.515774846076965
113           | polygon_kml |
114           | 1 |
115         Then result 0 has attributes <response_attribute>
116
117     Examples:
118         | format   | response_attribute |
119         | xml      | geokml |
120         | json     | geokml |
121         | jsonv2   | geokml |
122
123     Scenario Outline: Reverse Geocoding contains GEOJSON geometry
124         When sending <format> reverse coordinates 47.165989816710066,9.515774846076965
125           | polygon_geojson |
126           | 1 |
127         Then result 0 has attributes <response_attribute>
128
129     Examples:
130         | format   | response_attribute |
131         | xml      | geojson |
132         | json     | geojson |
133         | jsonv2   | geojson |
134         | geojson  | geojson |
135
136     Scenario Outline: Reverse Geocoding in geojson format contains no non-geojson geometry
137         When sending geojson reverse coordinates 47.165989816710066,9.515774846076965
138           | polygon_text | polygon_svg | polygon_geokml |
139           | 1            | 1           | 1              |
140         Then result 0 has not attributes <response_attribute>
141
142     Examples:
143         | response_attribute |
144         | geotext            |
145         | polygonpoints      |
146         | svg                |
147         | geokml             |