Skip to content

Latest commit

 

History

History
187 lines (128 loc) · 17.3 KB

File metadata and controls

187 lines (128 loc) · 17.3 KB

Testing

Note

Return back to the README.md file.

Code Validation

HTML

I have used the recommended HTML W3C Validator to validate all of my HTML files.

Directory File Screenshot
connections discover.html screenshot
connections liked_profiles.html screenshot
connections matches.html screenshot
dating about.html screenshot
dating contact.html screenshot
dating index.html screenshot
dating profile_delete.html screenshot
dating profile_detail.html screenshot
dating profile_form.html screenshot
templates 404.html screenshot
templates login.html screenshot
templates logout.html screenshot
templates signup.html screenshot

CSS

I have used the recommended CSS Jigsaw Validator to validate all of my CSS files.

Directory File Screenshot
static style.css screenshot

JavaScript

I have used the recommended JShint Validator to validate all of my JS files.

Directory File URL Screenshot
static script.js screenshot

Python

I have used the recommended PEP8 CI Python Linter to validate all of my Python files.

Directory File URL Screenshot
connections admin.py PEP8 CI Link screenshot
connections models.py PEP8 CI Link screenshot
connections services.py PEP8 CI Link screenshot
connections signals.py PEP8 CI Link screenshot
connections tests.py PEP8 CI Link screenshot
connections urls.py PEP8 CI Link screenshot
connections views.py PEP8 CI Link screenshot
dating admin.py PEP8 CI Link screenshot
dating models.py PEP8 CI Link screenshot
dating tests.py PEP8 CI Link screenshot
dating urls.py PEP8 CI Link screenshot
dating views.py PEP8 CI Link screenshot
manage.py PEP8 CI Link screenshot
match_up settings.py PEP8 CI Link screenshot
match_up urls.py PEP8 CI Link screenshot

Lighthouse Audit

I've tested my deployed project using the Lighthouse Audit tool to check for any major issues. Some warnings are outside of my control, and mobile results tend to be lower than desktop.

Page Mobile Desktop
Register screenshot screenshot
Login screenshot screenshot
Home screenshot screenshot
Profile-detail screenshot screenshot
Discover screenshot screenshot
Liked-profiles screenshot screenshot
Matches screenshot screenshot

Defensive Programming

Defensive programming was manually tested with the below user acceptance testing:

Page/Feature Expectation Test Result Screenshot
Profile Creation Feature is expected to prevent creating duplicate profiles for the same user. Attempted to create a second profile for an existing user. Error message displayed: "You already have a profile." Profile creation was prevented. -
Feature is expected to validate profile data (age must be 18+, bio minimum length, etc.). Submitted profile form with invalid data (age < 18, bio too short). Validation errors displayed for each invalid field. Profile was not created. screenshot
Feature is expected to handle database transaction errors gracefully. Simulated database integrity error during profile creation. Transaction was rolled back cleanly. User-friendly error message displayed. -
Profile Management Feature is expected to require authentication before accessing profile pages. Attempted to access profile edit page without logging in. User was redirected to login page. Access was denied. -
Feature is expected to check if profile exists before allowing edit/delete. Attempted to edit profile when no profile exists. User was redirected to profile creation page. -
Feature is expected to only allow users to edit/delete their own profile. Attempted to access another user's profile edit URL. Access was denied. User could only access their own profile. -
Like/Pass Actions Feature is expected to prevent users from liking their own profile. Attempted to like own profile. Error message displayed: "Cannot like your own profile." Action was prevented. -
Feature is expected to require user to have a profile before liking others. Attempted to like a profile without having created own profile. Error message displayed: "You must create a profile first." Action was prevented. -
Feature is expected to handle non-existent profile IDs gracefully. Attempted to like a profile with invalid/non-existent ID. 404 error page displayed. Action was prevented. screenshot
Discover Page Feature is expected to redirect unauthenticated users to login. Attempted to access discover page without logging in. User was redirected to login page. Access was denied. -
Feature is expected to redirect users without profiles to profile creation. Attempted to access discover page without creating profile. User was redirected to profile creation page. screenshot
Feature is expected to exclude already interacted profiles from the feed. Viewed discover page after liking/passing on several profiles. Previously interacted profiles were excluded from the feed. -
Matches Page Feature is expected to only show active matches for the current user. Viewed matches page with both active and inactive matches. Only active matches were displayed. Inactive matches were filtered out. -
User Authentication Feature is expected to validate login credentials. Attempted to log in with invalid credentials. Login was rejected. Error message displayed. screenshot
Feature is expected to prevent access to protected pages after logout. Logged out and attempted to access a protected page (e.g., discover). User was redirected to login page. Access was denied. screenshot
Feature is expected to handle duplicate username/email during registration. Attempted to register with an existing username or email. Registration was rejected. Error message displayed indicating the field already exists. screenshot
404 Error Page Feature is expected to display a custom 404 error page for non-existent pages. Navigated to an invalid URL (e.g., /profile/99999/). Custom 404 error page was displayed with navigation options. screenshot
Admin Access Feature is expected to block non-admin users from accessing admin pages. Attempted to navigate to admin-only pages by manipulating the URL (e.g., /admin). Access was blocked. Login page or access denied message displayed. -

