X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d18bd14045ef31342a8af5834f760532ef9d7487..8f299838f756045e2340a38d56a5dfe99d3f6196:/test/bdd/api/search/simple.feature diff --git a/test/bdd/api/search/simple.feature b/test/bdd/api/search/simple.feature index b986d8a7..11cd4801 100644 --- a/test/bdd/api/search/simple.feature +++ b/test/bdd/api/search/simple.feature @@ -3,52 +3,47 @@ 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 html search query "Hamburg" + When sending xml search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending xml search query "Hamburg" + When sending json search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending json search query "Hamburg" + When sending jsonv2 search query "Vaduz" | param | value | | | | Then at least 1 result is returned - When sending jsonv2 search query "Hamburg" + When sending geojson search query "Vaduz" + | param | value | + | | | + Then at least 1 result is returned + When sending geocodejson search query "Vaduz" | param | value | | | | Then at least 1 result is returned Examples: | parameter | value | - | addressdetails | 1 | | addressdetails | 0 | - | polygon | 1 | - | polygon | 0 | - | polygon_text | 1 | | polygon_text | 0 | - | polygon_kml | 1 | | polygon_kml | 0 | - | polygon_geojson | 1 | | polygon_geojson | 0 | - | polygon_svg | 1 | | polygon_svg | 0 | | accept-language | de,en | - | countrycodes | de | + | countrycodes | li | | bounded | 1 | | bounded | 0 | | exclude_place_ids| 385252,1234515 | | limit | 1000 | | dedupe | 1 | | dedupe | 0 | - | extratags | 1 | | extratags | 0 | - | namedetails | 1 | | namedetails | 0 | Scenario: Search with invalid output format @@ -59,15 +54,15 @@ Feature: Simple Tests Scenario Outline: Simple Searches When sending search query "" - Then the result is valid html - When sending html search query "" - Then the result is valid html + Then the result is valid json When sending xml search query "" Then the result is valid xml When sending json search query "" Then the result is valid json When sending jsonv2 search query "" Then the result is valid json + When sending geojson search query "" + Then the result is valid geojson Examples: | query | @@ -88,26 +83,23 @@ Feature: Simple Tests Then result header contains | attr | value | | querystring | xnznxvcx | - | polygon | false | - | more_url | .*format=xml.*q=xnznxvcx.* | + | more_url | .*q=xnznxvcx.*format=xml | Scenario: Empty XML search with special XML characters When sending xml search query "xfdghn&zxn"xvbyxcssdex" Then result header contains | attr | value | | querystring | xfdghn&zxn"xvbyxcssdex | - | polygon | false | - | more_url | .*format=xml.*q=xfdghn%26zxn%22xvbyx%3Cvxx%3Ecssdex.* | + | more_url | .*q=xfdghn%26zxn%22xvbyx%3Cvxx%3Ecssdex.*format=xml | Scenario: Empty XML search with viewbox When sending xml search query "xnznxvcx" | viewbox | - | 12,45.13,77,33 | + | 12,33,77,45.13 | Then result header contains | attr | value | | querystring | xnznxvcx | - | polygon | false | - | viewbox | 12,45.13,77,33 | + | viewbox | 12,33,77,45.13 | Scenario: Empty XML search with viewboxlbrt When sending xml search query "xnznxvcx" @@ -116,38 +108,16 @@ Feature: Simple Tests Then result header contains | attr | value | | querystring | xnznxvcx | - | polygon | false | - | viewbox | 12,45,77,34.13 | + | viewbox | 12,34.13,77,45 | Scenario: Empty XML search with viewboxlbrt and viewbox When sending xml search query "pub" | viewbox | viewboxblrt | - | 12,45.13,77,33 | 1,2,3,4 | + | 12,33,77,45.13 | 1,2,3,4 | Then result header contains | attr | value | | querystring | pub | - | polygon | false | - | viewbox | 12,45.13,77,33 | - - Scenario Outline: Empty XML search with polygon values - When sending xml search query "xnznxvcx" - | param | value | - | polygon | | - Then result header contains - | attr | value | - | polygon | | - - Examples: - | result | polyval | - | false | 0 | - | true | 1 | - | true | True | - | true | true | - | true | false | - | true | FALSE | - | true | yes | - | true | no | - | true | '; delete from foobar; select ' | + | viewbox | 12,33,77,45.13 | Scenario: Empty XML search with exluded place ids When sending xml search query "jghrleoxsbwjer" @@ -176,15 +146,12 @@ Feature: Simple Tests | foo | foo | | FOO | FOO | | __world | __world | - | $me | \$me | - | m1[4] | m1\[4\] | - | d_r[$d] | d_r\[\$d\] | Scenario Outline: Wrapping of illegal jsonp search requests When sending json search query "Tokyo" | param | value | |json_callback | | - Then a HTTP 400 is returned + Then a json user error is returned Examples: | data | @@ -202,18 +169,17 @@ Feature: Simple Tests | json_callback | | 234 | Then the result is valid xml - When sending html search query "Malibu" - | json_callback | - | 234 | - Then the result is valid html - Scenario: Empty JSON search - When sending json search query "YHlERzzx" + Scenario Outline: Empty search + When sending search query "YHlERzzx" Then exactly 0 results are returned - Scenario: Empty JSONv2 search - When sending jsonv2 search query "Flubb XdfESSaZx" - Then exactly 0 results are returned + Examples: + | format | + | json | + | jsonv2 | + | geojson | + | geocodejson | Scenario: Search for non-existing coordinates When sending json search query "-21.0,-33.0" @@ -223,6 +189,19 @@ Feature: Simple Tests When sending xml search query "Vaduz" | countrycodes | | pl,1,,invalid,undefined,%3Cb%3E,bo,, | - Then result header contains + Then result header contains | attr | value | - | more_url | .*&countrycodes=pl,bo&.* | + | more_url | .*&countrycodes=pl%2Cbo&.* | + + Scenario Outline: Search debug output does not return errors + When sending debug search query "" + Then a HTTP 200 is returned + + Examples: + | query | + | Liechtenstein | + | Triesen | + | Pfarrkirche | + | Landstr 27 Steinort, Triesenberg, 9495 | + | 9497 | + | restaurant in triesen |