IntelliJ Platform Testing Extension
Edit pageLast modified: 24 February 2025tip
The IntelliJ Platform Gradle Plugin introduces a top-level intellijPlatformExtension
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 form 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 NamedDomainObjectContainers
which allow for creating new objects of given types. Registering of a custom task which allows for adjusting the IntelliJ Platform type and version can be done by using one of the below containers, depending on the task purpose.
Example:
intellijPlatformTesting {
runIde
testIde
testIdeUi
testIdePerformance
}
intellijPlatformTesting {
runIde
testIde
testIdeUi
testIdePerformance
}
By default, created tasks depend on the IntelliJ Platform defined with Dependencies Extension. However, it is possible to adjust it to any requirements with passing custom values directly to the created object, task
, or sandboxTask
task instances.
Example:
val runPhpStorm by intellijPlatformTesting.runIde.registering {
type = IntelliJPlatformType.PhpStorm
version = ...
useInstaller = ...
localPath = ...
sandboxDirectory = ...
splitMode = ...
splitModeTarget = ...
task {
...
}
prepareSandboxTask {
...
}
plugins {
...
}
}
intellijPlatformTesting.runIde {
runPhpStorm {
type = IntelliJPlatformType.PhpStorm
version = ...
useInstaller = ...
localPath = ...
sandboxDirectory = ...
splitMode = ...
splitModeTarget = ...
task {
...
}
prepareSandboxTask {
...
}
plugins {
...
}
}
}
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]
.
plugins {}
An extension to provide custom plugins to be added when running the task runtime, or disabling bundled ones.
It provides several methods for adding remote and local plugins, or for disabling already loaded or bundled plugin.
Example:
val runIdeWithPlugins by intellijPlatformTesting.runIde.registering {
// ...
plugins {
plugin("pluginId", "1.0.0")
disablePlugin("pluginId")
}
}
intellijPlatformTesting.runIde {
runIdeWithPlugins {
// ...
plugins {
plugin("pluginId", "1.0.0")
disablePlugin("pluginId")
}
}
}
Function | Description |
---|---|
| Adds a dependency on a plugin for a custom IntelliJ Platform. |
| Adds a dependency on a plugin for a custom IntelliJ Platform using a string notation:
|
| Adds dependencies on plugins for a custom IntelliJ Platform using a string notation:
|
| 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 dependency on a Robot Server Plugin. |
note
Something missing?If a topic you are interested in is not covered in the above sections, let us know via the Was this page helpful? feedback form below or other channels.
Please be specific about the topics and reasons for adding them, and leave your email in case we need more details. Thanks for your feedback!
Thanks for your feedback!