User Story Testing

All user stories from the project have been manually tested to ensure they meet the acceptance criteria. Below are the test results for each user story.

Target Expectation Outcome Screenshot
As a guest user I would like to view the home page so that I can understand what the platform offers. screenshot
As a new user I can create an account/login to my account so that I can access the dating platform. screenshot / screenshot
As a registered user I can create/edit my profile so that other users can learn about me. screenshot / screenshot
As a registered user I can delete my profile and account so that I can remove my presence from the platform. screenshot
As a registered user I can view other profiles so that I can discover potential matches. screenshot
As a registered user I can rate a person (like or pass) so that this person can be my match or not. screenshot / screenshot
As a registered user I can see my mutual matches so that I can connect with people who also like me. screenshot
As a registered user I want to be notified and automatically redirected to the matches page when I have a new match so that I don't miss opportunities to connect. screenshot
As a registered user I can see profiles fade out after I like or pass on them so that I get visual feedback that my action was successful. screenshot
As a registered user I can view detailed profile information so that I can learn more about someone before connecting. screenshot
As a registered user I can return to the previous page when viewing a profile detail so that I can easily continue browsing from where I left off. screenshot
As a registered user I can see profiles I've liked so that I can review my interests and revisit profiles. screenshot
As a user I would like responsive design on mobile so that I can browse matches on any device. screenshot
As a user I would like to see a 404 error page if I get lost so that it's obvious that I've stumbled upon a page that doesn't exist. screenshot

Automated Testing

I have conducted a series of automated tests on my application.

Note

I fully acknowledge and understand that, in a real-world scenario, an extensive set of additional tests would be more comprehensive.

Python (Unit Testing)

I have used Django's built-in unit testing framework to test the application functionality.

I created unit tests for the "dating" and "connections" app views which cover the applications main functionalities. All tests passed successfully.

In order to run the tests, I ran the following command in the terminal each time:

  • python3 manage.py test dating
  • python3 manage.py test connections

Results:

NO ERROR found:

Test Results Screenshot

Test Results Screenshot

To create the coverage report, I would then run the following commands:

  • pip3 install coverage
  • pip3 freeze --local > requirements.txt
  • coverage run --omit="*/site-packages/*,*/migrations/*,*/__init__.py,env.py,.env" manage.py test
  • coverage report

To see the HTML version of the reports, and find out whether some pieces of code were missing, I ran the following commands:

  • coverage html
  • python3 -m http.server

Below are the results from the full coverage report on my application that I've tested:

screenshot

Debugging

Note

For the developpement process and Bugs documentation, please refer to the DEBUGGING.md file.