-
Notifications
You must be signed in to change notification settings - Fork 10
Home
Welcome to the IntelliJ IDEA UI test library wiki! Here you'll find several pieces of information and advices on how to setup, use and contribute to this library.
This project allows you to create automated UI tests for your IntelliJ IDEA plugin.
Please submit an issue to this project.
Feel free to contribute to this project! See the contribution guide for more details.
The setup of this library is easy - just
repositories {
maven {
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
}
maven {
url 'https://repository.jboss.org/nexus/content/groups/public'
}
maven {
url 'https://packages.jetbrains.team/maven/p/ij/intellij-dependencies'
}
}
dependencies {
compile 'com.redhat.devtools.intellij:intellij-common-ui-test-library:0.0.3'
}
sourceSets {
integrationTest {
java.srcDir file('src/it/java')
resources.srcDir file('src/it/resources')
compileClasspath += sourceSets.main.output + configurations.testRuntime
runtimeClasspath += output + compileClasspath
}
}
task integrationTest(type: Test) {
useJUnitPlatform()
description = 'Runs the integration tests.'
group = 'verification'
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
outputs.upToDateWhen { false }
mustRunAfter test
}
runIdeForUiTests {
systemProperty "robot-server.port", System.getProperty("robot-server.port")
}
Use the following code to start IntelliJ before running the first UI test. The runIde() method not only starts the IDE for UI tests, it also returns reference to the Remote-Robot instance which will be useful later to access UI elements such as buttons, inputs etc.
private static RemoteRobot robot;
@BeforeAll
public static void runIdeForUiTests() {
robot = UITestRunner.runIde(UITestRunner.IdeaVersion.V_2020_3, 8580);
}
After executing all the UI tests you close the IDE by running the following command:
@AfterAll
public static void closeIde() {
UITestRunner.closeIde();
}
After you manage to setup this library to your project and successfully start and quit IntelliJ IDEA, there is no mor setup needed. Just start writing your UI tests!