]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/api/lookup/simple.feature
release 5.1.0.post8
[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: Linked places return information from the linkee
46         When sending v1/lookup with format geocodejson
47           | osm_ids |
48           | N1932181216 |
49         Then the result is valid geocodejson
50         And exactly 1 result is returned
51         And all results contain
52           | name  |
53           | Vaduz |
54
55     Scenario Outline: Force error by providing too many ids
56         When sending v1/lookup with format <format>
57           | osm_ids |
58           | 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 |
59         Then a HTTP 400 is returned
60         And the result is valid <outformat>
61         And the result contains
62           | error+code | error+message |
63           | 400        | Too many object IDs. |
64
65     Examples:
66         | format      | outformat   |
67         | xml         | xml         |
68         | json        | json        |
69         | jsonv2      | json        |
70         | geojson     | json        |
71         | geocodejson | json        |