]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/lookup/simple.feature
release 5.2.0.post10
[nominatim.git] / test / bdd / features / api / lookup / simple.feature
1 Feature: Tests for finding places by osm_type and osm_id
2     Simple tests for response format.
3
4     Scenario Outline: Address lookup for existing object
5         When sending v1/lookup with format <format>
6           | osm_ids |
7           | N5484325405,W43327921,,R123924,X99,N0 |
8         Then a HTTP 200 is returned
9         And the result is valid <outformat>
10         And exactly 3 results are returned
11
12     Examples:
13         | format      | outformat   |
14         | xml         | xml         |
15         | json        | json        |
16         | jsonv2      | json        |
17         | geojson     | geojson     |
18         | geocodejson | geocodejson |
19
20     Scenario: Address lookup for non-existing or invalid object
21         When sending v1/lookup
22           | osm_ids |
23           | X99,,N0,nN158845944,ABC,,W9 |
24         Then a HTTP 200 is returned
25         And the result is valid xml
26         And exactly 0 results are returned
27
28     Scenario Outline: Boundingbox is returned
29         When sending v1/lookup with format <format>
30           | osm_ids |
31           | N5484325405,W43327921 |
32         Then the result is valid <outformat>
33         And the result set contains exactly
34           | object      | boundingbox!in_box |
35           | N5484325405 | 47.135,47.14,9.52,9.525 |
36           | W43327921   | 47.07,47.08,9.50,9.52   |
37
38     Examples:
39         | format      | outformat   |
40         | xml         | xml         |
41         | json        | json        |
42         | jsonv2      | json        |
43         | geojson     | geojson     |
44
45     Scenario Outline: Lookup with entrances
46         When sending v1/lookup with format <format>
47           | osm_ids    | entrances |
48           | W429210603 | 1         |
49         Then a HTTP 200 is returned
50         And the result is valid <outformat>
51         And result 0 contains in field entrances+0
52           | osm_id     | type | lat        | lon       |
53           | 6580031131 | yes  | 47.2489382 | 9.5284033 |
54
55         Examples:
56           | format | outformat |
57           | json   | json |
58           | jsonv2 | json |
59           | geojson | geojson |
60
61     Scenario: Linked places return information from the linkee
62         When sending v1/lookup with format geocodejson
63           | osm_ids |
64           | N1932181216 |
65         Then the result is valid geocodejson
66         And exactly 1 result is returned
67         And all results contain
68           | name  |
69           | Vaduz |
70
71     Scenario Outline: Force error by providing too many ids
72         When sending v1/lookup with format <format>
73           | osm_ids |
74           | N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15,N16,N17,N18,N19,N20,N21,N22,N23,N24,N25,N26,N27,N28,N29,N30,N31,N32,N33,N34,N35,N36,N37,N38,N39,N40,N41,N42,N43,N44,N45,N46,N47,N48,N49,N50,N51 |
75         Then a HTTP 400 is returned
76         And the result is valid <outformat>
77         And the result contains
78           | error+code | error+message |
79           | 400        | Too many object IDs. |
80
81     Examples:
82         | format      | outformat   |
83         | xml         | xml         |
84         | json        | json        |
85         | jsonv2      | json        |
86         | geojson     | json        |
87         | geocodejson | json        |