Skip to main content

ENTERPRISE

IntelliJ IDEA

The Karate Labs IntelliJ plugin provides a complete development environment for Karate tests — syntax highlighting, run-from-editor, debugging, and OpenAPI integration. Works fully-featured on both IntelliJ Community Edition and Ultimate.

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

ENTERPRISE

includes all in PRO

  • Import OpenAPI / Swagger definitions
  • Convert API specifications to Karate tests
  • Choose payload sub-sets from spec schemas
  • Convert API specifications to Karate mocks
  • Impact analysis of API changes
  • Priority support & SLA
  • SSO / SAML support
  • Offline license
  • Contact us
IntelliJ Community Edition

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

Legal Notice

By using this plugin, you agree to the Karate Labs EULA. The plugin and the Karate open-source library both ship with zero telemetry — no usage data, analytics, or device information is collected or transmitted. See our Privacy Policy for details.

Installation

Install the plugin from the JetBrains Marketplace, or search for Karate in Settings → Plugins.

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 — JavaScript support is built-in

License Activation

License activation and status is unified within the IntelliJ settings UI. Go to Settings → Languages & Frameworks → Karate.

License activation settings panel in IntelliJ
  1. Click the Sign In link — your browser opens the usual flow tied to your subscription.
  2. Copy the session ID from the browser and paste it into the input box in the IntelliJ settings view.
  3. Click Apply to complete sign-in.

Once authenticated you can work offline. The settings page shows how many days remain in your session.

If you need an offline license because of strict security or similar restrictions, please contact us. Offline licensing is available only for enterprise customers.

Session Renewal

Once signed-in, you can renew or extend the session in one click without re-authenticating in a browser.

Session renewal button in IntelliJ settings

If you have a valid subscription, Renew Session works even if your session has expired.

A notification appears when 10 or fewer days remain in your session. Clicking Renew Now takes you directly to the Karate settings screen for a one-click renewal.

Session renewal notification banner

Offline License

Enterprise only

Offline licensing is a paid feature for enterprises. Make sure you know who your designated admin is before performing this step.

On the License Activation settings page, click the Offline License link.

Offline license button in IntelliJ settings

A unique code for your system will be shown (for example, DhHOFKHvd7XYTi+rQnNTJQ==). Send that code to your designated admin. You will be issued a license tied to this unique code.

To apply the license, copy the entire license file (starting with -----BEGIN LICENSE FILE-----) and paste it into the text area provided.

Pasting an offline license file in IntelliJ

Click Apply — you should see a confirmation message and your license details.

Core Features

Run From Editor

Right-click a .feature file in the project explorer or editor and run it. An IntelliJ run configuration is created automatically — you can customize it later if needed.

You can also run a single Scenario by right-clicking on it, or by using the gutter icon. Right-clicking the gutter icon brings up the option to Debug instead of Run.

Run or debug a single scenario from the gutter icon

You can even run a single example in a Scenario Outline by right-clicking a data row within an Examples table.

Run a single example from an Examples data row

Run Configurations

IntelliJ run configurations let you re-run tests with specific parameters. All typical Karate options are supported, including environment selection, tag filtering, parallel execution, JVM parameters, and working directory.

Karate run configuration dialog in IntelliJ

Structure View

The IntelliJ structure view lets you navigate large feature files — jump directly to scenarios and examples.

IntelliJ structure view for a Karate feature file

Code Formatting

IntelliJ code formatting shortcuts work as expected — even JSON within doc-string blocks is formatted correctly.

Karate feature file before and after reformatting

Test Results

Test results integrate into the IntelliJ test-results view. The HTML report is one click away.

Karate test results in the IntelliJ test runner panel

When tests fail, you can navigate directly to the feature file and line that failed by clicking the hyperlinks in the log.

Clickable error hyperlink in the Karate test log

Advanced Features (PRO)

Auto Complete

Beyond syntax validation, you get auto-complete for the most commonly used keywords.

Keyword auto-complete suggestions in a Karate feature file

Code Folding

Collapse sections to make it easier to work with long tests.

Code folding in a Karate feature file

References

Click to navigate to called files. Hover to see context. Currently supported for the read() and Java.type() syntax — more coming soon, including auto-complete for references.

Jump to Java class reference from a Karate test

