From 5b510bbcb10d758f987b96c759a108cd1146c047 Mon Sep 17 00:00:00 2001 From: roost-io Date: Mon, 18 May 2026 10:40:18 +0000 Subject: [PATCH] Add API Tests (Karate Framework, Open AI) generated by RoostGPT Using AI Model gpt-4o --- karate-tests/config/karate-config.js | 45 ++++++++++ karate-tests/tests/README.md | 79 +++++++++++++++++ .../api_v3_funds_amc_list.json_get.feature | 35 ++++++++ ...3_funds_index_nav_NIFTY50.json_get.feature | 25 ++++++ ..._v3_funds_tags_top_bought.json_get.feature | 24 ++++++ ...pi_v3_funds_tags_top_sold.json_get.feature | 40 +++++++++ ..._funds_tags_top_watchlist.json_get.feature | 25 ++++++ ...api_v3_gold_current_price.json_get.feature | 32 +++++++ .../tests/api_v3_gold_prices.json_get.feature | 27 ++++++ .../tests/api_v3_user_info.json_get.feature | 71 +++++++++++++++ .../crypto_api_v1_coins.json_get.feature | 46 ++++++++++ .../equity_api_v1_stock_prices.json_get.csv | 3 + ...quity_api_v1_stock_prices.json_get.feature | 67 +++++++++++++++ ...ixed_deposit_api_v1_plans.json_get.feature | 43 ++++++++++ ...mf_api_v4_fund_categories.json_get.feature | 34 ++++++++ ..._api_v4_fund_schemes_list.json_get.feature | 40 +++++++++ ...f_api_v4_fund_schemes_{codes}.json_get.csv | 4 + ...i_v4_fund_schemes_{codes}.json_get.feature | 86 +++++++++++++++++++ ...pi_v1_exchange_rates_live.json_get.feature | 37 ++++++++ 19 files changed, 763 insertions(+) create mode 100644 karate-tests/config/karate-config.js create mode 100644 karate-tests/tests/README.md create mode 100644 karate-tests/tests/api_v3_funds_amc_list.json_get.feature create mode 100644 karate-tests/tests/api_v3_funds_index_nav_NIFTY50.json_get.feature create mode 100644 karate-tests/tests/api_v3_funds_tags_top_bought.json_get.feature create mode 100644 karate-tests/tests/api_v3_funds_tags_top_sold.json_get.feature create mode 100644 karate-tests/tests/api_v3_funds_tags_top_watchlist.json_get.feature create mode 100644 karate-tests/tests/api_v3_gold_current_price.json_get.feature create mode 100644 karate-tests/tests/api_v3_gold_prices.json_get.feature create mode 100644 karate-tests/tests/api_v3_user_info.json_get.feature create mode 100644 karate-tests/tests/crypto_api_v1_coins.json_get.feature create mode 100644 karate-tests/tests/equity_api_v1_stock_prices.json_get.csv create mode 100644 karate-tests/tests/equity_api_v1_stock_prices.json_get.feature create mode 100644 karate-tests/tests/fixed_deposit_api_v1_plans.json_get.feature create mode 100644 karate-tests/tests/mf_api_v4_fund_categories.json_get.feature create mode 100644 karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature create mode 100644 karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.csv create mode 100644 karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.feature create mode 100644 karate-tests/tests/vested_api_v1_exchange_rates_live.json_get.feature diff --git a/karate-tests/config/karate-config.js b/karate-tests/config/karate-config.js new file mode 100644 index 00000000..d4c7ee00 --- /dev/null +++ b/karate-tests/config/karate-config.js @@ -0,0 +1,45 @@ + +function fn() { + function maskSensitiveFields(obj) { + var sensitiveKeys = ['password', 'token', 'authorization']; + for (var key in obj) { + if (sensitiveKeys.includes(key.toLowerCase())) { + obj[key] = '******'; + } else if (typeof obj[key] === 'object' && obj[key] !== null) { + maskSensitiveFields(obj[key]); + } + } + return obj; + } + const envVars = {}; + // Get all environment variables from the OS + const System = Java.type('java.lang.System'); + const env = System.getenv(); + // karate.log('env is:', env); + const keys = env.keySet().toArray(); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + envVars[key] = env.get(key); + if (key != 'API_TEST_SERVER_CONFIG' && + (key.includes('API_HOST') || key.includes('BASE_URL') || key.includes('URL_BASE')) + ) { + karate.log('set envVars for key:', key, ' with ', env.get(key)); + } + } + // Add Karate's own env variable + envVars['karate.env'] = karate.env; + const config = { + maskSensitiveFields: maskSensitiveFields, + karate: { + properties: {...envVars, + //additionalProperty: 'value' + }, + } + }; + const LM = Java.type("com.example.logmodifier.LogModifier"); + const logModifierInstance = new LM(); + karate.configure("logModifier", logModifierInstance); + + // karate.log('Karate configuration:', config); + return config; +} \ No newline at end of file diff --git a/karate-tests/tests/README.md b/karate-tests/tests/README.md new file mode 100644 index 00000000..b92de317 --- /dev/null +++ b/karate-tests/tests/README.md @@ -0,0 +1,79 @@ + # Karate Feature File Execution Guide + +This guide explains how to execute Karate feature files using the Karate JAR file via the command line. + +--- + +## ✅ Prerequisites + +1. **Karate JAR File**: Download the `karate.jar` file (see below for the command). +2. **Feature File**: Ensure you have a valid Karate `.feature` file. +3. **Configuration Directory**: *(Optional)* If you use `karate-config.js`, specify its directory. + +--- + +## 📥 Download the Karate JAR File + +Use this command to download the Karate JAR from GitHub releases: + +```bash +curl -L "https://github.com/karatelabs/karate/releases/download/v\${KARATE_VERSION}/\${KARATE_JAR_NAME}" -o "\${KARATE_JAR_PATH}" +``` + +--- + +## 🚀 Command Syntax + +To execute all feature files: + +```bash +java -Dkarate.config.dir= -jar +``` + +To execute a single feature file: + +```bash +java -Dkarate.config.dir= -jar +``` + +### Parameters: +- ``: *(Optional)* Path to the config directory with `karate-config.js` +- ``: Path to the downloaded Karate JAR file +- ``: Path to the `.feature` file you want to run +- ``: Path to the feature files directory + +--- + +## 💡 Example + +Assume: +- Karate JAR is located at: `Downloads/karate-1.5.1.jar` +- Feature file is at: `karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature` +- Config directory: `karate-tests/config` +- Feature files directory: `karate-tests/tests` + +Then run the command: + +```bash +java -Dkarate.config.dir=karate-tests/config -jar Downloads/karate-1.5.1.jar karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature +``` + +To execute all feature files in the karate-tests/tests folder: + +```bash +java -Dkarate.config.dir=karate-tests/config -jar Downloads/karate-1.5.1.jar karate-tests/tests +``` +--- +## 🛠 Troubleshooting + +- ❌ **Incorrect paths** — Double-check the paths to JAR and feature files +- ⚠️ **Missing `karate-config.js`** — Ensure the file exists if you're using config + +--- + +## 📌 Notes + +- Ensure your `.feature` file is syntactically correct to avoid runtime errors +- You can pass a directory of feature files instead of a single file if needed + +--- \ No newline at end of file diff --git a/karate-tests/tests/api_v3_funds_amc_list.json_get.feature b/karate-tests/tests/api_v3_funds_amc_list.json_get.feature new file mode 100644 index 00000000..b725a9a4 --- /dev/null +++ b/karate-tests/tests/api_v3_funds_amc_list.json_get.feature @@ -0,0 +1,35 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/funds/amc_list.json_get for http method type GET +# RoostTestHash=a20bd7e8f1 +# +# + +# ********RoostGPT******** +Feature: AMC List API Tests + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Verify the AMC List API returns a valid response + Given path '/api/v3/funds/amc_list.json' + When method GET + Then status 200 + And match response == '#[]' + And match each response[*].AMC_code == '#string' + And match each response[*].available_for_purchase == '#number' + And match each response[*].amc_name == '#string' + And match each response[*].image == '#string' + And match each response[*].short_code == '#string' + And match each response[*].rta_info == '#string' + And match each response[*].address == '#string' + And match each response[*].phone_number == '#string' + And match each response[*].website == '#string' + And match each response[*].login_url == '#string' + And match each response[*].contact_email == '#string' + And match each response[*].description == '#string' + And assert karate.sizeOf(response) >= 1 diff --git a/karate-tests/tests/api_v3_funds_index_nav_NIFTY50.json_get.feature b/karate-tests/tests/api_v3_funds_index_nav_NIFTY50.json_get.feature new file mode 100644 index 00000000..0bb61611 --- /dev/null +++ b/karate-tests/tests/api_v3_funds_index_nav_NIFTY50.json_get.feature @@ -0,0 +1,25 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/funds/index_nav/NIFTY50.json_get for http method type GET +# RoostTestHash=32db4f7597 +# +# + +# ********RoostGPT******** +Feature: NIFTY 50 Historical Value API Tests + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Retrieve NIFTY 50 Historical Values + Given path '/api/v3/funds/index_nav/NIFTY50.json' + When method GET + Then status 200 + And match response == '#[]' + And match each response[*] == '#[2]' + And match each response[*][0] == '#? _ % 86400 == 0' + And match each response[*][1] == '#? _ >= 2500 && _ <= 88888 && _ % 0.1 == 0' diff --git a/karate-tests/tests/api_v3_funds_tags_top_bought.json_get.feature b/karate-tests/tests/api_v3_funds_tags_top_bought.json_get.feature new file mode 100644 index 00000000..d2439cb8 --- /dev/null +++ b/karate-tests/tests/api_v3_funds_tags_top_bought.json_get.feature @@ -0,0 +1,24 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/funds/tags/top_bought.json_get for http method type GET +# RoostTestHash=6e5acf6d5f +# +# + +# ********RoostGPT******** +Feature: Top Bought Funds API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Verify the response for GET /api/v3/funds/tags/top_bought.json + Given path 'api/v3/funds/tags/top_bought.json' + When method GET + Then status 200 + And match response == '#[] string' + And match each response[*] == '#regex ^[A-Z0-9-]+' + And match each response[*].length >= 4 diff --git a/karate-tests/tests/api_v3_funds_tags_top_sold.json_get.feature b/karate-tests/tests/api_v3_funds_tags_top_sold.json_get.feature new file mode 100644 index 00000000..e7e6f579 --- /dev/null +++ b/karate-tests/tests/api_v3_funds_tags_top_sold.json_get.feature @@ -0,0 +1,40 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/funds/tags/top_sold.json_get for http method type GET +# RoostTestHash=f9241cc552 +# +# + +# ********RoostGPT******** +Feature: Top Sold Funds API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Verify the Top Sold Funds API returns a list of mutual fund codes + Given path '/api/v3/funds/tags/top_sold.json' + When method GET + Then status 200 + And match response == '#[]' + And match each response[*] == '#string' + And match each response[*] contains '#regex ^[A-Z0-9-]+' + And match each response[*].length >= 4 + + Scenario: Verify the Top Sold Funds API with unsupported HTTP method + Given path '/api/v3/funds/tags/top_sold.json' + When method POST + Then assert responseStatus != 200 + + Scenario: Verify the Top Sold Funds API with unsupported HTTP method + Given path '/api/v3/funds/tags/top_sold.json' + When method PUT + Then assert responseStatus != 200 + + Scenario: Verify the Top Sold Funds API with unsupported HTTP method + Given path '/api/v3/funds/tags/top_sold.json' + When method DELETE + Then assert responseStatus != 200 diff --git a/karate-tests/tests/api_v3_funds_tags_top_watchlist.json_get.feature b/karate-tests/tests/api_v3_funds_tags_top_watchlist.json_get.feature new file mode 100644 index 00000000..cdb7ec0f --- /dev/null +++ b/karate-tests/tests/api_v3_funds_tags_top_watchlist.json_get.feature @@ -0,0 +1,25 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/funds/tags/top_watchlist.json_get for http method type GET +# RoostTestHash=bee3a3b3c5 +# +# + +# ********RoostGPT******** +Feature: Top Watched Funds API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Retrieve top watched mutual funds + Given path '/api/v3/funds/tags/top_watchlist.json' + When method GET + Then status 200 + And match response == '#[]' + And match each response[*] == '#string' + And match each response[*] contains '#regex ^[A-Z0-9-]+' + And match each response[*].length >= 4 diff --git a/karate-tests/tests/api_v3_gold_current_price.json_get.feature b/karate-tests/tests/api_v3_gold_current_price.json_get.feature new file mode 100644 index 00000000..bb5a7e05 --- /dev/null +++ b/karate-tests/tests/api_v3_gold_current_price.json_get.feature @@ -0,0 +1,32 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/gold/current_price.json_get for http method type GET +# RoostTestHash=f3ca0065bd +# +# + +# ********RoostGPT******** +Feature: Current Gold Price API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Get current gold price + Given path '/api/v3/gold/current_price.json' + When method GET + Then status 200 + And match response == '#object' + And match response.taxes == '#object' + And match response.taxes.cgst == '#number' + And match response.taxes.sgst == '#number' + And match response.taxes.igst == '#number' + And match response.block_id == '#string' + And match response.fetched_at == '#string' + And match response.current_gold_price == '#object' + And match response.current_gold_price.buy == '#number' + And match response.current_gold_price.sell == '#number' + And match response.fetched_at == '#regex ^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$' diff --git a/karate-tests/tests/api_v3_gold_prices.json_get.feature b/karate-tests/tests/api_v3_gold_prices.json_get.feature new file mode 100644 index 00000000..3d7f1eb2 --- /dev/null +++ b/karate-tests/tests/api_v3_gold_prices.json_get.feature @@ -0,0 +1,27 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/gold/prices.json_get for http method type GET +# RoostTestHash=28bb4bb229 +# +# + +# ********RoostGPT******** +Feature: Gold Prices API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Retrieve Gold Prices with valid request + Given path '/api/v3/gold/prices.json' + When method GET + Then status 200 + And match response == '#object' + And match response.gold_prices == '#[]' + And match each response.gold_prices[*].date == '#string' + And match each response.gold_prices[*].price == '#number' + And match each response.gold_prices[*].date == '#regex ^\\d{4}-\\d{2}-\\d{2}$' + And assert karate.sizeOf(response.gold_prices) >= 1 diff --git a/karate-tests/tests/api_v3_user_info.json_get.feature b/karate-tests/tests/api_v3_user_info.json_get.feature new file mode 100644 index 00000000..680425de --- /dev/null +++ b/karate-tests/tests/api_v3_user_info.json_get.feature @@ -0,0 +1,71 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /api/v3/user/info.json_get for http method type GET +# RoostTestHash=bd0b92da19 +# +# + +# ********RoostGPT******** +Feature: User Info API Tests + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + * header Authorization = 'Bearer ' + + Scenario: Get User Info with valid Authorization + Given path '/api/v3/user/info.json' + When method GET + Then status 200 + And match response.id == '#number' + And match response.current_portfolio.onboarding_state == '#number' + And match response.current_portfolio.id == '#number' + And match response.current_portfolio.name == '#string' + And match response.current_portfolio.mode_of_investment == '#string' + And match response.current_portfolio.smart_switch == '#boolean' + And match response.current_portfolio.trade_smart == '#boolean' + And match response.current_portfolio.tax_harvesting == '#boolean' + And match response.current_portfolio.applicant_signature == '#[]' + And match response.current_portfolio.aof_status == '#string' + And match response.email == '#string' + And match response.fname == '#string' + And match response.mname == '##string' + And match response.lname == '#string' + And match response.name == '#string' + And match response.onboarding_state == '#number' + And match response.provider == '#string' + And match response.referral_code == '#string' + And match response.referred == '#boolean' + And match response.preferences.coins_preferences.smart_switch == '#boolean' + And match response.preferences.coins_preferences.family_account == '#boolean' + And match response.preferences.coins_preferences.smart_switch_2 == '#boolean' + And match response.preferences.display_sort_preference == '#string' + And match response.preferences.equity_beta == '#boolean' + And match response.preferences.fd_beta == '#boolean' + And match response.preferences.dont_prompt_m1 == '#boolean' + And match response.preferences.dont_prompt_mandate == '#boolean' + And match response.preferences.dont_prompt_import_cas == '#boolean' + And match response.preferences.dont_prompt_insurance == '#boolean' + And match response.preferences['2fa_on'] == '#boolean' + And match response.preferences.dashboard_returns == '#string' + And match response.preferences.dont_prompt_asset_allocation == '#boolean' + And match response.newsletter == '#string' + And match response.mobile_phone == '#string' + And match response.state == '#number' + And match response.has_imported == '#boolean' + And match response.big_investor == '#boolean' + And match response.holiday == '#string' + And match response.dob == '#string' + And match response.kayako.timestamp == '##string' + And match response.kayako.token == '##string' + + Scenario: Get User Info with invalid Authorization + Given path '/api/v3/user/info.json' + * header Authorization = 'Bearer ' + When method GET + Then assert responseStatus != 200 + And match response.error.code == '#number' + And match response.error.message == '#string' diff --git a/karate-tests/tests/crypto_api_v1_coins.json_get.feature b/karate-tests/tests/crypto_api_v1_coins.json_get.feature new file mode 100644 index 00000000..fee00d63 --- /dev/null +++ b/karate-tests/tests/crypto_api_v1_coins.json_get.feature @@ -0,0 +1,46 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /crypto/api/v1/coins.json_get for http method type GET +# RoostTestHash=4192f47015 +# +# + +# ********RoostGPT******** +Feature: Validate Crypto Rates API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Validate GET /crypto/api/v1/coins.json with valid request + Given path 'crypto/api/v1/coins.json' + When method GET + Then status 200 + And match response == '#object' + And match response.status == '#string' + And match response.data == '#[]' + And match each response.data[*].id == '#number' + And match each response.data[*].name == '#string' + And match each response.data[*].ticker == '#string' + And match each response.data[*].slug == '#string' + And match each response.data[*].icon == '#string' + And match each response.data[*].hash_link == '#string' + And match each response.data[*].min_trade_amount == '#number' + And match each response.data[*].inr_tradeable == '#boolean' + And match each response.data[*].usdt_tradeable == '#boolean' + And match each response.data[*].created_at == '#string' + And match each response.data[*].updated_at == '#string' + And match each response.data[*].is_active == '#boolean' + And match each response.data[*].highest_buy_bid == '#number' + And match each response.data[*].lowest_sell_bid == '#number' + And match each response.data[*].last_traded_price == '#number' + And match each response.data[*].yes_price == '#number' + And match each response.data[*].last_updated == '#string' + And match each response.data[*].returns_1y == '#number' + And match each response.data[*].volume == '#object' + And match each response.data[*].volume.max == '#string' + And match each response.data[*].volume.min == '#string' + And match each response.data[*].volume.volume == '#number' diff --git a/karate-tests/tests/equity_api_v1_stock_prices.json_get.csv b/karate-tests/tests/equity_api_v1_stock_prices.json_get.csv new file mode 100644 index 00000000..d3c9fc31 --- /dev/null +++ b/karate-tests/tests/equity_api_v1_stock_prices.json_get.csv @@ -0,0 +1,3 @@ +stocks +"INE330H01018" +"INE114A01011" \ No newline at end of file diff --git a/karate-tests/tests/equity_api_v1_stock_prices.json_get.feature b/karate-tests/tests/equity_api_v1_stock_prices.json_get.feature new file mode 100644 index 00000000..d8802e49 --- /dev/null +++ b/karate-tests/tests/equity_api_v1_stock_prices.json_get.feature @@ -0,0 +1,67 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /equity/api/v1/stock/prices.json_get for http method type GET +# RoostTestHash=d05b34920b +# +# + +# ********RoostGPT******** +Feature: Stock Prices API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario Outline: Validate Stock Prices API with valid ISIN codes + Given path '/equity/api/v1/stock/prices.json' + And param stocks = '' + When method GET + Then status 200 + And match response.status == 'success' + And match response.data == '#object' + And match each response.data[*].last_price == '#string' + And match each response.data[*].last_volume == '#string' + And match each response.data[*].total_volume == '#string' + And match each response.data[*].open_price == '#string' + And match each response.data[*].high_price == '#string' + And match each response.data[*].low_price == '#string' + And match each response.data[*].last_close_price == '#string' + And match each response.data[*].buy_volume == '#string' + And match each response.data[*].sell_volume == '#string' + And match each response.data[*].last_updated_time == '#string' + And match each response.data[*].last_updated_date == '#string' + And match each response.data[*].pe_ratio == '#string' + And match each response.data[*].fw_pe_ratio == '#string' + And match each response.data[*].market_capitalisation == '#string' + And match each response.data[*].return_1w == '#string' + And match each response.data[*].return_1m == '#string' + And match each response.data[*].return_1y == '#string' + And match each response.data[*].return_ytd == '#string' + And match each response.data[*].pb_ratio == '#string' + And match each response.data[*].52_week_high == '#string' + And match each response.data[*].52_week_low == '#string' + And match each response.data[*].52_week_high_date == '#string' + And match each response.data[*].52_week_low_date == '#string' + And match each response.data[*].ticker == '#string' + And match each response.data[*].exchange == '#string' + And match each response.data[*].net_percent_change == '#string' + And match each response.data[*].adjusted_net_change == '#string' + And match each response.data[*].adjusted_net_percent_change == '#string' + And match each response.data[*].isin == '#string' + And match each response.data[*].avg_volume == '#string' + And match each response.data[*].dividend_yield == '#string' + And match each response.data[*].eps == '#string' + And match each response.data[*].last_updated_date_time == '#string' + And match each response.data[*].is_live == '#boolean' + + Examples: + | read('equity_api_v1_stock_prices.json_get.csv') | + + Scenario: Validate Stock Prices API with invalid ISIN code + Given path '/equity/api/v1/stock/prices.json' + And param stocks = 'INVALIDISIN' + When method GET + Then assert responseStatus != 200 diff --git a/karate-tests/tests/fixed_deposit_api_v1_plans.json_get.feature b/karate-tests/tests/fixed_deposit_api_v1_plans.json_get.feature new file mode 100644 index 00000000..9f555b4a --- /dev/null +++ b/karate-tests/tests/fixed_deposit_api_v1_plans.json_get.feature @@ -0,0 +1,43 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /fixed_deposit/api/v1/plans.json_get for http method type GET +# RoostTestHash=538b533c8a +# +# + +# ********RoostGPT******** +Feature: Fixed Deposit Plans API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Get Fixed Deposit Plans with valid request + Given path 'fixed_deposit/api/v1/plans.json' + When method GET + Then status 200 + And match response == '#object' + And match response.data == '#[1,]' + And match each response.data[*].id == '#string' + And match each response.data[*].type == '#string' + And match each response.data[*].attributes == '#object' + And match each response.data[*].attributes.name == '#string' + And match each response.data[*].attributes.risk_level == '#string' + And match each response.data[*].attributes.partner_id == '#string' + And match each response.data[*].attributes.interest_rate == '#number' + And match each response.data[*].attributes.senior_citizen_interest_rate == '#number' + And match each response.data[*].attributes.offer_code == '##null' + And match each response.data[*].attributes.tenure_from == '#number' + And match each response.data[*].attributes.tenure_to == '#number' + And match each response.data[*].attributes.tenure_from_in_months == '#number' + And match each response.data[*].attributes.tenure_to_in_months == '#number' + And match each response.data[*].attributes.start_date == '##null' + And match each response.data[*].attributes.end_date == '##null' + And match each response.data[*].attributes.min_amount == '#regex \\d+[.\\d{2}]?' + And match each response.data[*].attributes.compounding == '#string' + And match each response.data[*].attributes.max_amount == '#regex \\d+[.\\d{2}]?' + And match each response.data[*].attributes.status == '#string' + And match each response.data[*].attributes.lockin_period == '#regex \\d+' diff --git a/karate-tests/tests/mf_api_v4_fund_categories.json_get.feature b/karate-tests/tests/mf_api_v4_fund_categories.json_get.feature new file mode 100644 index 00000000..6a024411 --- /dev/null +++ b/karate-tests/tests/mf_api_v4_fund_categories.json_get.feature @@ -0,0 +1,34 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /mf/api/v4/fund_categories.json_get for http method type GET +# RoostTestHash=24aa418911 +# +# + +# ********RoostGPT******** +Feature: Mutual Funds API - Fund Categories + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Get Fund Categories with Valid Request + Given path 'mf/api/v4/fund_categories.json' + When method GET + Then status 200 + And match response == '#[]' + And match response[*].category_name == '#string' + And match response[*].report_date == '#string' + And match response[*].week_1 == '#number' + And match response[*].month_1 == '#number' + And match response[*].month_3 == '#number' + And match response[*].month_6 == '#number' + And match response[*].year_1 == '#number' + And match response[*].year_3 == '#number' + And match response[*].year_5 == '#number' + And match response[*].year_10 == '#number' + And match response[*].inception == '#number' + And assert karate.sizeOf(response) >= 1 diff --git a/karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature b/karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature new file mode 100644 index 00000000..ba1c601c --- /dev/null +++ b/karate-tests/tests/mf_api_v4_fund_schemes_list.json_get.feature @@ -0,0 +1,40 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /mf/api/v4/fund_schemes/list.json_get for http method type GET +# RoostTestHash=3aac1a53dd +# +# + +# ********RoostGPT******** +Feature: Mutual Fund Schemes API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Get Mutual Fund Schemes + Given path 'mf/api/v4/fund_schemes/list.json' + When method GET + Then status 200 + And match response == '#object' + And match each response[*] == '#object' + And match each response[*].* == '#object' + And match each response[*].*.c == '#string' + And match each response[*].*.c matches /^[A-Z0-9-]+/ + And match each response[*].*.n == '#string' + And match each response[*].*.n.length > 0 + And match each response[*].*.re == '#string' + And match each response[*].*.re.length <= 1 + And match each response[*].*.r == '#object' + And match each response[*].*.r['1'] == '##number' + And match each response[*].*.r['3'] == '##number' + And match each response[*].*.r['5'] == '##number' + And match each response[*].*.r.inception == '#number' + And match each response[*].*.r.date == '#string' + And match each response[*].*.r.date.length > 0 + And match each response[*].*.v == '#number' + And match each response[*].*.kc == '#string' + And match each response[*].*.kc.length > 0 diff --git a/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.csv b/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.csv new file mode 100644 index 00000000..f6da362f --- /dev/null +++ b/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.csv @@ -0,0 +1,4 @@ +codes +"12345" +"67890" +"ABCDE" \ No newline at end of file diff --git a/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.feature b/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.feature new file mode 100644 index 00000000..386e3332 --- /dev/null +++ b/karate-tests/tests/mf_api_v4_fund_schemes_{codes}.json_get.feature @@ -0,0 +1,86 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /mf/api/v4/fund_schemes/{codes}.json_get for http method type GET +# RoostTestHash=a9934f9508 +# +# + +# ********RoostGPT******** +Feature: Mutual Fund Plan Details API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario Outline: Validate Mutual Fund Plan Details with valid codes + Given path '/mf/api/v4/fund_schemes/.json' + When method GET + Then status 200 + And match response == '#[]' + And match each response[*].code == '#string' + And match each response[*].name == '#string' + And match each response[*].short_name == '#string' + And match each response[*].lump_available == '#string' + And match each response[*].sip_available == '#string' + And match each response[*].lump_min == '#number' + And match each response[*].lump_min_additional == '#number' + And match each response[*].lump_max == '#number' + And match each response[*].lump_multiplier == '#number' + And match each response[*].sip_min == '#number' + And match each response[*].sip_max == '#number' + And match each response[*].sip_multiplier == '#number' + And match each response[*].sip_dates == '#[]' + And match each response[*].redemption_allowed == '#string' + And match each response[*].redemption_amount_multiple == '#number' + And match each response[*].redemption_amount_minimum == '#number' + And match each response[*].redemption_quantity_multiple == '#number' + And match each response[*].redemption_quantity_minimum == '#number' + And match each response[*].category == '#string' + And match each response[*].lock_in_period == '#number' + And match each response[*].upsizecode_sip_dates == '#[]' + And match each response[*].sip_maximum_gap == '#number' + And match each response[*].fund_house == '#string' + And match each response[*].fund_name == '#string' + And match each response[*].short_code == '#string' + And match each response[*].detail_info == '#string' + And match each response[*].ISIN == '#string' + And match each response[*].direct == '#string' + And match each response[*].switch_allowed == '#string' + And match each response[*].stp_flag == '#string' + And match each response[*].swp_flag == '#string' + And match each response[*].sips == '#[]' + And match each response[*].instant == '#string' + And match each response[*].reinvestment == '#string' + And match each response[*].tags == '#[]' + And match each response[*].slug == '#string' + And match each response[*].channel_partner_code == '#string' + And match each response[*].tax_period == '#number' + And match each response[*].nav.nav == '#number' + And match each response[*].nav.date == '#string' + And match each response[*].last_nav.nav == '#number' + And match each response[*].last_nav.date == '#string' + And match each response[*].jan_31_nav == '#number' + And match each response[*].volatility == '#number' + And match each response[*].returns.week_1 == '#number' + And match each response[*].returns.year_1 == '#number' + And match each response[*].returns.year_3 == '#number' + And match each response[*].returns.year_5 == '#number' + And match each response[*].returns.inception == '#number' + And match each response[*].returns.date == '#string' + And match each response[*].start_date == '#string' + And match each response[*].fund_type == '#string' + And match each response[*].fund_category == '#string' + And match each response[*].plan == '#string' + And match each response[*].expense_ratio == '#string' + And match each response[*].expense_ratio_date == '#string' + And match each response[*].fund_manager == '#string' + And match each response[*].crisil_rating == '#string' + And match each response[*].investment_objective == '#string' + And match each response[*].maturity_type == '#string' + And match each response[*].aum == '#number' + + Examples: + | read('mf_api_v4_fund_schemes_{codes}.json_get.csv') | diff --git a/karate-tests/tests/vested_api_v1_exchange_rates_live.json_get.feature b/karate-tests/tests/vested_api_v1_exchange_rates_live.json_get.feature new file mode 100644 index 00000000..cc9d2cf5 --- /dev/null +++ b/karate-tests/tests/vested_api_v1_exchange_rates_live.json_get.feature @@ -0,0 +1,37 @@ +# ********RoostGPT******** + +# Test generated by RoostGPT for test kuvera_karate_get_api using AI Type Open AI and AI Model gpt-4o +# +# Feature file generated for /vested/api/v1/exchange_rates/live.json_get for http method type GET +# RoostTestHash=a2233e4583 +# +# + +# ********RoostGPT******** +Feature: USD Exchange Rate API + + Background: + * def baseURL = karate.properties['KUVERA_BASE_URL'] || karate.properties['API_HOST'] + * url baseURL + * header Accept = 'application/json' + + Scenario: Verify successful retrieval of USD exchange rate + Given path 'vested/api/v1/exchange_rates/live.json' + When method GET + Then status 200 + And match response.status == '#string' + And match response.data.id == '#number' + And match response.data.date == '#string' + And match response.data.price == '#number' + And match response.data.source_currency == '#string' + And match response.data.target_currency == '#string' + And match response.data.source_currency == 'USD' + And match response.data.target_currency == 'INR' + And match response.data.date == '#? _ != null && _ matches /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$/' + + Scenario: Verify response structure when an error occurs + Given path 'vested/api/v1/exchange_rates/live.json' + When method GET + Then assert responseStatus != 200 + And match response.error.code == '#number' + And match response.error.message == '#string'