mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 01:47:57 +00:00
88 lines
3.1 KiB
Gherkin
88 lines
3.1 KiB
Gherkin
Feature: Tests for finding places by osm_type and osm_id
|
|
Simple tests for response format.
|
|
|
|
Scenario Outline: Address lookup for existing object
|
|
When sending v1/lookup with format <format>
|
|
| osm_ids |
|
|
| N5484325405,W43327921,,R123924,X99,N0 |
|
|
Then a HTTP 200 is returned
|
|
And the result is valid <outformat>
|
|
And exactly 3 results are returned
|
|
|
|
Examples:
|
|
| format | outformat |
|
|
| xml | xml |
|
|
| json | json |
|
|
| jsonv2 | json |
|
|
| geojson | geojson |
|
|
| geocodejson | geocodejson |
|
|
|
|
Scenario: Address lookup for non-existing or invalid object
|
|
When sending v1/lookup
|
|
| osm_ids |
|
|
| X99,,N0,nN158845944,ABC,,W9 |
|
|
Then a HTTP 200 is returned
|
|
And the result is valid xml
|
|
And exactly 0 results are returned
|
|
|
|
Scenario Outline: Boundingbox is returned
|
|
When sending v1/lookup with format <format>
|
|
| osm_ids |
|
|
| N5484325405,W43327921 |
|
|
Then the result is valid <outformat>
|
|
And the result set contains exactly
|
|
| object | boundingbox!in_box |
|
|
| N5484325405 | 47.135,47.14,9.52,9.525 |
|
|
| W43327921 | 47.07,47.08,9.50,9.52 |
|
|
|
|
Examples:
|
|
| format | outformat |
|
|
| xml | xml |
|
|
| json | json |
|
|
| jsonv2 | json |
|
|
| geojson | geojson |
|
|
|
|
Scenario Outline: Lookup with entrances
|
|
When sending v1/lookup with format <format>
|
|
| osm_ids | entrances |
|
|
| W429210603 | 1 |
|
|
Then a HTTP 200 is returned
|
|
And the result is valid <outformat>
|
|
And result 0 contains in field entrances+0
|
|
| osm_id | type | lat | lon |
|
|
| 6580031131 | yes | 47.2489382 | 9.5284033 |
|
|
|
|
Examples:
|
|
| format | outformat |
|
|
| json | json |
|
|
| jsonv2 | json |
|
|
| geojson | geojson |
|
|
|
|
Scenario: Linked places return information from the linkee
|
|
When sending v1/lookup with format geocodejson
|
|
| osm_ids |
|
|
| N1932181216 |
|
|
Then the result is valid geocodejson
|
|
And exactly 1 result is returned
|
|
And all results contain
|
|
| name |
|
|
| Vaduz |
|
|
|
|
Scenario Outline: Force error by providing too many ids
|
|
When sending v1/lookup with format <format>
|
|
| osm_ids |
|
|
| 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 |
|
|
Then a HTTP 400 is returned
|
|
And the result is valid <outformat>
|
|
And the result contains
|
|
| error+code | error+message |
|
|
| 400 | Too many object IDs. |
|
|
|
|
Examples:
|
|
| format | outformat |
|
|
| xml | xml |
|
|
| json | json |
|
|
| jsonv2 | json |
|
|
| geojson | json |
|
|
| geocodejson | json |
|