This project demonstrates how to use the Karate Framework to test financial APIs, specifically the Alpha Vantage API. It includes examples of testing stock data, forex data, and news sentiment analysis.
- Clone this repository
- Ensure you have Java 8 or higher installed
- Install Maven if you haven't already
- Sign up for an Alpha Vantage API key at https://www.alphavantage.co/ (Take note that the Alpha Vantage API key has a max of 25 calls per day + the json data might have different responses sometimes, causing test failures)
- Add your API key to
application.yml
:
To run all tests: mvn test To run specific feature file: mvn test -Dtest=FinancialTest#testStockData
- Get daily stock data for Tesla
- Get stock data for multiple companies
- Validate error response for invalid symbol
- Get exchange rate
- Get intraday forex data
- Validate error response for invalid currency pair
- Get news sentiment for a stock
- Get news sentiment for multiple stocks
- Validate error response for invalid ticker
Feel free to fork this repository and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Karate Framework Alpha Vantage API