Skip to main content

IDE SUPPORT

IntelliJ IDEA

The Karate Labs IntelliJ plugin provides a complete development environment for Karate tests with advanced features like debugging, OpenAPI integration, and comprehensive IDE support. Works fully-featured on both IntelliJ Community Edition and Ultimate.

Installation

Install the plugin from the JetBrains Marketplace or search for "Karate" in the Plugins settings.

Requirements:

  • IntelliJ IDEA Community Edition or Ultimate
  • Java 17+ (for Karate 1.5.0+) or Java 11+ (for Karate 1.4.x)
  • No additional plugins required (JS support is built-in)

Plugin Features by License

PLUS

core features

  • Syntax coloring
  • Run Feature from editor
  • Run single Scenario/Example
  • Run Configurations
  • Structure view
  • Code formatting
  • In-IDE test results

PRO

includes all in plus

  • Auto complete
  • Code folding
  • Jump to references
  • JSON re-formatting
  • Run all tests in folder
  • Run Karate Labs add-ons (e.g. Kafka)
  • Debug Karate test
  • Debug Java & Karate in same session
  • Java debug session stops at Karate breakpoints

ULTIMATE

includes all in pro

  • Import OpenAPI (or Swagger) definitions
  • Convert API specifications to Karate tests
  • Choose payload sub-sets from spec schemas
  • Explore API directly from OpenAPI or Swagger specs
  • Convert API specifications to Karate mocks
  • Impact analysis of API changes

ENTERPRISE

includes all in ultimate

  • Priority support
  • SSO/SAML support
  • Offline license
  • Contact us
Legal Notice

By using this plugin, you agree to the Karate Labs EULA. Data on a few user actions is collected and subject to our Privacy Policy. HTML reports generated by the Karate open-source library has additional analytics.

IntelliJ Community Edition

This plugin works fully-featured on IntelliJ Community Edition. JavaScript support is built-in and does not require IntelliJ IDEA Ultimate.

License Activation

License activation is integrated within the IntelliJ settings UI:

  1. Go to Settings → Languages & Frameworks → Karate
  2. Click the Sign In link
  3. Authenticate with your Karate Labs account in the browser
  4. Copy the session ID from your browser
  5. Paste the session ID into the IntelliJ settings input box
  6. Click Apply to complete sign-in

Once authenticated, you can work offline. The settings page shows remaining session days.

Session Renewal

For existing users, session renewal is available with one click:

  • Use the Renew Session button in settings
  • Works even if your session has expired (with valid subscription)
  • Notification appears when 10 or fewer days remain
  • Click Renew Now in notification for direct access to settings

Offline License (Enterprise Only)

For enterprise customers requiring offline licenses:

  1. Open Settings → Languages & Frameworks → Karate
  2. Click Offline License
  3. Copy the unique system code (e.g., DhHOFKHvd7XYTi+rQnNTJQ==)
  4. Send the code to your designated admin
  5. Paste the received license file content (starting with -----BEGIN LICENSE FILE-----)
  6. Click Apply to activate

Core Features

Running Tests

Run Feature File

  • Right-click .feature files in explorer or editor
  • Automatically creates IntelliJ run configurations
  • Customize configurations as needed

Run Single Scenario

  • Right-click on any scenario
  • Use gutter icons for quick access
  • Right-click gutter icon for debug option

Run Single Example

  • Right-click on data rows in Examples tables
  • Perfect for testing specific data combinations

Run Configurations

IntelliJ run configurations support all Karate runtime options:

  • Environment selection
  • Tag filtering
  • Parallel execution settings
  • Custom JVM parameters
  • Working directory control

Troubleshooting

Common Issues:

  • Ensure Karate icon appears for .feature files
  • Disable "Cucumber for Java" plugin if installed (conflicts with Karate)
  • Check Settings → Editor → File Types → Recognized File Types

For mixed Cucumber/Karate workspaces: See Stack Overflow solution

Code Intelligence Features

Structure View

Navigate large feature files using IntelliJ's structure view - jump directly to scenarios and examples.

Code Formatting

IntelliJ code formatting shortcuts work perfectly, including JSON within doc-string blocks.

Test Results

  • Integrated test results view
  • One-click access to HTML reports
  • Hyperlinked error navigation - click to jump to failing lines
  • Direct navigation from errors to feature files

Advanced Features (PRO+)

Auto Complete

  • Karate keywords and syntax
  • Built-in functions and variables
  • Context-aware suggestions

Code Folding

  • Collapse scenarios and features
  • Focus on specific test sections
  • Better handling of long test files

References

  • Click to navigate to called files
  • Hover for context preview
  • Support for read() and Java.type() syntax
  • More features coming soon

JSON Re-formatting

  • Place cursor in JSON to see formatting options
  • "Bulb" icon appears with options:
    • Lenient: Single quotes, unquoted keys (JS-style)
    • Strict: Double quotes, proper JSON
    • Single line: Convert multi-line to single line
    • Multi-line: Convert single line to multi-line with triple quotes

Run Folder

Right-click any folder in explorer to run all feature files within it.

Debugging (PRO+)

  • Set breakpoints in feature files
  • Step through test execution
  • Step backwards through execution
  • Hot-reload simple edits during debugging
  • Inspect variables and responses

Java Integration:

  • Debug Java and Karate in same session
  • Java breakpoints stop during Karate execution
  • Start from Java debug using Karate Runner API (requires Karate 1.5.0+)

Gradle Projects: For proper debugging in Gradle projects:

  1. Go to Settings → Build, Execution, Deployment → Build Tools → Gradle → Build and run
  2. Set Run tests using to Choose per test
  3. Select Java Run Configuration instead of Gradle when right-clicking tests

OpenAPI/Swagger Features (ULTIMATE)

OpenAPI Import

  • Right-click any file → Karate Import
  • Supports OpenAPI or Swagger files (any version)
  • Creates Karate tool window (typically top-right)
  • Expand to view HTTP methods per API path
  • Preview equivalent Karate snippets

Create Tests From Spec

  • Drag and drop from API tree into editor
  • Full control over API call sequences
  • Quick test generation from specifications

Spec Payload Chooser

  • Right-click HTTP methods in tree
  • Choose Request or Response payload options
  • Interactive dialog to select/deselect JSON keys
  • Generate payload subsets for common use cases
  • Perfect for complex APIs with many optional fields

Create Mock From Spec

  • Export all schema data to vanilla JS file
  • Use as Karate mock service
  • See karate-oas-demo for examples
  • Use Save Mock button in tool window

Spec Impact Analysis

  • Export API and schema information for diff analysis
  • Flatten metadata into single-line text format
  • Use IntelliJ Compare With to view API changes
  • Scroll through differences in large API schemas
  • Test Impact Analysis: Coming soon - show which tests/mocks are affected by API changes

Configuration

Workspace Settings

Create .idea/workspace.xml entries for team-wide plugin settings (similar to VS Code workspace settings).

File Type Association

Ensure .feature files are associated with Karate plugin in Settings → Editor → File Types.

Resources

Next Steps