Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
669 changes: 669 additions & 0 deletions Online-Banking-App-Spring-Boot/.roost/knowledge.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Feature: Account Creation via AccountController API

Background:
Given the API service is running
And the user "john.doe@example.com" is authenticated with sessionParam "user"

@smoke
Scenario: Successful account creation with valid data
When the user sends a POST request to "/account/create_account" with JSON body:
"""
{
"account_name": "Savings Account",
"account_type": "Savings"
}
"""
Then the response status should be 200
And the response should contain a list of accounts as JSON
And there should be an account with:
| account_name | account_type | balance |
| Savings Account | Savings | 0.00 |
And the account should have a non-empty "account_id" and "account_number"
And "create_at" and "updated_at" should be valid timestamps

@regression
Scenario: Account creation fails with missing account_name
When the user sends a POST request to "/account/create_account" with JSON body:
"""
{
"account_type": "Checking"
}
"""
Then the response status should be 400
And the response should contain an error message stating "Missing account_name"

@regression
Scenario: Account creation fails with missing account_type
When the user sends a POST request to "/account/create_account" with JSON body:
"""
{
"account_name": "Business Account"
}
"""
Then the response status should be 400
And the response should contain an error message stating "Missing account_type"

@regression
Scenario: Unauthorized account creation attempt
Given the user is not authenticated
When the user sends a POST request to "/account/create_account" with JSON body:
"""
{
"account_name": "Personal Account",
"account_type": "Savings"
}
"""
Then the response status should be 401
And the response should contain an error message stating "User not logged in"
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
Feature: App Dashboard and History API Endpoints

Background:
Given the API server is running

# -------------------------------
# DASHBOARD ENDPOINT
# -------------------------------

@smoke
Scenario: Retrieve dashboard data when user has accounts
Given an authenticated user with user_id "user_123"
When the user sends a GET request to "/app/dashboard" with sessionParam "user"
Then the response status should be 200
And the response body contains:
| accounts | total_balance |
| [Account objects] | 1500.00 |

@regression
Scenario: Retrieve dashboard data when user is not authenticated
When the user sends a GET request to "/app/dashboard" without authentication
Then the response status should be 401
And the response body contains an error message "Authentication required"

@regression
Scenario: Retrieve dashboard data when user has no accounts
Given an authenticated user with user_id "user_456" and 0 accounts
When the user sends a GET request to "/app/dashboard" with sessionParam "user"
Then the response status should be 200
And the response body contains:
| accounts | total_balance |
| [] | 0.00 |

# -------------------------------
# PAYMENT HISTORY ENDPOINT
# -------------------------------

@smoke
Scenario: Get payment history when payments exist
Given an authenticated user with user_id "user_123" with payments in history
When the user sends a GET request to "/app/payment_history" with sessionParam "user"
Then the response status should be 200
And the response body contains payment history list with at least one PaymentHistory object

@regression
Scenario: Get payment history when user has no payments
Given an authenticated user with user_id "user_789" with empty payment history
When the user sends a GET request to "/app/payment_history" with sessionParam "user"
Then the response status should be 200
And the response body contains payment history list as []

@regression
Scenario: Get payment history when user is not authenticated
When the user sends a GET request to "/app/payment_history" without authentication
Then the response status should be 401
And the response body contains an error message "Authentication required"

# -------------------------------
# TRANSACTION HISTORY ENDPOINT
# -------------------------------

@smoke
Scenario: Query transaction history when transactions exist
Given an authenticated user with user_id "user_123" with transactions in history
When the user sends a GET request to "/app/transaction_history" with sessionParam "user"
Then the response status should be 200
And the response body contains transaction history list with at least one TransactionHistory object

@regression
Scenario: Query transaction history when user has no transactions
Given an authenticated user with user_id "user_555" with empty transaction history
When the user sends a GET request to "/app/transaction_history" with sessionParam "user"
Then the response status should be 200
And the response body contains transaction history list as []

@regression
Scenario: Query transaction history when user is not authenticated
When the user sends a GET request to "/app/transaction_history" without authentication
Then the response status should be 401
And the response body contains an error message "Authentication required"

