This repository contains the implementation and automated tests for the Cryptocurrency Wallet API. The API is designed to manage user wallets, facilitate transactions, and provide essential cryptocurrency-related functionalities. The tests are crafted using Postman and executed with Newman, ensuring comprehensive coverage and reliability of the API endpoints.
- Overview
- API Endpoints Covered
- Tools Used
- Setup Instructions
- Running the Tests
- Project Structure
- Contributing
- License
The Cryptocurrency Wallet API offers a range of endpoints for managing cryptocurrency transactions, including user registration, wallet balance retrieval, transaction processing, and exchange rate queries. This project automates the testing of these endpoints to ensure the API's functionality, reliability, and consistency.
The following API endpoints are covered in the automation:
200 POST /api/v1/register
: Register a user, and create their wallet.200 POST /api/v1/login
: Login the user and generate a session token.
200 GET /api/v1/balance
: Retrieve the wallet balance.
200 GET /api/v1/transactions
: List all the transactions done by the user.200 POST /api/v1/transactions
: Transfer 5 ETH to a recipient.200 POST /api/v1/transaction_fee
: Calculate transaction fees and return estimated cost.
200 GET /api/v1/exchange_rates
: Get an object with all available currency exchange rates.
- Postman: Used for creating, organizing, and running the API test cases.
- Newman: A command-line tool used to run Postman collections in various environments and integrate them into CI/CD pipelines.
- Node.js installed on your machine.
- Newman installed globally:
npm install -g newman
Clone this repository to your local machine:
git clone https://github.com/sadmanpieal/Cryptocurrecy-Wallet-API.git
cd Cryptocurrecy-Wallet-API
To run the tests using Newman, use the following command:
newman run Cryptocurrency Wallet API.postman_collection.json
This command will execute the entire suite of tests against the API.
If you wish to generate an HTML report after running the tests, use:
newman run Cryptocurrency Wallet API.postman_collection.json -r html --reporter-html-export newman-report.html
The report will be saved as newman-report.html
.
The repository is structured as follows:
Cryptocurrency-Wallet-API/
│
├── Cryptocurrency-Wallet-API.postman_collection.json # Postman collection file containing all API requests and tests.
├── newman/ # Folder containing Newman reports and other artifacts (if applicable).
└── README.md # Project documentation (this file).
If you would like to contribute to this project, please fork the repository and submit a pull request. All contributions are welcome!
This project is licensed under the MIT License. See the LICENSE file for details.