]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/api/search/structured.feature
update osm2pgsql to 1.11.0
[nominatim.git] / test / bdd / api / search / structured.feature
1 @SQLITE
2 @APIDB
3 Feature: Structured search queries
4     Testing correctness of results with
5     structured queries
6
7     Scenario: Country only
8         When sending json search query "" with address
9           | country |
10           | Liechtenstein |
11         Then address of result 0 is
12           | type         | value |
13           | country      | Liechtenstein |
14           | country_code | li |
15
16     Scenario: Postcode only
17         When sending json search query "" with address
18           | postalcode |
19           | 9495 |
20         Then results contain
21           | type |
22           | ^post(al_)?code |
23         And result addresses contain
24           | postcode |
25           | 9495 |
26
27     Scenario: Street, postcode and country
28         When sending xml search query "" with address
29           | street          | postalcode | country |
30           | Old Palace Road | GU2 7UP    | United Kingdom |
31         Then result header contains
32           | attr        | value |
33           | querystring | Old Palace Road, GU2 7UP, United Kingdom |
34
35     Scenario: Street with housenumber, city and postcode
36         When sending xml search query "" with address
37           | street             | city  | postalcode |
38           | 19 Am schrägen Weg | Vaduz | 9490       |
39         Then result addresses contain
40           | house_number | road |
41           | 19           | Am Schrägen Weg |
42
43     Scenario: Street with housenumber, city and bad postcode
44         When sending xml search query "" with address
45           | street             | city  | postalcode |
46           | 19 Am schrägen Weg | Vaduz | 9491       |
47         Then result addresses contain
48           | house_number | road |
49           | 19           | Am Schrägen Weg |
50
51     Scenario: Amenity, city
52         When sending json search query "" with address
53           | city  | amenity |
54           | Vaduz | bar  |
55         Then result addresses contain
56           | country |
57           | Liechtenstein |
58         And  results contain
59           | class   | type |
60           | amenity | ^(pub)\|(bar)\|(restaurant) |
61
62     #176
63     Scenario: Structured search restricts rank
64         When sending json search query "" with address
65           | city |
66           | Vaduz |
67         Then result addresses contain
68           | town |
69           | Vaduz |