Created
July 10, 2023 08:31
-
-
Save PramodDutta/8d49ca0892e6ddeab8aabc333070a02e to your computer and use it in GitHub Desktop.
API Testcase for Zip Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sure, here are 15 test cases in table format: | |
| | Test Case No | Test Case Description | Input | Expected Output | | |
| |--------------|----------------------|-------|-----------------| | |
| | 1 | Verify response for valid zip code | api.zippopotam.us/IN/110001 | 200 OK, {"post code": "110001", "country": "India", "country abbreviation": "IN", "places": ... } | | |
| | 2 | Verify response for invalid zip code | api.zippopotam.us/IN/999999 | 404 Not Found | | |
| | 3 | Verify response for invalid country abbreviation | api.zippopotam.us/XYZ/110001 | 404 Not Found | | |
| | 4 | Verify response for country with no zip code | api.zippopotam.us/IN/ | 400 Bad Request | | |
| | 5 | Verify response for valid zip code, case insensitivity in country code | api.zippopotam.us/in/110001 | 200 OK, {"post code": "110001", "country": "India", "country abbreviation": "IN", "places": ... } | | |
| | 6 | Verify response with additional parameters (should be ignored) | api.zippopotam.us/IN/110001?param1=test | 200 OK, {"post code": "110001", "country": "India", "country abbreviation": "IN", "places": ... } | | |
| | 7 | Verify response for special characters in zip code | api.zippopotam.us/IN/1100%26%261 | 400 Bad Request | | |
| | 8 | Verify response for zip code with spaces | api.zippopotam.us/IN/1100 01 | 400 Bad Request | | |
| | 9 | Verify response for zip code with leading zero | api.zippopotam.us/IN/0110001 | 404 Not Found | | |
| | 10 | Verify response for non-existent country | api.zippopotam.us/XX/110001 | 404 Not Found | | |
| | 11 | Verify response for country abbreviation longer than 2 letters | api.zippopotam.us/IND/110001 | 404 Not Found | | |
| | 12 | Verify response for no country and zip code | api.zippopotam.us// | 400 Bad Request | | |
| | 13 | Verify response for zip code in path as a query parameter | api.zippopotam.us/IN/?postcode=110001 | 400 Bad Request | | |
| | 14 | Verify response for longer than expected zip code | api.zippopotam.us/IN/110001123 | 404 Not Found | | |
| | 15 | Verify response for valid zip code in another country | api.zippopotam.us/US/110001 | 404 Not Found | | |
| Please note that the response codes and the responses can vary depending on the actual implementation of the API. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment