]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/bdd/api/search/params.feature
Merge pull request #3301 from lonvia/fix-class-search-regression
[nominatim.git] / test / bdd / api / search / params.feature
index 9c4d1f10b3cd2ae639c2715439b0c6430bc3c610..e667b690b0d8f2572498c6ceefbf776f86b8422e 100644 (file)
@@ -1,3 +1,4 @@
+@SQLITE
 @APIDB
 Feature: Search queries
     Testing different queries and parameters
@@ -34,6 +35,7 @@ Feature: Search queries
           | postcode     | 9495 |
           | country      | Liechtenstein |
           | country_code | li |
+          | ISO3166-2-lvl8 | LI-09 |
 
     Examples:
           | format |
@@ -67,14 +69,15 @@ Feature: Search queries
           | 0 |
         Then there are duplicates
 
+    @fail-legacy
     Scenario: Search with bounded viewbox in right area
-        When sending json search query "bar" with address
+        When sending json search query "post" with address
           | bounded | viewbox |
           | 1       |  9,47,10,48 |
         Then result addresses contain
           | ID | town |
           | 0  | Vaduz |
-        When sending json search query "bar" with address
+        When sending json search query "post" with address
           | bounded | viewbox |
           | 1       |  9.49712,47.17122,9.52605,47.16242 |
         Then result addresses contain
@@ -117,18 +120,18 @@ Feature: Search queries
         Then result has centroid in 9.49712,47.16242,9.52605,47.17122
 
     Scenario: Prefer results within viewbox
-        When sending json search query "Gässle" with address
-          | accept-language |
-          | en |
-        Then result addresses contain
-          | ID | town |
-          | 0  | Balzers |
         When sending json search query "Gässle" with address
           | accept-language | viewbox |
           | en              | 9.52413,47.10759,9.53140,47.10539 |
         Then result addresses contain
           | ID | village |
           | 0  | Triesen |
+        When sending json search query "Gässle" with address
+          | accept-language | viewbox |
+          | en              | 9.45949,47.08421,9.54094,47.05466 |
+        Then result addresses contain
+          | ID | town |
+          | 0  | Balzers |
 
     Scenario: viewboxes cannot be points
         When sending json search query "foo"
@@ -169,11 +172,13 @@ Feature: Search queries
         Then at most 50 results are returned
 
     Scenario: Limit number of search results
-        When sending json search query "schloss"
+        When sending json search query "landstr"
+          | dedupe |
+          | 0      |
         Then more than 4 results are returned
-        When sending json search query "schloss"
-          | limit |
-          | 4 |
+        When sending json search query "landstr"
+          | limit | dedupe |
+          | 4     | 0      |
         Then exactly 4 results are returned
 
     Scenario: Limit parameter must be a number
@@ -183,10 +188,6 @@ Feature: Search queries
         Then a HTTP 400 is returned
 
     Scenario: Restrict to feature type country
-        When sending xml search query "fürstentum"
-        Then results contain
-          | ID | class |
-          | 1  | building |
         When sending xml search query "fürstentum"
           | featureType |
           | country |
@@ -196,7 +197,7 @@ Feature: Search queries
 
     Scenario: Restrict to feature type state
         When sending xml search query "Wangerberg"
-        Then more than 1 result is returned
+        Then at least 1 result is returned
         When sending xml search query "Wangerberg"
           | featureType |
           | state |
@@ -204,9 +205,7 @@ Feature: Search queries
 
     Scenario: Restrict to feature type city
         When sending xml search query "vaduz"
-        Then results contain
-          | ID | place_rank |
-          | 1  | 30 |
+        Then at least 1 result is returned
         When sending xml search query "vaduz"
           | featureType |
           | city |
@@ -227,7 +226,7 @@ Feature: Search queries
           | place | village |
 
     Scenario Outline: Search with polygon threshold (json)
-        When sending json search query "switzerland"
+        When sending json search query "triesenberg"
           | polygon_geojson | polygon_threshold |
           | 1               | <th> |
         Then at least 1 result is returned
@@ -241,7 +240,7 @@ Feature: Search queries
         | 999 |
 
     Scenario Outline: Search with polygon threshold (xml)
-        When sending xml search query "switzerland"
+        When sending xml search query "triesenberg"
           | polygon_geojson | polygon_threshold |
           | 1               | <th> |
         Then at least 1 result is returned
@@ -255,7 +254,7 @@ Feature: Search queries
         | 999 |
 
     Scenario Outline: Search with invalid polygon threshold (xml)
-        When sending xml search query "switzerland"
+        When sending xml search query "triesenberg"
           | polygon_geojson | polygon_threshold |
           | 1               | <th> |
         Then a HTTP 400 is returned
@@ -354,12 +353,13 @@ Feature: Search queries
         | svg                |
         | geokml             |
 
+    @v1-api-php-only
     Scenario: Search along a route
-        When sending json search query "schloss" with address
+        When sending json search query "rathaus" with address
         Then result addresses contain
           | ID | town |
-          | 0  | Vaduz |
-        When sending json search query "schloss" with address
+          | 0  | Schaan |
+        When sending json search query "rathaus" with address
           | bounded | routewidth | route                              |
           | 1       | 0.1        |  9.54353,47.11772,9.54314,47.11894 |
         Then result addresses contain
@@ -367,3 +367,10 @@ Feature: Search queries
           | Triesenberg |
 
 
+    Scenario: Array parameters are ignored
+        When sending json search query "Vaduz" with address
+          | countrycodes[] | polygon_svg[] | limit[] | polygon_threshold[] |
+          | IT             | 1             | 3       | 3.4                 |
+        Then result addresses contain
+          | ID | country_code |
+          | 0  | li           |