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
632 changes: 632 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,48 @@
Feature: Account Creation via AccountController

As an authenticated user
I want to create new accounts using the AccountController
So that I can manage my finances

Background:
Given the API endpoint is "/account/create_account"
And the request method is POST

@smoke
Scenario: Successfully create a new account with valid details
Given I am a logged-in user with a valid session
And the request body contains:
| account_name | account_type |
| "Personal Fund" | "Savings" |
When I send the POST request to "/account/create_account"
Then the response status should be 200
And the response should contain a list of Account objects
And each Account object should have fields:
| account_id |
| user_id |
| account_number |
| account_name |
| account_type |
| balance |
| create_at |
| updated_at |

@regression
Scenario: Fail to create account with missing account_name
Given I am a logged-in user with a valid session
And the request body contains:
| account_name | account_type |
| "" | "Savings" |
When I send the POST request to "/account/create_account"
Then the response status should be 400
And the response should contain the message "Account name cannot be Empty!"

@regression
Scenario: Fail to create account when user is not authenticated
Given I am not logged in and have no valid session
And the request body contains:
| account_name | account_type |
| "Personal Fund" | "Savings" |
When I send the POST request to "/account/create_account"
Then the response status should be 401
And the response should contain the message "You must login first."
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Feature: App Dashboard and History API Endpoints

Background:
Given the API base URL is set
And a user exists in the system

@smoke
Scenario: Successfully fetch dashboard data as logged-in user
Given I am logged in as a valid user
When I send a GET request to "/app/dashboard"
Then the response status should be 200
And the response should contain "accounts"
And the response should contain "total_balance"

@regression
Scenario: Attempt to fetch dashboard data without logging in
Given I am not logged in
When I send a GET request to "/app/dashboard"
Then the response status should be 401
And the response should contain "Unauthorized"

@smoke
Scenario: Successfully fetch payment history as logged-in user
Given I am logged in as a valid user
When I send a GET request to "/app/payment_history"
Then the response status should be 200
And the response should contain "payment_history" as JSON

@regression
Scenario: Attempt to fetch payment history without logging in
Given I am not logged in
When I send a GET request to "/app/payment_history"
Then the response status should be 401
And the response should contain "Unauthorized"

@smoke
Scenario: Successfully fetch transaction history as logged-in user
Given I am logged in as a valid user
When I send a GET request to "/app/transaction_history"
Then the response status should be 200
And the response should contain "transaction_history" as JSON

@regression
Scenario: Attempt to fetch transaction history without logging in
Given I am not logged in
When I send a GET request to "/app/transaction_history"
Then the response status should be 401
And the response should contain "Unauthorized"

@smoke
Scenario: Successfully fetch account transaction history with valid account ID as logged-in user
Given I am logged in as a valid user
And I have a valid account ID "12345"
When I send a POST request to "/app/account_transaction_history" with body:
| account_id | 12345 |
Then the response status should be 200
And the response should contain "history" for account "12345"

@regression
Scenario: Attempt to fetch account transaction history without logging in
Given I am not logged in
And I have a valid account ID "12345"
When I send a POST request to "/app/account_transaction_history" with body:
| account_id | 12345 |
Then the response status should be 401
And the response should contain "Unauthorized"

@regression
Scenario: Attempt to fetch account transaction history with missing account ID as logged-in user
Given I am logged in as a valid user
When I send a POST request to "/app/account_transaction_history" with empty body
Then the response status should not be 200
And the response should indicate "account_id" is required
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
Feature: AuthController Authentication Endpoints

Background:
Given the API base URL is "/"
And the user data is as follows:
| email | password | verified | correct_password |
| user@example.com | secret123 | true | secret123 |
| unverified@example.com | secret321 | false | secret321 |

@smoke
Scenario: Successful login with valid credentials
When I send a POST request to "/login" with body:
| email | password |
| user@example.com | secret123 |
Then the response status should be 200
And the response should contain JSON field "access_token"

@regression
Scenario: Login fails when email is missing
When I send a POST request to "/login" with body:
| password |
| secret123 |
Then the response status should be 400
And the response should contain an error message "Missing required field: email"

@regression
Scenario: Login fails when password is missing
When I send a POST request to "/login" with body:
| email |
| user@example.com |
Then the response status should be 400
And the response should contain an error message "Missing required field: password"

@regression
Scenario: Login fails with incorrect credentials
When I send a POST request to "/login" with body:
| email | password |
| user@example.com | wrongpass |
Then the response status should be 401
And the response should contain an error message "Invalid email or password"

