safebank-fe

Testing Strategy 🧪

Test-Driven Development (TDD)

Behavior-Driven Development (BDD) 🧑‍🤝‍🧑

Pytest Tests

Postman Tests

Integration with CI/CD 🔗


Example Tests for Specific User Stories

Below are some examples of tests implemented for specific user stories, found in safebank-be/tests/functional/test_routes.py:

User Story Acceptance Criteria Related Tests
215 Transfer Money GIVEN a transfer request
WHEN:
- The source and target bank accounts exist
- The source account belongs to the user
- The amount to transfer is a non-negative number
- The source account has sufficient balance
THEN the transfer is made successfully
test_transfer(...):
Test that a transfer between accounts of a user is made successfully.
test_invalid_transfers(...):
Test that a transfer fails if the amount is negative or too large.
test_transfer_between_users(...):
Test that a transfer between two different users is successful.
165 Manage User Accounts GIVEN valid admin credentials
WHEN accessing the user management portal
THEN Admins can:
- View a list of all users
- View a list of all transactions
- Create, update, and delete users
test_create_user(...):
Test that a user is created successfully.
test_get_users(...):
Test that a list of users can be retrieved.
test_get_transactions(...):
Test that a list of transactions can be retrieved.
test_update_user(...):
Test that a user’s information can be updated.
test_delete_user(...):
Test that a user can be deleted successfully.
207 User Login GIVEN valid user credentials
WHEN a user fills out the login form
THEN the system will authenticate the user and redirect them to their user page. If credentials are invalid, the user sees an error message.
test_user_login(...):
Test that a user can log in successfully.
test_unsuccessful_user_login(...):
Test that a user with invalid credentials cannot log in.