{"id":23235657,"url":"https://github.com/jmsdaq/karate-dojo","last_synced_at":"2026-02-18T12:32:20.525Z","repository":{"id":231476787,"uuid":"774760389","full_name":"jmsdaq/karate-dojo","owner":"jmsdaq","description":"Automated API testing using the Karate framework, covering various testing scenarios such as different HTTP methods, response validation, and assertions to ensure API reliability and performance.","archived":false,"fork":false,"pushed_at":"2024-12-18T00:51:38.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T21:39:23.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmsdaq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T06:08:57.000Z","updated_at":"2024-12-18T00:55:11.000Z","dependencies_parsed_at":"2024-04-04T07:31:25.622Z","dependency_job_id":"f145102b-7a8c-4868-94b7-5782b7dfb5f3","html_url":"https://github.com/jmsdaq/karate-dojo","commit_stats":null,"previous_names":["jmsdaq/karate","jmsdaq/karate-dojo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmsdaq/karate-dojo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsdaq%2Fkarate-dojo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsdaq%2Fkarate-dojo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsdaq%2Fkarate-dojo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsdaq%2Fkarate-dojo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmsdaq","download_url":"https://codeload.github.com/jmsdaq/karate-dojo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmsdaq%2Fkarate-dojo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29578980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T08:38:15.585Z","status":"ssl_error","status_checked_at":"2026-02-18T08:38:14.917Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T03:29:12.216Z","updated_at":"2026-02-18T12:32:20.507Z","avatar_url":"https://github.com/jmsdaq.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Karate Framework API Testing Guide\n\n## Overview\n\nThis project demonstrates how to use **Karate** for API testing. Karate is an open-source tool that combines API test automation, performance testing, and mock services in one framework. It’s based on Cucumber, which makes writing tests in Gherkin syntax natural and simple. With Karate, we can easily validate REST APIs, HTTP methods, and much more with minimal configuration.\n\n## Setup\n\n### Prerequisites:\n- Java (8 or higher)\n- Maven\n- IDE (IntelliJ IDEA or VSCode recommended)\n\n### Steps to Set Up:\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/jmsdaq/karate-dojo.git\n   cd karate-api-testing\n\n2. Install dependencies: Run the following Maven command to install dependencies:\n    ```bash\n    mvn clean install\n\n3. Run the tests: You can run the tests directly via Maven\n    ```bash\n   mvn test\n\nStructure\n- `src/test/java`: Contains your feature files for test scenarios.\n- `karate-config.js`: Holds global variables or configurations used across tests.\n- `pom.xml`: Maven build file to manage dependencies. \n\n## Writing API Tests\n### 1. Basic Request and Response Validation\n   Here’s a simple example to test a GET API call with ReqRes:\n   ```gherkin\n   Feature: API Testing with Karate\n\n  Scenario: Validate GET response from ReqRes\n    Given url 'https://reqres.in/api/users/2'\n    When method GET\n    Then status 200\n    And match response.data.first_name == 'Janet'\n    And match response.data.last_name == 'Weaver'\n   ```\n### 2. Handling Query Parameters\n   ```gherkin\nFeature: API Testing with Query Params\n\n  Scenario: Test with query parameters in ReqRes\n    Given url 'https://reqres.in/api/users'\n    And param page = 2\n    When method GET\n    Then status 200\n    And match response.page == 2\n    And match response.data[0].id == 7\n   ```\n### 3. Testing POST Request\n   ```gherkin\nFeature: POST request example with ReqRes\n\n  Scenario: Create a new user\n    Given url 'https://reqres.in/api/users'\n    And header Content-Type = 'application/json'\n    And request { name: 'morpheus', job: 'leader' }\n    When method POST\n    Then status 201\n    And match response.name == 'morpheus'\n    And match response.job == 'leader'\n   ```\n\n### 4. Assertions \u0026 Validations\n   Karate makes it easy to perform assertions on the response body, headers, and status code:\n\n- `status`: Validate the HTTP status code.\n- `match`: Verify specific fields in the response.\n- `assert`: Perform more complex assertions like checking response times or JSON schemas.\n  \n## Customizing Tests\n  You can customize your Karate tests by editing `karate-config.js` for global variables or settings. This allows for better reusability and scalability of your tests across different environments or APIs.\n  ```\n  function fn() {\n  var config = {\n    baseUrl: 'https://reqres.in/api',\n    timeout: 5000\n  };\n  return config;\n}\n   ```\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsdaq%2Fkarate-dojo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmsdaq%2Fkarate-dojo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmsdaq%2Fkarate-dojo/lists"}