Skip to content

Latest commit

 

History

History
155 lines (130 loc) · 9.57 KB

TESTING.md

File metadata and controls

155 lines (130 loc) · 9.57 KB

Travel Tickr API

The testing.md file provides an overview of the testing conducted on Travel Tickr webapp. It covers code validation, accessibility, performance, testing on various devices, browser compatibility, testing user stories, and user feedback and improvements. Each section describes the tools used, the issues found (if any), and the corresponding test results.

Table of Content

  1. Code Validation
  2. Automated testing
  3. Manual testing
  4. Summary

Code Validation

PEP 8 is a style guide for writing Python code to ensure consistency and readability. It provides guidelines on how to format code, naming conventions for variables and functions, and other best practices. Following PEP 8 helps to improve code quality, readability, and maintainability.

backend

Tested Result View Result Pass
serializers No errors Result
settings No errors Result
urls No errors Result
views No errors Result

Bucketlist

Tested Result View Result Pass
models No errors Result
serializers No errors Result
urls No errors Result
views No errors Result

Comments

Tested Result View Result Pass
models No errors Result
serializers No errors Result
urls No errors Result
views No errors Result

Followers

Tested Result View Result Pass
models No errors Result
merializers Result
urls No errors Result
views No errors Result

Likes

Tested Result View Result Pass
models No errors Result
merializers No errors Result
urls No errors Result
views No errors Result

Posts

Tested Result View Result Pass
models No errors Result
serializers No errors Result
tests No errors Result
urls No errors Result
views No errors Result

Travelers

Tested Result View Result Pass
models No errors Result
serializers No errors Result
tests No errors Result
urls No errors Result
views No errors Result

Note: The specific details and validation results for each file can be viewed by expanding the corresponding sections.

Automated testing

The application have used some automated testing to ensure the functionality of the Post API endpoints as well as the consistent extension of teh User model with the Traveler model. Her is an overview of the tests:

Post Listing: To verify that the API correctly lists the posts available. Post Creation: To check whether an authenticated user can successfully create a post. Unauthorized Post Creation: To ensure that unauthenticated users are not allowed to create posts. Post Retrieval: The test verify that posts can be retrieved using valid identifiers. Additionally, it will check that the system correctly handles retrieval requests for non-existent posts. Post Updates: To confirm that a user can update their own posts, and importantly, they cannot modify other user's posts. User-Traveler Consistency: We run tests to confirm that each user is always extended with the Traveler model.

To run the tests, navigate to the main directory of the project and execute the following command in the terminal:

python manage.py test 

Upon successful execution of the tests, you should see output similar to the following:

Creating test database for alias 'default'...
System check identified no issues (0 silenced).
....OrderedDict([('count', 1), ('next', None), ('previous', None), ('results', [OrderedDict([('id', 1), ('owner', 'testUser'), ('is_owner', False), ('traveler_id', 1), ('traveler_image', 'https://res.cloudinary.com/sandrabergstrom/image/upload/v1/media/../default_profile_uwgpte'), ('created_at', 'now'), ('updated_at', 'now'), ('title', 'test title'), ('content', ''), ('image', 'https://res.cloudinary.com/sandrabergstrom/image/upload/v1/media/../default_post_rgq6aq'), ('likes_count', 0), ('comments_count', 0), ('like_id', None), ('bucketlists_count', 0), ('bucketlist_id', None), ('location', 'Somewhere'), ('country', 'Unknown')])])])
4
....
----------------------------------------------------------------------
Ran 8 tests in 1.077s

OK
Destroying test database for alias 'default'...

This signifies that all tests have passed successfully. If any test fails, the output will clearly specify which test failed and the reason to failure. If you see an output similar to the above, it means your setup is working as expected.

Manual testing

During the manual testing of the API, the following steps were performed:

  1. Ensured that all URL paths were created correctly and functioning without any errors.
  2. Verification of CRUD Functionality:
  • Verified the functionality of Create, Read, Update, and Delete operations for various entities such as posts, bucketlists, comments, followers, likes, and travelers
  • Created new items and confirmed the proper functioning of the corresponding URLs
  • Verified the Edit functionality (excluding followers and likes).
  • Tested the delete function to ensure its correctness.
  • Check delete function
  1. Validation of Post Search Functionality:
  • Tested the search functionality specifically for posts.
  • Ensured that the search feature for posts was functioning as expected.

These manual testing steps were undertaken to validate the correct functioning and behavior of the API.

URL Testing

Tested Expected result Result Pass
Root URL Show welcome message Works as expected
/bucketlist Display bucketslist Works as expected
/bucketlist/{id} Display bucketlist detail Works as expected
/posts Display posts list Works as expected
/posts/{id} Display posts detail Works as expected
/comments Display comments list Works as expected
/comments/{id} Display comment detail Works as expected
/likes Display likes list Works as expected
/likes/{id} Display like detail Works as expected
/travelers Display travelers list Works as expected
/travelers/{id} Display traveler detail Works as expected
/followers Display followers list Works as expected
/followers/{id} Display follower detail Works as expected

CRUD functionality

Tested Create View Update Delete
Bucketlist -
Post
Comment
Like -
Follow -
Traveler

Search functionality

  • Searching for Title, Traveler and Country is working as expected.

Summary

The testing process for the Travel Tickr API has been exhaustive and meticulous, reinforcing the robustness and reliability of the platform. Python's best coding practices were upheld by utilizing the PEP 8 tool to check for errors in each application module.

Automated testing has been a critical part of the process, covering key functionalities such as post listing, post creation, post retrieval, post updates, and user-traveler consistency.

All tests for the Travel Tickr API have been passed, demonstrating its readiness for deployment and public use. For a detailed account of the front-end testing, please click here.