]> git.openstreetmap.org Git - nominatim.git/blob - tests/features/api/language.feature
during reverse geocode lookup we also check the (optional) Tiger data for house numbers
[nominatim.git] / tests / features / api / language.feature
1 Feature: Localization of search results
2
3     Scenario: Search - default language
4         When sending json search query "Germany"
5         Then results contain
6           | ID | display_name
7           | 0  | Deutschland.*
8
9     Scenario: Search - accept-language first
10         Given the request parameters
11           | accept-language
12           | en,de
13         When sending json search query "Deutschland"
14         Then results contain
15           | ID | display_name
16           | 0  | Germany.*
17         
18     Scenario: Search - accept-language missing
19         Given the request parameters
20           | accept-language
21           | xx,fr,en,de
22         When sending json search query "Deutschland"
23         Then results contain
24           | ID | display_name
25           | 0  | Allemagne.*
26
27     Scenario: Search - http accept language header first
28         Given the HTTP header
29           | accept-language
30           | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3
31         When sending json search query "Deutschland"
32         Then results contain
33           | ID | display_name
34           | 0  | Allemagne.*
35
36     Scenario: Search - http accept language header and accept-language
37         Given the request parameters
38           | accept-language
39           | de,en
40         Given the HTTP header
41           | accept-language
42           | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3
43         When sending json search query "Deutschland"
44         Then results contain
45           | ID | display_name
46           | 0  | Deutschland.*
47
48     Scenario: Search - http accept language header fallback
49         Given the HTTP header
50           | accept-language
51           | fr-ca,en-ca;q=0.5
52         When sending json search query "Deutschland"
53         Then results contain
54           | ID | display_name
55           | 0  | Allemagne.*
56
57     Scenario: Search - http accept language header fallback (upper case)
58         Given the HTTP header
59           | accept-language
60           | fr-FR;q=0.8,en-ca;q=0.5
61         When sending json search query "Deutschland"
62         Then results contain
63           | ID | display_name
64           | 0  | Allemagne.*
65
66     Scenario: Reverse - default language
67         When looking up coordinates 48.13921,11.57328
68         Then result addresses contain
69           | ID | city
70           | 0  | München
71
72     Scenario: Reverse - accept-language parameter
73         Given the request parameters
74           | accept-language
75           | en,fr
76         When looking up coordinates 48.13921,11.57328
77         Then result addresses contain
78           | ID | city
79           | 0  | Munich
80
81     Scenario: Reverse - HTTP accept language header
82         Given the HTTP header
83           | accept-language
84           | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3
85         When looking up coordinates 48.13921,11.57328
86         Then result addresses contain
87           | ID | city
88           | 0  | Munich
89     
90     Scenario: Reverse - accept-language parameter and HTTP header
91         Given the request parameters
92           | accept-language
93           | it
94         Given the HTTP header
95           | accept-language
96           | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3
97         When looking up coordinates 48.13921,11.57328
98         Then result addresses contain
99           | ID | city
100           | 0  | Monaco di Baviera