JSON Re-formatting

Place the cursor inside JSON to see a "bulb" icon with re-format options.

JSON re-format bulb icon in the Karate editor

The options depend on context:

  • Lenient — JS-style, single quotes and unquoted property keys
  • Strict — Standard JSON with double quotes
  • Make single line — Convert multi-line JSON to a single line
  • Make multi-line — Convert single-line JSON to multi-line, including triple-quotes

Run Folder

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

Right-click context menu to run all tests in a folder

Debug

You can set breakpoints in feature files in debug mode. The Karate debugger can step back and hot-reload simple edits to your test. Note that Hot Reload and Step Back may be hidden in some IntelliJ UI variants.

Debugging a Karate feature file with the variables panel

Debug Java from Karate

A Karate debug session will stop at Java breakpoints.

Debug Karate from Java

You can also start a normal Java debug session that uses the Karate Runner Java API and have it stop at Karate breakpoints. This requires Karate 1.5.0 or greater.

  • Use the Karate Runner Java API as in this example
  • Use an IntelliJ Java or JUnit run configuration in Debug mode. Right-clicking a JUnit class (or method) or a Java class with a main method is normally how you create one.

Because the Runner API is pure Java, it does not get in the way of your flow or infrastructure. For example, your Java or JUnit code can start a server and then start your Karate test suite — the debug session will stop at both Java and Karate breakpoints.

Debug Gradle Projects

For Gradle projects, the run configuration IntelliJ creates may default to a Gradle-specific one rather than the native Java run configuration that honors breakpoints in Karate feature files. Change it via Settings → Build, Execution, Deployment → Build Tools → Gradle → Build and run — set Run tests using to Choose per test.

Gradle build and run settings in IntelliJ

Now when right-clicking on a JUnit test or Java class, you can choose the Java run configuration instead of the Gradle one.

Right-click menu showing the option to choose the Java run configuration

OpenAPI / Swagger Features (ENTERPRISE)

OpenAPI Import

Right-clicking any file in the project explorer brings up a Karate Import menu. OpenAPI and Swagger files of any version are supported.

Karate Import menu on an OpenAPI spec file

When successful, a Karate tool window appears (typically top-right). Expand it to see HTTP methods per API path (GET, POST, etc.). Click an HTTP method to preview the equivalent Karate snippet.

Karate tool window showing imported OpenAPI methods

Create Tests From Spec

Creating a Karate test from an OpenAPI or Swagger file is fast — just click and drag from the tree into the editor window.

Dragging an OpenAPI method into the editor to generate a Karate test

This gives you full control over the sequence of API calls in your test.

Spec Payload Chooser

Complex APIs include schemas with all possible variations even though only some fields are commonly used. Right-click on an HTTP method in the tree to view the Request or Response when available.

Right-click menu for choosing request or response payload

A dialog appears where you can un-select JSON keys to choose payload sub-sets.

Selecting JSON keys to build a payload sub-set

Once satisfied, cut and paste into a test or wherever you need the payload.

Create Mock From Spec

Export all data within an imported schema into a plain-vanilla JS file that can be used as a Karate mock. A detailed explanation and sample is at karate-oas-demo.

Use the Save Mock button at the bottom of the tool window.

Spec Impact Analysis

You can also export a plain-vanilla JS file that dumps all API and schema information in a format designed to make impact analysis easier using your existing IDE diff features. The format flattens all metadata into single lines.

Once exported, compare two of these files using IntelliJ's Compare With menu to view the diff intuitively.

Diff view comparing two exported API schemas

Scroll right to view differences even for very large API schemas.

Test Impact Analysis — coming soon: see which tests and mocks are affected by API changes.

Configuration

Workspace Settings

Use .idea/workspace.xml entries for team-wide plugin settings.

File Type Association

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

Troubleshooting

If you don't see options to run a test, make sure the Karate icon appears for open .feature files in the editor and the project explorer. The Cucumber for Java plugin can conflict with Karate — disable it.

Karate file icon in the project explorer

To verify the Karate plugin handles .feature files, go to Settings → Editor → File Types → Recognized File Types.

Recognized file types settings in IntelliJ

If you really need to mix Cucumber tests and Karate tests in the same workspace, see this Stack Overflow answer.

Resources

Next Steps