@regression
Scenario: Login fails when account verification is required
When I send a POST request to "/login" with body:
| email | password |
| unverified@example.com | secret321 |
Then the response status should be 403
And the response should contain an error message "Account verification required"

@regression
Scenario: Login fails due to server error
Given the authentication service is unavailable
When I send a POST request to "/login" with body:
| email | password |
| user@example.com | secret123 |
Then the response status should be 500
And the response should contain an error message "Internal server error"

@smoke
Scenario: Successful logout for logged-in user
Given the user "user@example.com" is logged in with a valid session
When I send a GET request to "/logout"
Then the response status should be 200
And the response should contain a success message "Logout successful"

@regression
Scenario: Logout fails for not logged-in user
Given no user is logged in
When I send a GET request to "/logout"
Then the response status should be 401
And the response should contain an error message "Authentication required"
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Feature: IndexController API Functional Tests

Background:
Given the API base URL is "https://api.example.com"
And all requests include header "Accept: application/json"

@smoke @regression
Scenario: GET / returns welcome text (happy path)
When I send a GET request to "/"
Then the response status code should be 200
And the response content type should be "text/plain"
And the response body should be equal to "Welcome to Example API!"

@smoke @regression
Scenario: GET /verify returns verification success for valid token and code (happy path)
Given I have a valid token "abc123xyz" and code "456789"
When I send a GET request to "/verify?token=abc123xyz&code=456789"
Then the response status code should be 200
And the response content type should be "application/json"
And the response body should be valid JSON
And the response JSON should contain:
| key | value |
| verified | true |
| user_id | 42 |
| message | "Verification successful." |

@regression
Scenario: GET /verify returns error for missing token
When I send a GET request to "/verify?code=456789"
Then the response status code should be 400
And the response content type should be "text/plain"
And the response body should be equal to "This session has expire."

@regression
Scenario: GET /verify returns error for missing code
When I send a GET request to "/verify?token=abc123xyz"
Then the response status code should be 400
And the response content type should be "text/plain"
And the response body should be equal to "This session has expire."

@regression
Scenario: GET /verify returns error for invalid token
When I send a GET request to "/verify?token=invalidToken&code=456789"
Then the response status code should be 400
And the response content type should be "text/plain"
And the response body should be equal to "This session has expire."

@regression
Scenario: GET /verify returns error for invalid code
When I send a GET request to "/verify?token=abc123xyz&code=wrongCode"
Then the response status code should be 400
And the response content type should be "text/plain"
And the response body should be equal to "This session has expire."

@regression
Scenario: GET /verify returns error for expired session
Given the token "expiredToken" and code "456789" belong to an expired session
When I send a GET request to "/verify?token=expiredToken&code=456789"
Then the response status code should be 400
And the response content type should be "text/plain"
And the response body should be equal to "This session has expire."
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
Feature: User Registration via POST /register
As a new user
I want to be able to register an account
So that I can access protected features

Background:
Given the API endpoint "/register" is available
And the following request headers are set:
| Content-Type | application/json |

@smoke
Scenario: Successfully register with valid details and matching confirm_password
Given the request body is:
"""
{
"name": "Alice Johnson",
"email": "alice.johnson@example.com",
"password": "S3cureP@ssword"
}
"""
And the query parameter "confirm_password" is set to "S3cureP@ssword"
When I POST to "/register"
Then the response status code should be 200
And the response should include a user id and welcome message

@regression
Scenario: Registration fails with missing required fields
Given the request body is:
"""
{
"email": "bob.smith@example.com",
"password": "Pa$$word123"
}
"""
And the query parameter "confirm_password" is set to "Pa$$word123"
When I POST to "/register"
Then the response status code should be 400
And the response body should contain "name is required"

@regression
Scenario: Registration fails when password and confirm_password do not match
Given the request body is:
"""
{
"name": "Charlie Lee",
"email": "charlie.lee@example.com",
"password": "StrongPass1"
}
"""
And the query parameter "confirm_password" is set to "DifferentPass1"
When I POST to "/register"
Then the response status code should be 400
And the response body should contain "Password and confirm_password do not match"

@regression
Scenario: Registration fails with invalid email format
Given the request body is:
"""
{
"name": "Diana Miller",
"email": "diana.miller[at]example",
"password": "ValidP@ss123"
}
"""
And the query parameter "confirm_password" is set to "ValidP@ss123"
When I POST to "/register"
Then the response status code should be 400
And the response body should contain "email must be a valid email address"
Loading