From: Sarah Hoffmann Date: Sat, 9 Jan 2021 15:59:46 +0000 (+0100) Subject: bdd: convert API tests to smaller test db X-Git-Tag: v3.7.0~58^2~4 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/5d656891ba072d88b8b281d239d0dce9f7bd6a1c bdd: convert API tests to smaller test db Changes BDD API tests to restrict themselves to Liechtenstein. One test moved to DB as no appropriate data is available. --- diff --git a/test/bdd/api/details/params.feature b/test/bdd/api/details/params.feature index fe3c4d0e..03b91d29 100644 --- a/test/bdd/api/details/params.feature +++ b/test/bdd/api/details/params.feature @@ -3,20 +3,20 @@ Feature: Object details Testing different parameter options for details API. Scenario: JSON Details - When sending json details query for W78099902 + When sending json details query for W297699560 Then the result is valid json And result has attributes geometry And result has not attributes keywords,address,linked_places,parentof Scenario: JSON Details with keywords - When sending json details query for W78099902 + When sending json details query for W297699560 | keywords | | 1 | Then the result is valid json And result has attributes keywords Scenario: JSON Details with addressdetails - When sending json details query for W78099902 + When sending json details query for W297699560 | addressdetails | | 1 | Then the result is valid json @@ -30,7 +30,7 @@ Feature: Object details And result has attributes linked_places Scenario: JSON Details with hierarchy - When sending json details query for W78099902 + When sending json details query for W297699560 | hierarchy | | 1 | Then the result is valid json @@ -50,7 +50,8 @@ Feature: Object details Examples: | osmid | - | W78099902 | - | N3121929846 | + | W297699560 | + | W243055645 | + | W243055716 | diff --git a/test/bdd/api/details/simple.feature b/test/bdd/api/details/simple.feature index 83960e7b..906c4ce5 100644 --- a/test/bdd/api/details/simple.feature +++ b/test/bdd/api/details/simple.feature @@ -8,9 +8,9 @@ Feature: Object details Examples: | format | object | - | json | 492887 | - | json | N4267356889 | - | json | W230804120 | + | json | 107077 | + | json | N5484325405 | + | json | W43327921 | | json | R123924 | Scenario Outline: Details via unknown OSM id @@ -23,14 +23,14 @@ Feature: Object details | json | R1 | Scenario: Details with keywords - When sending details query for W78099902 + When sending details query for W43327921 | keywords | | 1 | Then the result is valid json # ticket #1343 Scenario: Details of a country with keywords - When sending details query for R287072 + When sending details query for R1155955 | keywords | | 1 | Then the result is valid json diff --git a/test/bdd/api/lookup/simple.feature b/test/bdd/api/lookup/simple.feature index 53b222a0..6aae8c48 100644 --- a/test/bdd/api/lookup/simple.feature +++ b/test/bdd/api/lookup/simple.feature @@ -3,7 +3,7 @@ Feature: Places by osm_type and osm_id Tests Simple tests for response format. Scenario Outline: address lookup for existing node, way, relation - When sending lookup query for N3284625766,W6065798,,R123924,X99,N0 + When sending lookup query for N5484325405,W43327921,,R123924,X99,N0 Then the result is valid And exactly 3 results are returned @@ -20,10 +20,10 @@ Feature: Places by osm_type and osm_id Tests Then exactly 0 results are returned Scenario Outline: Boundingbox is returned - When sending lookup query for N3284625766,W6065798 + When sending lookup query for N5484325405,W43327921 Then exactly 2 results are returned - And result 0 has bounding box in -32.812,-32.811,-56.509,-56.508 - And result 1 has bounding box in 47.14,47.15,9.51,9.53 + And result 0 has bounding box in 47.135,47.14,9.52,9.525 + And result 1 has bounding box in 47.07,47.08,9.50,9.52 Examples: | format | diff --git a/test/bdd/api/reverse/addressdetails.feature b/test/bdd/api/reverse/addressdetails.feature deleted file mode 100644 index 5aa3846b..00000000 --- a/test/bdd/api/reverse/addressdetails.feature +++ /dev/null @@ -1,10 +0,0 @@ -@APIDB -Feature: Reverse addressdetails - Tests for addressdetails in reverse queries - - #github #1763 - Scenario: Correct translation of highways under construction - When sending jsonv2 reverse coordinates -34.0290514,-53.5832235 - Then result addresses contain - | road | - | Ruta 9 Coronel Leonardo Olivera | diff --git a/test/bdd/api/reverse/geocodejson.feature b/test/bdd/api/reverse/geocodejson.feature index 44f8288b..3d6a9b10 100644 --- a/test/bdd/api/reverse/geocodejson.feature +++ b/test/bdd/api/reverse/geocodejson.feature @@ -3,13 +3,15 @@ Feature: Parameters for Reverse API Testing correctness of geocodejson output. Scenario: City housenumber-level address with street - When sending geocodejson reverse coordinates 53.556,9.9607 + When sending geocodejson reverse coordinates 47.1068011,9.52810091 Then results contain - | housenumber | street | postcode | city | country | - | 10 | Brunnenhofstraße | 22767 | Hamburg | Deutschland | + | housenumber | street | postcode | city | country | + | 8 | Im Winkel | 9495 | Triesen | Liechtenstein | Scenario: Town street-level address with street When sending geocodejson reverse coordinates 47.066,9.504 + | zoom | + | 16 | Then results contain | name | city | postcode | country | | Gnetsch | Balzers | 9496 | Liechtenstein | @@ -21,7 +23,7 @@ Feature: Parameters for Reverse API | Burgweg | Balzers | 9496 | Liechtenstein | Scenario: City address with suburb - When sending geocodejson reverse coordinates 53.5822,10.0805 + When sending geocodejson reverse coordinates 47.146861,9.511771 Then results contain - | housenumber | street | district | city | postcode | country | - | 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland | + | housenumber | street | district | city | postcode | country | + | 5 | Lochgass | Ebenholz | Vaduz | 9490 | Liechtenstein | diff --git a/test/bdd/api/reverse/language.feature b/test/bdd/api/reverse/language.feature index 9ead4e02..43d1f11b 100644 --- a/test/bdd/api/reverse/language.feature +++ b/test/bdd/api/reverse/language.feature @@ -2,35 +2,35 @@ Feature: Localization of reverse search results Scenario: default language - When sending json reverse coordinates 18.1147,-15.95 + When sending json reverse coordinates 47.14,9.55 Then result addresses contain | ID | country | - | 0 | موريتانيا | + | 0 | Liechtenstein | Scenario: accept-language parameter - When sending json reverse coordinates 18.1147,-15.95 + When sending json reverse coordinates 47.14,9.55 | accept-language | - | en,fr | + | ja,en | Then result addresses contain | ID | country | - | 0 | Mauritania | + | 0 | リヒテンシュタイン | Scenario: HTTP accept language header Given the HTTP header | accept-language | - | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3 | - When sending json reverse coordinates 18.1147,-15.95 + | fo-ca,fo;q=0.8,en-ca;q=0.5,en;q=0.3 | + When sending json reverse coordinates 47.14,9.55 Then result addresses contain | ID | country | - | 0 | Mauritanie | + | 0 | Liktinstein | Scenario: accept-language parameter and HTTP header Given the HTTP header | accept-language | - | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3 | - When sending json reverse coordinates 18.1147,-15.95 + | fo-ca,fo;q=0.8,en-ca;q=0.5,en;q=0.3 | + When sending json reverse coordinates 47.14,9.55 | accept-language | | en | Then result addresses contain | ID | country | - | 0 | Mauritania | + | 0 | Liechtenstein | diff --git a/test/bdd/api/reverse/params.feature b/test/bdd/api/reverse/params.feature index 2a5821e4..374272d0 100644 --- a/test/bdd/api/reverse/params.feature +++ b/test/bdd/api/reverse/params.feature @@ -3,7 +3,7 @@ Feature: Parameters for Reverse API Testing different parameter options for reverse API. Scenario Outline: Reverse-geocoding without address - When sending reverse coordinates 53.603,10.041 + When sending reverse coordinates 47.13,9.56 | addressdetails | | 0 | Then exactly 1 result is returned @@ -26,7 +26,7 @@ Feature: Parameters for Reverse API | gkjd,50 | Scenario Outline: Reverse Geocoding with extratags - When sending reverse coordinates 10.776234290950017,106.70425325632095 + When sending reverse coordinates 47.1395013150811,9.522098077031046 | extratags | | 1 | Then result 0 has attributes extratags @@ -39,7 +39,7 @@ Feature: Parameters for Reverse API | geojson | Scenario Outline: Reverse Geocoding with namedetails - When sending reverse coordinates 10.776455623137625,106.70175343751907 + When sending reverse coordinates 47.1395013150811,9.522098077031046 | namedetails | | 1 | Then result 0 has attributes namedetails diff --git a/test/bdd/api/reverse/queries.feature b/test/bdd/api/reverse/queries.feature index 8fbe552c..204751a0 100644 --- a/test/bdd/api/reverse/queries.feature +++ b/test/bdd/api/reverse/queries.feature @@ -4,69 +4,55 @@ Feature: Reverse geocoding @Tiger Scenario: TIGER house number - When sending jsonv2 reverse coordinates 45.3345,-97.5214 + When sending jsonv2 reverse coordinates 32.4752389363,-86.4810198619 Then results contain | osm_type | category | type | | way | place | house | And result addresses contain - | house_number | road | postcode | country_code | - | 909 | West 1st Street | 57274 | us | + | house_number | road | postcode | country_code | + | 697 | Upper Kingston Road | 36067 | us | @Tiger Scenario: No TIGER house number for zoom < 18 - When sending jsonv2 reverse coordinates 45.3345,-97.5214 + When sending jsonv2 reverse coordinates 32.4752389363,-86.4810198619 | zoom | | 17 | Then results contain | osm_type | category | | way | highway | And result addresses contain - | road | postcode | country_code | - | West 1st Street | 57274 | us | + | road | postcode | country_code | + | Upper Kingston Road | 30607 | us | Scenario: Interpolated house number - When sending jsonv2 reverse coordinates -33.231795578514635,-54.38682173844428 + When sending jsonv2 reverse coordinates 47.118533,9.57056562 Then results contain | osm_type | category | type | | way | place | house | And result addresses contain | house_number | road | - | 1416 | Juan Antonio Lavalleja | + | 1019 | Grosssteg | Scenario: Address with non-numerical house number - When sending jsonv2 reverse coordinates 53.579805460944,9.9475670458196 + When sending jsonv2 reverse coordinates 47.107465,9.52838521614 Then result addresses contain | house_number | road | - | 43 Haus 4 | Stellinger Weg | + | 39A/B | Dorfstrasse | Scenario: Address with numerical house number - When sending jsonv2 reverse coordinates 53.580206752486,9.9502944945198 + When sending jsonv2 reverse coordinates 47.168440329479594,9.511551699184338 Then result addresses contain | house_number | road | - | 5 | Clasingstraße | - - Scenario: Location off the coast - When sending jsonv2 reverse coordinates 54.046489113,8.5546870529 - Then results contain - | display_name | - | Hamburg, Deutschland | - - Scenario: When slightly outside town, the town is not shown - When sending jsonv2 reverse coordinates -32.122,-56.114 - | zoom | - | 15 | - Then results contain - | display_name | - | Tacuarembó, Uruguay | + | 6 | Schmedgässle | Scenario Outline: Zoom levels below 5 result in country - When sending jsonv2 reverse coordinates -33.28,-56.29 + When sending jsonv2 reverse coordinates 47.16,9.51 | zoom | | | Then results contain | display_name | - | Uruguay | + | Liechtenstein | Examples: | zoom | @@ -77,17 +63,17 @@ Feature: Reverse geocoding | 4 | Scenario: When on a street, the closest interpolation is shown - When sending jsonv2 reverse coordinates -33.2309430210215,-54.38126470020989 + When sending jsonv2 reverse coordinates 47.118457166193245,9.570678289621355 | zoom | | 18 | Then results contain | display_name | - | 1429, Andrés Areguati, Treinta y Tres, 33000, Uruguay | + | 1021, Grosssteg, Sücka, Triesenberg, Oberland, 9497, Liechtenstein | Scenario: When on a street with zoom 18, the closest housenumber is returned - When sending jsonv2 reverse coordinates 53.551826690895226,9.885258475318201 + When sending jsonv2 reverse coordinates 47.11755503977281,9.572722250405036 | zoom | | 18 | Then result addresses contain | house_number | - | 33 | + | 7 | diff --git a/test/bdd/api/reverse/simple.feature b/test/bdd/api/reverse/simple.feature index 9ed530a5..78bd47a7 100644 --- a/test/bdd/api/reverse/simple.feature +++ b/test/bdd/api/reverse/simple.feature @@ -71,10 +71,10 @@ Feature: Simple Reverse Tests | geojson | geojson | Scenario Outline: Boundingbox is returned - When sending reverse coordinates 14.62,108.1 + When sending reverse coordinates 47.11,9.57 | zoom | | 8 | - Then result has bounding box in 9,20,102,113 + Then result has bounding box in 47,48,9,10 Examples: | format | @@ -84,7 +84,7 @@ Feature: Simple Reverse Tests | xml | Scenario Outline: Reverse-geocoding with zoom - When sending reverse coordinates 53.603,10.041 + When sending reverse coordinates 47.11,9.57 | zoom | | 10 | Then exactly 1 result is returned diff --git a/test/bdd/api/search/geocodejson.feature b/test/bdd/api/search/geocodejson.feature index 52c535bb..b0ef92da 100644 --- a/test/bdd/api/search/geocodejson.feature +++ b/test/bdd/api/search/geocodejson.feature @@ -3,10 +3,10 @@ Feature: Parameters for Search API Testing correctness of geocodejson output. Scenario: City housenumber-level address with street - When sending geocodejson search query "Brunnenhofstr 10, Hamburg" with address + When sending geocodejson search query "Im Winkel 8, Triesen" with address Then results contain - | housenumber | street | postcode | city | country | - | 10 | Brunnenhofstraße | 22767 | Hamburg | Deutschland | + | housenumber | street | postcode | city | country | + | 8 | Im Winkel | 9495 | Triesen | Liechtenstein | Scenario: Town street-level address with street When sending geocodejson search query "Gnetsch, Balzers" with address @@ -21,7 +21,7 @@ Feature: Parameters for Search API | Burgweg | Balzers | 9496 | Liechtenstein | Scenario: City address with suburb - When sending geocodejson search query "hinschenfelder str 64, wandsbek" with address + When sending geocodejson search query "Lochgass 5, Ebenholz, Vaduz" with address Then results contain - | housenumber | street | district | city | postcode | country | - | 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland | + | housenumber | street | district | city | postcode | country | + | 5 | Lochgass | Ebenholz | Vaduz | 9490 | Liechtenstein | diff --git a/test/bdd/api/search/language.feature b/test/bdd/api/search/language.feature index 124b9cc6..b76adbef 100644 --- a/test/bdd/api/search/language.feature +++ b/test/bdd/api/search/language.feature @@ -2,61 +2,61 @@ Feature: Localization of search results Scenario: default language - When sending json search query "Vietnam" + When sending json search query "Liechtenstein" Then results contain | ID | display_name | - | 0 | Việt Nam | + | 0 | Liechtenstein | Scenario: accept-language first - When sending json search query "Mauretanien" + When sending json search query "Liechtenstein" | accept-language | - | en,de | + | zh,de | Then results contain | ID | display_name | - | 0 | Mauritania | + | 0 | 列支敦士登 | Scenario: accept-language missing - When sending json search query "Mauretanien" + When sending json search query "Liechtenstein" | accept-language | | xx,fr,en,de | Then results contain | ID | display_name | - | 0 | Mauritanie | + | 0 | Liechtenstein | Scenario: http accept language header first Given the HTTP header | accept-language | - | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3 | - When sending json search query "Mauretanien" + | fo;q=0.8,en-ca;q=0.5,en;q=0.3 | + When sending json search query "Liechtenstein" Then results contain | ID | display_name | - | 0 | Mauritanie | + | 0 | Liktinstein | Scenario: http accept language header and accept-language Given the HTTP header | accept-language | | fr-ca,fr;q=0.8,en-ca;q=0.5,en;q=0.3 | - When sending json search query "Mauretanien" + When sending json search query "Liechtenstein" | accept-language | - | de,en | + | fo,en | Then results contain | ID | display_name | - | 0 | Mauretanien | + | 0 | Liktinstein | Scenario: http accept language header fallback Given the HTTP header | accept-language | - | fr-ca,en-ca;q=0.5 | - When sending json search query "Mauretanien" + | fo-ca,en-ca;q=0.5 | + When sending json search query "Liechtenstein" Then results contain | ID | display_name | - | 0 | Mauritanie | + | 0 | Liktinstein | Scenario: http accept language header fallback (upper case) Given the HTTP header | accept-language | - | fr-FR;q=0.8,en-ca;q=0.5 | - When sending json search query "Mauretanien" + | fo-FR;q=0.8,en-ca;q=0.5 | + When sending json search query "Liechtenstein" Then results contain | ID | display_name | - | 0 | Mauritanie | + | 0 | Liktinstein | diff --git a/test/bdd/api/search/params.feature b/test/bdd/api/search/params.feature index ec8454b0..9c4d1f10 100644 --- a/test/bdd/api/search/params.feature +++ b/test/bdd/api/search/params.feature @@ -25,47 +25,44 @@ Feature: Search queries | x45 | Then a HTTP 400 is returned - Scenario: JSON search with addressdetails - When sending json search query "Montevideo" with address + Scenario Outline: Search with addressdetails + When sending search query "Triesen" with address Then address of result 0 is | type | value | - | city | Montevideo | - | state | Montevideo | - | country | Uruguay | - | country_code | uy | + | village | Triesen | + | county | Oberland | + | postcode | 9495 | + | country | Liechtenstein | + | country_code | li | - Scenario: XML search with addressdetails - When sending xml search query "Aleg" with address - | accept-language | - | en | - Then address of result 0 is - | type | value | - | city | Aleg | - | state | Brakna | - | country | Mauritania | - | country_code | mr | + Examples: + | format | + | json | + | jsonv2 | + | geojson | + | xml | - Scenario: coordinate search with addressdetails - When sending json search query "14.271104294939,107.69828796387" + Scenario: Coordinate search with addressdetails + When sending json search query "47.12400621,9.6047552" | accept-language | | en | Then results contain | display_name | - | Plei Ya Rê, Vietnam | + | Guschg, Valorschstrasse, Balzers, Oberland, 9497, Liechtenstein | Scenario: Address details with unknown class types - When sending json search query "Hundeauslauf, Hamburg" with address + When sending json search query "Kloster St. Elisabeth" with address Then results contain | ID | class | type | - | 0 | leisure | dog_park | + | 0 | amenity | monastery | And result addresses contain - | ID | leisure | - | 0 | Hundeauslauf | + | ID | amenity | + | 0 | Kloster St. Elisabeth | Scenario: Disabling deduplication - When sending json search query "Sievekingsallee, Hamburg" + When sending json search query "Malbunstr" Then there are no duplicates - When sending json search query "Sievekingsallee, Hamburg" + When sending json search query "Malbunstr" | dedupe | | 0 | Then there are duplicates @@ -73,25 +70,32 @@ Feature: Search queries Scenario: Search with bounded viewbox in right area When sending json search query "bar" with address | bounded | viewbox | - | 1 | -56.16786,-34.84061,-56.12525,-34.86526 | + | 1 | 9,47,10,48 | Then result addresses contain - | city | - | Montevideo | + | ID | town | + | 0 | Vaduz | + When sending json search query "bar" with address + | bounded | viewbox | + | 1 | 9.49712,47.17122,9.52605,47.16242 | + Then result addresses contain + | town | + | Schaan | Scenario: Country search with bounded viewbox remain in the area When sending json search query "" with address | bounded | viewbox | country | - | 1 | -56.16786,-34.84061,-56.12525,-34.86526 | de | + | 1 | 9.49712,47.17122,9.52605,47.16242 | de | Then less than 1 result is returned Scenario: Search with bounded viewboxlbrt in right area When sending json search query "bar" with address | bounded | viewboxlbrt | - | 1 | -56.16786,-34.86526,-56.12525,-34.84061 | + | 1 | 9.49712,47.16242,9.52605,47.17122 | Then result addresses contain - | city | - | Montevideo | + | town | + | Schaan | + @Fail Scenario: No POI search with unbounded viewbox When sending json search query "restaurant" | viewbox | @@ -109,22 +113,22 @@ Feature: Search queries Scenario: bounded search remains within viewbox with results When sending json search query "restaurant" | bounded | viewbox | - | 1 | 9.93027,53.61634,10.10073,53.54500 | - Then result has centroid in 53.54500,53.61634,9.93027,10.10073 + | 1 | 9.49712,47.17122,9.52605,47.16242 | + Then result has centroid in 9.49712,47.16242,9.52605,47.17122 Scenario: Prefer results within viewbox - When sending json search query "25 de Mayo" with address + When sending json search query "Gässle" with address | accept-language | | en | Then result addresses contain - | ID | state | - | 0 | Florida | - When sending json search query "25 de Mayo" with address + | ID | town | + | 0 | Balzers | + When sending json search query "Gässle" with address | accept-language | viewbox | - | en | -57.95468,-31.39261,-57.94741,-31.39490 | + | en | 9.52413,47.10759,9.53140,47.10539 | Then result addresses contain - | ID | state | - | 0 | Salto | + | ID | village | + | 0 | Triesen | Scenario: viewboxes cannot be points When sending json search query "foo" @@ -165,7 +169,9 @@ Feature: Search queries Then at most 50 results are returned Scenario: Limit number of search results - When sending json search query "restaurant" + When sending json search query "schloss" + Then more than 4 results are returned + When sending json search query "schloss" | limit | | 4 | Then exactly 4 results are returned @@ -177,11 +183,11 @@ Feature: Search queries Then a HTTP 400 is returned Scenario: Restrict to feature type country - When sending xml search query "Uruguay" + When sending xml search query "fürstentum" Then results contain - | ID | place_rank | - | 1 | 16 | - When sending xml search query "Uruguay" + | ID | class | + | 1 | building | + When sending xml search query "fürstentum" | featureType | | country | Then results contain @@ -189,16 +195,12 @@ Feature: Search queries | 4 | Scenario: Restrict to feature type state - When sending xml search query "Dakota" - Then results contain - | place_rank | - | 12 | - When sending xml search query "Dakota" + When sending xml search query "Wangerberg" + Then more than 1 result is returned + When sending xml search query "Wangerberg" | featureType | | state | - Then results contain - | place_rank | - | 8 | + Then exactly 0 results are returned Scenario: Restrict to feature type city When sending xml search query "vaduz" @@ -213,16 +215,16 @@ Feature: Search queries | 16 | Scenario: Restrict to feature type settlement - When sending json search query "Burg" + When sending json search query "Malbun" Then results contain | ID | class | - | 1 | amenity | - When sending json search query "Burg" + | 1 | landuse | + When sending json search query "Malbun" | featureType | | settlement | Then results contain - | class | type | - | boundary | administrative | + | class | type | + | place | village | Scenario Outline: Search with polygon threshold (json) When sending json search query "switzerland" @@ -265,7 +267,7 @@ Feature: Search queries | 1m | Scenario Outline: Search with extratags - When sending search query "Hauptstr" + When sending search query "Landstr" | extratags | | 1 | Then result has attributes extratags @@ -278,7 +280,7 @@ Feature: Search queries | geojson | Scenario Outline: Search with namedetails - When sending search query "Hauptstr" + When sending search query "Landstr" | namedetails | | 1 | Then result has attributes namedetails @@ -291,7 +293,7 @@ Feature: Search queries | geojson | Scenario Outline: Search result with contains TEXT geometry - When sending search query "Highmore" + When sending search query "triesenberg" | polygon_text | | 1 | Then result has attributes @@ -303,7 +305,7 @@ Feature: Search queries | jsonv2 | geotext | Scenario Outline: Search result contains SVG geometry - When sending search query "Highmore" + When sending search query "triesenberg" | polygon_svg | | 1 | Then result has attributes @@ -315,7 +317,7 @@ Feature: Search queries | jsonv2 | svg | Scenario Outline: Search result contains KML geometry - When sending search query "Highmore" + When sending search query "triesenberg" | polygon_kml | | 1 | Then result has attributes @@ -327,7 +329,7 @@ Feature: Search queries | jsonv2 | geokml | Scenario Outline: Search result contains GEOJSON geometry - When sending search query "Highmore" + When sending search query "triesenberg" | polygon_geojson | | 1 | Then result has attributes @@ -340,7 +342,7 @@ Feature: Search queries | geojson | geojson | Scenario Outline: Search result in geojson format contains no non-geojson geometry - When sending geojson search query "Highmore" + When sending geojson search query "triesenberg" | polygon_text | polygon_svg | polygon_geokml | | 1 | 1 | 1 | Then result 0 has not attributes @@ -353,11 +355,15 @@ Feature: Search queries | geokml | Scenario: Search along a route - When sending json search query "restaurant" with address - | bounded | routewidth | route | - | 1 | 0.1 | -103.23255,44.08198,-103.22516,44.08079 | + When sending json search query "schloss" with address Then result addresses contain - | city | - | Rapid City | + | ID | town | + | 0 | Vaduz | + When sending json search query "schloss" with address + | bounded | routewidth | route | + | 1 | 0.1 | 9.54353,47.11772,9.54314,47.11894 | + Then result addresses contain + | town | + | Triesenberg | diff --git a/test/bdd/api/search/postcode.feature b/test/bdd/api/search/postcode.feature index e70495f6..81836efb 100644 --- a/test/bdd/api/search/postcode.feature +++ b/test/bdd/api/search/postcode.feature @@ -3,10 +3,10 @@ Feature: Searches with postcodes Various searches involving postcodes Scenario: US 5+4 ZIP codes are shortened to 5 ZIP codes if not found - When sending json search query "57701 1111, us" with address + When sending json search query "36067 1111, us" with address Then result addresses contain | postcode | - | 57701 | + | 36067 | Scenario: Postcode search with address When sending json search query "9486, mauren" diff --git a/test/bdd/api/search/queries.feature b/test/bdd/api/search/queries.feature index fea4da41..3a62c581 100644 --- a/test/bdd/api/search/queries.feature +++ b/test/bdd/api/search/queries.feature @@ -3,60 +3,50 @@ Feature: Search queries Generic search result correctness Scenario: House number search for non-street address - When sending json search query "2 Steinwald, Austria" with address + When sending json search query "6 Silum, Liechtenstein" with address | accept-language | | en | Then address of result 0 is | type | value | - | house_number | 2 | - | hamlet | Steinwald | - | village | Göfis | - | postcode | 6811 | - | country | Austria | - | country_code | at | - - Scenario: House number interpolation even - When sending json search query "Schellingstr 86, Hamburg" with address + | house_number | 6 | + | village | Silum | + | town | Triesenberg | + | county | Oberland | + | postcode | 9497 | + | country | Liechtenstein | + | country_code | li | + + Scenario: House number interpolation + When sending json search query "Grosssteg 1023, Triesenberg" with address | accept-language | | de | Then address of result 0 contains | type | value | - | house_number | 86 | - | road | Schellingstraße | - | postcode | 22089 | - | city | Hamburg | - | country | Deutschland | - | country_code | de | - - Scenario: House number interpolation odd - When sending json search query "Schellingstr 73, Hamburg" with address - | accept-language | - | de | - Then address of result 0 contains - | type | value | - | house_number | 73 | - | road | Schellingstraße | - | postcode | 22089 | - | city | Hamburg | - | country | Deutschland | - | country_code | de | + | house_number | 1023 | + | road | Grosssteg | + | village | Sücka | + | postcode | 9497 | + | town | Triesenberg | + | country | Liechtenstein | + | country_code | li | Scenario: With missing housenumber search falls back to road - When sending json search query "342 rocha, santa lucia" with address + When sending json search query "Bündaweg 555" with address Then address of result 0 is - | type | value | - | road | Rocha | - | city | Santa Lucía | - | state | Canelones | - | postcode | 90700 | - | country | Uruguay | - | country_code | uy | + | type | value | + | road | Bündaweg | + | village | Silum | + | postcode | 9497 | + | county | Oberland | + | town | Triesenberg | + | country | Liechtenstein | + | country_code | li | Scenario Outline: Housenumber 0 can be found - When sending search query "Pham Hung Road 0" with address + When sending search query "Gnalpstrasse 0" with address Then results contain | display_name | - | ^.*, 0,.* | + | ^0,.* | And result addresses contain | house_number | | 0 | @@ -70,10 +60,10 @@ Feature: Search queries @Tiger Scenario: TIGER house number - When sending json search query "323 22nd Street Southwest, Huron" + When sending json search query "697 Upper Kingston Road" Then results contain - | osm_type | - | way | + | osm_type | display_name | + | way | ^697,.* | Scenario: Search with class-type feature When sending jsonv2 search query "Hotel in California" @@ -91,19 +81,17 @@ Feature: Search queries | amenity | restaurant | Scenario: Search with key-value amenity - When sending json search query "[shop=hifi] hamburg" + When sending json search query "[club=scout] Vaduz" Then results contain | class | type | - | shop | hifi | + | club | scout | Scenario: With multiple amenity search only the first is used - When sending json search query "[shop=hifi] [church] hamburg" + When sending json search query "[club=scout] [church] vaduz" Then results contain | class | type | - | shop | hifi | - - Scenario: With multiple amenity search only the first is used - When sending json search query "[church] [restaurant] hamburg" + | club | scout | + When sending json search query "[amenity=place_of_worship] [club=scout] vaduz" Then results contain | class | type | | amenity | place_of_worship | @@ -115,30 +103,36 @@ Feature: Search queries | amenity | restaurant | Scenario: Arbitrary key/value search near given coordinate - When sending json search query "[man_made=mast] 47.15739° N 9.61264° E" + When sending json search query "[leisure=firepit] 47.150° N 9.5340493° E" Then results contain - | class | type | - | man_made | mast | + | class | type | + | leisure | firepit | Scenario: Arbitrary key/value search near given coordinate and named place - When sending json search query "[man_made=mast] amerlugalpe 47° 9′ 26″ N 9° 36′ 45″ E" + When sending json search query "[leisure=firepit] ebenholz 47° 9′ 26″ N 9° 36′ 45″ E" Then results contain | class | type | - | man_made | mast | + | leisure | firepit | Scenario: Name search near given coordinate - When sending json search query "amerlugalpe, N 47.15739° E 9.61264°" - Then exactly 1 result is returned + When sending json search query "sporry" with address + Then result addresses contain + | ID | town | + | 0 | Vaduz | + When sending json search query "sporry, 47.10791,9.52676" with address + Then result addresses contain + | ID | village | + | 0 | Triesen | Scenario: Name search near given coordinate without result - When sending json search query "amerlugalpe, N 47 15 7 W 9 61 26" + When sending json search query "sporry, N 47 15 7 W 9 61 26" Then exactly 0 results are returned Scenario: Arbitrary key/value search near a road - When sending json search query "[leisure=table_soccer_table] immenbusch" + When sending json search query "[amenity=drinking_water] Wissfläckaweg" Then results contain | class | type | - | leisure | table_soccer_table | + | amenity | drinking_water | Scenario: Ignore other country codes in structured search with country When sending json search query "" @@ -154,29 +148,29 @@ Feature: Search queries # https://trac.openstreetmap.org/ticket/5094 Scenario: housenumbers are ordered by complete match first - When sending json search query "6395 geminis, montevideo" with address + When sending json search query "Austrasse 11, Vaduz" with address Then result addresses contain | ID | house_number | - | 0 | 6395 | - | 1 | 6395 BIS | + | 0 | 11 | + | 1 | 11 a | - Scenario Outline: Same Searches with white spaces + Scenario Outline: Coordinate searches with white spaces When sending json search query "" Then exactly 1 result is returned And results contain | class | - | building | + | natural | Examples: | data | - | amerlugalpe, N 47.15739° E 9.61264° | - | amerlugalpe, N 47.15739° E 9.61264° | - | amerlugalpe , N 47.15739° E 9.61264° | - | amerlugalpe, N 47.15739° E 9.61264° | - | amerlugalpe , N 47.15739° E 9.61264° | - - Scenario: Searched with white spaces - When sending json search query "22nd Street Southwest , Huron" + | sporry weiher, N 47.10791° E 9.52676° | + | sporry weiher, N 47.10791° E 9.52676° | + | sporry weiher , N 47.10791° E 9.52676° | + | sporry weiher, N 47.10791° E 9.52676° | + | sporry weiher , N 47.10791° E 9.52676° | + + Scenario: Searches with white spaces + When sending json search query "52 Bodastr , Triesenberg" Then results contain | class | type | | highway | residential | @@ -184,7 +178,7 @@ Feature: Search queries # github #1949 Scenario: Addressdetails always return the place type - When sending json search query "Rotherbaum" with address + When sending json search query "Vaduz" with address Then result addresses contain - | ID | suburb | - | 0 | Rotherbaum | + | ID | town | + | 0 | Vaduz | diff --git a/test/bdd/api/search/simple.feature b/test/bdd/api/search/simple.feature index 50aa03b7..603627b1 100644 --- a/test/bdd/api/search/simple.feature +++ b/test/bdd/api/search/simple.feature @@ -3,27 +3,27 @@ Feature: Simple Tests Simple tests for internal server errors and response format. Scenario Outline: Testing different parameters - When sending search query "Hamburg" + When sending search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending xml search query "Hamburg" + When sending xml search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending json search query "Hamburg" + When sending json search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending jsonv2 search query "Hamburg" + When sending jsonv2 search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending geojson search query "Hamburg" + When sending geojson search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending geocodejson search query "Hamburg" + When sending geocodejson search query "Vaduz" | param | value | | | | Then at least 1 result is returned @@ -41,7 +41,7 @@ Feature: Simple Tests | polygon_svg | 1 | | polygon_svg | 0 | | accept-language | de,en | - | countrycodes | de | + | countrycodes | li | | bounded | 1 | | bounded | 0 | | exclude_place_ids| 385252,1234515 | diff --git a/test/bdd/api/search/structured.feature b/test/bdd/api/search/structured.feature index e94cd4cc..f8044dad 100644 --- a/test/bdd/api/search/structured.feature +++ b/test/bdd/api/search/structured.feature @@ -15,13 +15,13 @@ Feature: Structured search queries Scenario: Postcode only When sending json search query "" with address | postalcode | - | 22547 | + | 9495 | Then results contain | type | | ^post(al_)?code | And result addresses contain | postcode | - | 22547 | + | 9495 | Scenario: Street, postcode and country When sending xml search query "" with address @@ -50,16 +50,19 @@ Feature: Structured search queries Scenario: Amenity, city When sending json search query "" with address | city | amenity | - | Vaduz | church | + | Vaduz | bar | Then result addresses contain | country | | Liechtenstein | And results contain | class | type | - | amenity | place_of_worship | + | amenity | ^(pub)\|(bar) | - Scenario: gihub #176 + #176 + Scenario: Structured search restricts rank When sending json search query "" with address | city | - | Mercedes | - Then at least 1 result is returned + | Vaduz | + Then result addresses contain + | town | + | Vaduz | diff --git a/test/bdd/db/query/search_simple.feature b/test/bdd/db/query/search_simple.feature index 409ed44f..daf83cea 100644 --- a/test/bdd/db/query/search_simple.feature +++ b/test/bdd/db/query/search_simple.feature @@ -32,3 +32,18 @@ Feature: Searching of simple objects Then results contain | ID | osm_type | osm_id | | 0 | R | 1 | + + # github #1763 + Scenario: Correct translation of highways under construction + Given the grid + | 1 | | | | 2 | + | | | 9 | | | + And the places + | osm | class | type | name | geometry | + | W1 | highway | construction | The build | 1,2 | + | N1 | amenity | cafe | Bean | 9 | + When importing + And sending json search query "Bean" with address + Then result addresses contain + | amenity | road | + | Bean | The build |