Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
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
87 changes: 87 additions & 0 deletions functional_tests/ZBIO-5139.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Feature: Testing Bank API

Scenario: Applying for credit card
Given application endpoint 'http://localhost:3000/apply'
When I send a POST request to '/credit-card' with valid identification, income details and contact information
Then the response status should be 200
And the response should contain 'Application successful'
But when I send a POST request with invalid or missing information
Then the response status should be 400
And the response should contain 'Invalid or missing information'

Scenario: Waiving off charges
Given customer history endpoint 'http://localhost:3000/customer-history'
When I send a GET request to '/review-charges'
Then the response status should be 200
And the bank decides to waive off charges based on review
But if the bank refuses to waive off charges based on customer's history
Then the response status should be 403
And the response should contain 'Request denied'

Scenario: Redeeming points
Given customer points endpoint 'http://localhost:3000/customer-points'
When I send a POST request to '/redeem' with number of points
Then if the customer has sufficient points, the response status should be 200
And the response should contain 'Action successful'
But if the points to be redeemed exceed the available points
Then the response status should be 400
And the response should contain 'Insufficient points'

Scenario: Extending credit limit
Given credit limit endpoint 'http://localhost:3000/credit-limit'
When I send a POST request to '/increase'
Then if the customer is creditworthy, the response status should be 200
And the response should contain 'Limit extended'
But if the customer does not meet criteria
Then the response status should be 403
And the response should contain 'Limit extension denied'

Scenario: Reducing credit limit
Given credit limit endpoint 'http://localhost:3000/credit-limit'
When I send a POST request to '/reduce'
Then if the reduction does not endanger debt recovery, the response status should be 200
And the response should contain 'Limit reduced'
But if the reduction endangers debt recovery
Then the response status should be 403
And the response should contain 'Reduction denies debt recovery'

Scenario: Promotional balance transfers
Given cardholders endpoint 'http://localhost:3000/cardholders'
When I send a POST request to '/transfer'
Then if the transfer does not exceed credit limit, the response status should be 200
And the response should contain 'Transfer successful'
But if the transfer exceeds credit limit
Then the response status should be 400
And the response should contain 'Transfer exceeds credit limit'

Scenario: Performance Testing
Given bank server endpoint 'http://localhost:3000/server'
When I send a GET request to check server performance under load
Then the server should scale up accordingly
But if the server performance degrades under load
Then alert for server performance issue

Scenario: Availability Testing
Given system endpoint 'http://localhost:3000/system'
When I send a GET request to '/uptime'
Then the system should be functional 24/7

Scenario: Security Testing
Given system login endpoint 'http://localhost:3000/login'
When I send a POST request with user credentials
Then the connection should be encrypted

Scenario: Compatibility Testing
Given application endpoint 'http://localhost:3000'
When I visit the application from different browsers and devices
Then the application layout and features should remain intact

Scenario: Usability Testing
Given application endpoint 'http://localhost:3000'
When I navigate through the application
Then it should be user-friendly with clear instructions

Scenario: Disaster Recovery Testing
Given database endpoint 'http://localhost:3000/database'
When I destroy a database and trigger the system's recovery methods
Then the system should recover the data successfully
75 changes: 75 additions & 0 deletions functional_tests/ZBIO-5139.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Functional Test Cases:

1. Credit Card Application:

- Test Case 1:
- Input: Customer provides accurate identification, income details, and contact information.
- Expected Output: Customer receives a message of successful credit card application.
- Edge Case: Test if a customer enters invalid or missing information, the system should retaliate with an appropriate response.

2. Waiving Off Charges:

- Test Case 2:
- Input: Customer seeks waiving off of an unexpected fee.
- Expected Output: Based on the customer history review, the bank decides to waive off the charges as a one-time courtesy.
- Edge Case: Test if the bank refuses to waive off charges based on customer's history.

3. Redeeming Points:

- Test Case 3:
- Input: Customer attempts to redeem points.
- Expected Output: System verifies if the customer has sufficient points and action completes successfully. If not, an error message is displayed.
- Edge Case: If the points to be redeemed exceed the available points, the system should display an appropriate message.

4. Credit Limit Extension:

- Test Case 4:
- Input: Based on customer’s creditworthiness, payment history and income stability, the bank decides to increase their credit limit.
- Expected Output: System displays notification of successful credit limit extension.
- Edge Case: Test if the system rightfully denies credit limit extension in case the customer does not meet criteria.

5. Credit Limit Reduction:

- Test Case 5:
- Input: Owing to changes in the customer's financial situation or risk profile, the bank decides to reduce the credit limit.
- Expected Output: System displays notification of successful credit limit reduction.
- Edge Case: System should deny credit limit reduction if it endangers chances of debt recovery.

6. Promotional Balance Transfers:

- Test Case 6:
- Input: Bank provides an offer for balance transfer to existing cardholders.
- Expected Output: High-interest balances from other cards are transferred to the new card under the promotional offer.
- Edge Case: Test for system response if the customer tries to transfer a balance exceeding their credit limit.

Non-Functional Test Cases:

1. Performance Testing:

- Test Case 7:
- Test system performance under load. Input: Increase the number of users or card applications to test system performance.

2. Availability Testing:

- Test Case 8:
- The system should remain functional 24/7. Test for system responses when downtime happens.

3. Security Testing:

- Test Case 9:
- All connections must use secure protocols and all sensitive data must be encrypted.

4. Compatibility Testing:

- Test Case 10:
- Must work on all specified browsers and devices.

5. Usability Testing:

- Test Case 11:
- Application should be user-friendly with clear instructions. Test navigation, options layout, and readability.

6. Disaster Recovery Testing:

- Test Case 12:
- The system should have the ability to recover data in case of a disaster. Destroy a database and attempt to restore it using the system's recovery methods.
114 changes: 114 additions & 0 deletions functional_tests/ZBIO-5139.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
openapi: 3.0.0
info:
title: Bank API
version: 1.0.0
servers:
- url: http://localhost:3000
paths:
/apply/credit-card:
post:
summary: Apply for credit card
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreditCardApplication'
responses:
'200':
description: Application successful
'400':
description: Invalid or missing information
/customer-history/review-charges:
get:
summary: Review charges
responses:
'200':
description: Charges reviewed
'403':
description: Request denied
/customer-points/redeem:
post:
summary: Redeem points
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PointsRedeem'
responses:
'200':
description: Action successful
'400':
description: Insufficient points
/credit-limit/increase:
post:
summary: Increase credit limit
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreditLimitChange'
responses:
'200':
description: Limit extended
'403':
description: Limit extension denied
/credit-limit/reduce:
post:
summary: Reduce credit limit
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreditLimitChange'
responses:
'200':
description: Limit reduced
'403':
description: Reduction denies debt recovery
/cardholders/transfer:
post:
summary: Promotional balance transfers
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BalanceTransfer'
responses:
'200':
description: Transfer successful
'400':
description: Transfer exceeds credit limit
# The additional scenarios regarding performance, security, usability testing, disaster recovery and compatibility are typically not handled by the API itself; therefore, those scenarios are not included here.
components:
schemas:
CreditCardApplication:
type: object
properties:
identification:
type: string
incomeDetails:
type: string
contactInformation:
type: string
PointsRedeem:
type: object
properties:
noOfPoints:
type: integer
CreditLimitChange:
type: object
properties:
limitChange:
type: number
BalanceTransfer:
type: object
properties:
amount:
type: number
UserCredentials:
type: object
properties:
username:
type: string
password:
type: string