IntelliJ Platform Testing Extension
The IntelliJ Platform Gradle Plugin introduces a top-level intellijPlatformTesting extension. It provides a possibility for registering custom tasks for running the IDE, unit tests, UI tests, or performance tests.
For each of the custom tasks, a dedicated sandbox is created to isolate them from other tasks or the build flow as they may rely on a different IntelliJ Platform version, plugins, or other configuration.
IntelliJ Platform Testing
After the IntelliJ Platform Gradle Plugin is applied, the intellijPlatformTesting extension can be used for registering new tasks to fulfil specific requirements of the project.
The extension exposes four NamedDomainObjectContainer instances for registering task configurations. Registering an entry creates an execution task with the entry's name and a sandbox preparation task named prepareSandbox_<name>. The container names describe task types, not additional tasks created merely by accessing the containers.
For a separate Starter-based UI-test workflow, see Run UI tests in CI. The built-in task is named testUi; the custom-task container remains testIdeUi.
Example:
By default, created tasks depend on the IntelliJ Platform defined with Dependencies Extension. Configure the entry directly to select another IDE, and use task {} or prepareSandboxTask {} to customize its execution or sandbox preparation.
Each registered entry extends the IntelliJ Platform dependency configuration model, so properties like type, version, productMode, useInstaller, and useCache can be configured directly on the entry. The additional localPath property selects a local IDE installation and takes precedence over a remote request. Without localPath, explicitly setting type, version, or useInstaller selects a custom remote IDE even if the project's base IDE is local. Otherwise, the base local IDE is reused when one is configured. The version accepts "latest" (or Constraints.LATEST_VERSION) to resolve the newest available installer release for the configured type.
In projects using the Module plugin, this extension can register custom testIde tasks only. Register custom runIde, testIdeUi, and testIdePerformance tasks in the root project using the Platform plugin.
Example:
Common Properties
Property | Type | Default or behavior |
|---|---|---|
|
| The registered entry's name, also used for the execution task. |
|
| Unset. Selects a local IDE instead of downloading one. |
|
| Inherits the base |
|
| Inherits the base |
|
| Inherits the base |
|
| Deprecated compatibility alias for |
Each entry implements Buildable and can be passed directly to dependsOn() to schedule its execution task. The task and prepareSandboxTask properties provide read-only access to the corresponding TaskProvider instances.
task {}
Depending on the type of registered object, a different task class is available for configuration:
Type | Task class |
|---|---|
| |
| |
| |
|
prepareSandboxTask {}
The prepareSandboxTask refers to a dedicated PrepareSandboxTask task instance, connected only with a newly created task. The name of this task is based on the name of created task, like prepareSandbox_[TASK_NAME]. The execution task uses this task's sandbox automatically. For runIde entries, the sandbox also includes the current host's native variant when native variants are enabled. Custom testIde, testIdeUi, and testIdePerformance entries do not select a native variant automatically.
testFramework(...)
Adds a dependency on a test-framework library variant for the created testing entry. The version can be provided as a string or as a Provider<String>. When omitted, the closest version matching the configured IntelliJ Platform build is used. This is the entry's target platform build, which can differ from the project's base IntelliJ Platform.
See also:
testFrameworks(...)
Adds dependencies on multiple test-framework library variants for the created testing entry. It accepts either vararg TestFrameworkType arguments or a List<TestFrameworkType>. The closest version matching the configured IntelliJ Platform build is selected for every variant.
The plural overloads do not accept an explicit version. To pin a specific version, call testFramework(type, version) separately.
See also:
plugins {}
Configures plugins for the registered entry's IDE and test classpaths and sandbox.
Remote and local plugin dependencies from the project's test plugin configurations are inherited. Bundled plugin and module helpers resolve against the entry's target IDE. Plugins can also be disabled in the entry's sandbox.
Example:
Function | Description |
|---|---|
| Adds a plugin dependency. The channel and configuration block are optional. Supply the ID, version, and channel consistently as strings or providers of strings. |
| Adds a plugin dependency using |
| Adds dependencies on plugins for a custom IntelliJ Platform using a string notation:
|
| Adds a dependency on a plugin in a version compatible with the custom IntelliJ Platform. |
| Adds dependencies on plugins in versions compatible with the custom IntelliJ Platform. |
| Adds a dependency on a bundled IntelliJ Platform plugin from the custom target IDE. |
| Adds dependencies on bundled IntelliJ Platform plugins from the custom target IDE. |
| Adds a dependency on a bundled IntelliJ Platform module or module alias from the custom target IDE. |
| Adds dependencies on bundled IntelliJ Platform modules or module aliases from the custom target IDE. |
| Disables the specific plugin with its ID. |
| Disables specific plugins with the list of their IDs. |
| Adds a dependency on a local IntelliJ Platform plugin. Accepts path or a dependency on another module. |
| Adds a Robot Server Plugin dependency. Accepts a string or provider; defaults to the latest version. |
For a non-default Marketplace channel, include @ in the channel: plugin("pluginId", "1.0", "@eap") or plugin("pluginId:1.0@eap"). In the three-argument overload, a bare "eap" is interpreted as a Maven group, not as the Marketplace channel.
plugins(), compatiblePlugins(), bundledPlugins(), bundledModules(), and disablePlugins() accept vararg strings, a List<String>, or a Provider<List<String>>. The singular compatiblePlugin(), bundledPlugin(), bundledModule(), and disablePlugin() methods also accept Provider<String> arguments. localPlugin() accepts a String, File, Directory, a provider of a local path, or a ProjectDependency.
Bundled Library Exclusions
The optional plugin() configuration block exposes IntelliJPlatformPluginConfiguration:
Function | Description |
|---|---|
| Excludes files matching one Gradle Ant-style pattern. |
| Excludes files matching any of the supplied vararg patterns. |
Patterns are relative to the dependency plugin's lib/ and lib/modules/ directories. Matching files are excluded from project classpaths and sandbox installations. Patterns declared for the same plugin ID are combined build-wide, rather than being isolated to this testing entry. To configure exclusions for several plugins, use separate plugin() calls; the plural plugins() helper does not accept a configuration block. With Groovy, the ID/version overload requires an explicit channel argument when supplying a configuration closure; use '' for the default channel.