# -------------------------------
# ACCOUNT TRANSACTION HISTORY ENDPOINT
# -------------------------------

@smoke
Scenario: Retrieve transaction history for a valid account with transactions
Given an authenticated user with user_id "user_123" and an account_id "acc_001" with transactions
When the user sends a POST request to "/app/account_transaction_history" with JSON:
"""
{
"account_id": "acc_001"
}
"""
And sessionParam "user"
Then the response status should be 200
And the response body contains transaction history list with at least one TransactionHistory object

@regression
Scenario: Retrieve transaction history for a valid account with no transactions
Given an authenticated user with user_id "user_123" and an account_id "acc_002" with no transactions
When the user sends a POST request to "/app/account_transaction_history" with JSON:
"""
{
"account_id": "acc_002"
}
"""
And sessionParam "user"
Then the response status should be 200
And the response body contains transaction history list as []

@regression
Scenario: Retrieve transaction history for account when user is not authenticated
When the user sends a POST request to "/app/account_transaction_history" with JSON:
"""
{
"account_id": "acc_003"
}
"""
And no authentication
Then the response status should be 401
And the response body contains an error message "Authentication required"
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Feature: AuthController API Functional Tests

Background:
Given the AuthController API is available

@smoke
Scenario: Successful login with valid credentials
Given a user exists with email "alice@example.com" and password "StrongPass123" and is verified
When I send a POST request to "/login" with JSON body:
"""
{
"email": "alice@example.com",
"password": "StrongPass123"
}
"""
Then the response status should be 200
And the response JSON should contain:
| message | Authentication confirmed |
| access_token | <not empty> |

@regression
Scenario: Login attempt with empty email and password
When I send a POST request to "/login" with JSON body:
"""
{
"email": "",
"password": ""
}
"""
Then the response status should be 400
And the response JSON should contain:
| message | Username or Password cannot be empty |

@regression
Scenario: Login attempt with incorrect password
Given a user exists with email "bob@example.com" and password "Secure!456" and is verified
When I send a POST request to "/login" with JSON body:
"""
{
"email": "bob@example.com",
"password": "WrongPassword"
}
"""
Then the response status should be 401
And the response JSON should contain:
| message | Incorrect Username or Password |

@regression
Scenario: Login attempt with unverified account
Given a user exists with email "eve@example.com" and password "TopSecret789" and is not verified
When I send a POST request to "/login" with JSON body:
"""
{
"email": "eve@example.com",
"password": "TopSecret789"
}
"""
Then the response status should be 403
And the response JSON should contain:
| message | Account verification required |

@regression
Scenario: Login attempt with email not found in the system
When I send a POST request to "/login" with JSON body:
"""
{
"email": "notfound@example.com",
"password": "AnyPassword"
}
"""
Then the response status should be 500
And the response JSON should contain:
| message | Something went wrong (email not found) |

@smoke
Scenario: Successful logout
Given a user is authenticated and their sessionParam is "user"
When I send a GET request to "/logout" with parameter "user"
Then the response status should be 200
And the response JSON should contain:
| message | Logged out successfully |
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Feature: IndexController API Endpoints

Background:
Given the API server is running and available

@smoke
Scenario: Successful index greeting
When I send a GET request to "/"
Then the response status should be 200
And the response body should contain a greeting string

@smoke
Scenario: Successful verification with valid token and code
When I send a GET request to "/verify" with query parameters:
| token | code |
| "abcd1234efgh5678" | "9900" |
Then the response status should be 200
And the response body should be:
"""
{
"message": "Verification successful"
}
"""

@regression
Scenario: Verification fails with invalid token
When I send a GET request to "/verify" with query parameters:
| token | code |
| "invalidtoken2345" | "9900" |
Then the response status should be 400
And the response body should contain "Session expired or invalid token"

@regression
Scenario: Verification fails when token is missing
When I send a GET request to "/verify" with query parameters:
| code |
| "9900" |
Then the response status should be 400
And the response body should contain "Session expired or invalid token"

@regression
Scenario: Verification fails when code is missing
When I send a GET request to "/verify" with query parameters:
| token |
| "abcd1234efgh5678" |
Then the response status should be 400
And the response body should contain "Session expired or invalid token"
Loading