Skip to content
zcervink edited this page Oct 23, 2021 · 67 revisions

Welcome to the IntelliJ IDEA UI test library wiki! Here you'll find several pieces of information and advices on how to use and contribute to this library.

Purpose of this project

This project allows you to create automated UI tests for your IntelliJ IDEA plugin.

Any Suggestions or Questions?

Please submit an issue to this project.

Contributing

Feel free to contribute to this project! See the contribution guide for more details.

Quick setup

To find out how you can add this library to your IntelliJ IDEA Plugin Project see the Adding this Library to your IntelliJ IDEA Plugin Project wiki page.

STEP 1: Extend the build.gradle File of Your IntelliJ IDEA Plugin Project

repositories {
    maven {
        url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
    }
    maven {
        url 'https://repository.jboss.org/nexus/content/groups/public'
    }
}

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
}

dependencies {
    compile 'com.redhat.devtools.intellij:intellij-common-ui-test-library:0.0.2'
}

runIdeForUiTests {
    systemProperty "robot-server.port", System.getProperty("robot-server.port")
}

repositories {
    maven {
        url 'https://packages.jetbrains.team/maven/p/ij/intellij-dependencies'
    }
}

STEP 2: Run and Close the IntelliJ IDEA Before and After All the UI Tests

private static RemoteRobot robot;

@BeforeAll
public static void runIdeForUiTests() {
    robot = UITestRunner.runIde(UITestRunner.IdeaVersion.V_2020_3, 8580);
}

@AfterAll
public static void closeIde() {
    UITestRunner.closeIde();
}

STEP 3: Use Any Provided Tool to Create Your Own UI Tests

For more information see the Repository Structure wiki page.

Clone this wiki locally