This page details the comprehensive test coverage provided by the Postman collection, describing what aspects of the API specification are validated, what types of assertions are performed, and how the test suite ensures complete specification compliance. For information on the collection's architecture and organization, see Postman Collection Architecture. For instructions on executing the test suite, see Running API Tests.
The Postman collection provides comprehensive validation of all API endpoints defined in the OpenAPI specification. The test suite executes 29 distinct test requests that collectively validate all 15 core endpoints across multiple scenarios, including success cases, error cases, authentication flows, filtering, pagination, and stateful operations.
Sources: api/Conduit.postman_collection.json1-8 api/openapi.yml1-19
The following table shows the complete mapping of OpenAPI specification endpoints to test coverage:
| Endpoint | Method | Test Cases | Auth Required | Coverage |
|---|---|---|---|---|
/users | POST | Register | No | ✓ Full |
/users/login | POST | Login, Login and Remember Token | No | ✓ Full |
/user | GET | Current User, Verify Update User Persisted | Yes | ✓ Full |
/user | PUT | Update User | Yes | ✓ Full |
/profiles/{username} | GET | Get Profile | Optional | ✓ Full |
/profiles/{username}/follow | POST | Follow User | Yes | ✓ Full |
/profiles/{username}/follow | DELETE | Unfollow User | Yes | ✓ Full |
/articles | GET | All Articles (4 variants), Articles with auth | Optional | ✓ Full + Filters |
/articles | POST | Create Article, Create Second Article | Yes | ✓ Full |
/articles/feed | GET | Feed | Yes | ✓ Full |
/articles/{slug} | GET | Single Article by slug | Optional | ✓ Full |
/articles/{slug} | PUT | Update Article | Yes | ✓ Full |
/articles/{slug} | DELETE | Delete Article, Delete Second Article | Yes | ✓ Full |
/articles/{slug}/favorite | POST | Favorite Article | Yes | ✓ Full |
/articles/{slug}/favorite | DELETE | Unfavorite Article | Yes | ✓ Full |
/articles/{slug}/comments | GET | All Comments for Article | Optional | ✓ Full |
/articles/{slug}/comments | POST | Create Comment for Article | Yes | ✓ Full |
/articles/{slug}/comments/{id} | DELETE | Delete Comment | Yes | ✓ Full |
/tags | GET | All Tags | No | ✓ Full |
Sources: api/Conduit.postman_collection.json8-1201 api/openapi.yml21-453
Every test validates that responses contain the expected properties as defined in the OpenAPI schema. These assertions verify the presence and structure of response objects.
Example Assertions:
Sources: api/Conduit.postman_collection.json16-35 api/openapi.yml481-541
Tests verify that data types match the specification using JavaScript type checking functions:
| Field | Type Check | Example Assertion |
|---|---|---|
articlesCount | Integer | Number.isInteger(responseJSON.articlesCount) |
favoritesCount | Integer | Number.isInteger(article.favoritesCount) |
tagList | Array | Array.isArray(article.tagList) |
comments | Array | Array.isArray(responseJSON.comments) |
id | Integer | Number.isInteger(comment.id) |
Example Implementation: api/Conduit.postman_collection.json365-382
Sources: api/Conduit.postman_collection.json365-382 api/openapi.yml575-576
All timestamp fields are validated against the ISO 8601 format using regular expression matching:
This pattern validates both createdAt and updatedAt fields on articles and comments.
Example: api/Conduit.postman_collection.json373-375
Sources: api/Conduit.postman_collection.json373-375 api/openapi.yml567-572
Tests validate appropriate HTTP status codes for success and error scenarios:
| Status Code | Scenarios | Example Test |
|---|---|---|
| 200 | Successful GET, PUT, POST (non-creation) | Login, Update User, Favorite |
| 201 | Resource creation | Register, Create Article |
| 204 | Successful deletion | Delete Article, Delete Comment |
| 401 | Authentication failure | Missing/invalid token |
| 404 | Resource not found | Non-existent article/profile |
| 422 | Validation error | Invalid request body |
Example: api/Conduit.postman_collection.json331-333
Sources: api/Conduit.postman_collection.json331-333 api/openapi.yml31-37
Test Sequence:
Sources: api/Conduit.postman_collection.json12-342 api/openapi.yml22-88
Test Coverage:
Sources: api/Conduit.postman_collection.json660-1605 api/openapi.yml214-310
Test Coverage:
Sources: api/Conduit.postman_collection.json1262-1436 api/openapi.yml310-392
Test Coverage:
Sources: api/Conduit.postman_collection.json1202-1758 api/openapi.yml393-441
The test suite validates all query parameters defined in the OpenAPI specification for the GET /articles endpoint.
| Parameter | Test Case | Expected Behavior |
|---|---|---|
author | Articles by Author | Filters by username |
favorited | Articles Favorited by Username | Filters by user's favorites |
tag | Articles by Tag | Filters by tag name |
limit | All Articles with limit | Limits result count |
offset | All Articles with offset | Skips specified count |
Test Implementations:
Sources: api/Conduit.postman_collection.json421-875 api/openapi.yml189-207
Critical tests ensure correct pagination semantics where articlesCount represents the total count, not the page size:
Key Assertions:
Implementation: api/Conduit.postman_collection.json782-875
Sources: api/Conduit.postman_collection.json782-875 api/openapi.yml890-907
The test suite includes validation of error responses, though coverage focuses primarily on success paths. Error cases validated include:
This validates that DELETE operations return either 204 (No Content) or 200 (OK) per the specification.
Example: api/Conduit.postman_collection.json884
Tests implicitly validate authentication by executing protected endpoints with the Authorization: Token {{token}} header. Any test without this header on a protected endpoint would receive a 401 response.
Protected Endpoint Tests:
Sources: api/Conduit.postman_collection.json214-972 api/openapi.yml69-70
The collection maintains state across requests using Postman's global variables mechanism, enabling complex workflows that depend on previous test results.
| Variable | Set By | Used By | Purpose |
|---|---|---|---|
token | Login and Remember Token | All authenticated requests | JWT authentication |
slug | Create Article | Single Article, Update Article, Create Comment, etc. | Article identifier |
slug2 | Create Second Article | Delete Second Article | Second article identifier |
commentId | Create Comment | Delete Comment | Comment identifier |
Token Storage: api/Conduit.postman_collection.json140-144 Slug Storage: api/Conduit.postman_collection.json676 Comment ID Storage: api/Conduit.postman_collection.json1314-1320
Sources: api/Conduit.postman_collection.json140-144 api/Conduit.postman_collection.json676 api/Conduit.postman_collection.json1314-1320
The test suite includes validation for edge cases and empty result sets:
This pattern ensures that when no articles are returned, the count correctly reflects zero rather than causing test failures.
Implementation: api/Conduit.postman_collection.json383-385
Some tests include conditional execution based on environment flags:
This allows certain tests to be skipped in integration test environments.
Example: api/Conduit.postman_collection.json20
Sources: api/Conduit.postman_collection.json20 api/Conduit.postman_collection.json383-385
The test suite ensures specification compliance through multiple validation layers:
Every test validates that response structures match the OpenAPI schema definitions:
Schema References:
Sources: api/openapi.yml481-625 api/Conduit.postman_collection.json23-31
Each test validates the complete contract for its endpoint:
Tests validate the authentication mechanism defined in the specification:
Token xxxxxx.yyyyyyy.zzzzzz in Authorization headerSpecification Reference: api/openapi.yml909-918
Sources: api/openapi.yml909-918 api/Conduit.postman_collection.json214-217
The test suite provides:
This comprehensive coverage ensures that any backend implementation passing the test suite is fully compliant with the RealWorld API specification.
Sources: api/Conduit.postman_collection.json1-1201 api/openapi.yml1-919 api/README.md1-12
Refresh this wiki