Skip to content
This repository has been archived by the owner on May 18, 2020. It is now read-only.

UiTestPlugin

Michael Barth edited this page Jun 28, 2017 · 3 revisions

Purpose

This plugin is the completion of the UITestDefinitionPlugin and acts on a project. It extracts the test classes from the test bundle and executes them.

Declaration

Using this plugin needs the following plugin declarations:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "de.monkeyworks.buildmonkey:gradle.pde:0.4.18"
  }
}

apply plugin: 'de.monkeyworks.buildmonkey.pde.UiTestPlugin'

or in the incubating script snippet notation:

plugins {
  id "de.monkeyworks.buildmonkey.pde.UiTestPlugin" version "0.4.18"
}

Configuration

The configuration must be done on test project level.

subprojects {
  if (project.name.endsWith('.uitest')) {

      apply plugin: 'de.monkeyworks.buildmonkey.pde.UiTestPlugin'

      uiTest {
          applicationName 'org.eclipse.swtbot.eclipse.junit.headless.swtbottestapplication'
          application 'de.buildmonkey.application.Application'
          testClass 'de.buildmonkey.uitest.UITests'
          testBundle 'de.buildmonkey.uitest'
          product 'Product.product'
          consoleLog true
          debug false
          debugPort 8998
          testTimeoutSeconds 3600
          isTestClass {
            return it.getName() != '_Template.class' && !(it.getName() =~ /.+Support.class/ && !it.getName().contains('$'))
          }
      }
  }
}
  • applicationName - RCP executer application to start.
  • application - Application class of the application to test.
  • testClass - Name of the class to execute, it should be a TestSuite with the real tests
  • testBunlde - (Symbolic) Bundle name of the bundle with the test class.
  • product - product file for the application, is optional
  • consoleLog - Turns on the log output to console if true.
  • debug - Turns on remote debugging if true.
  • debugPort - Port for the remote debug session.
  • testTimeoutSeconds - Seconds to wait for the test execution. If the tests need more time, they will be interruptes, if less the task will ends up earlier.
  • isTestClass - Closure to check a class, if it is a test class, not used at this moment, all tests must be defined in the test suite at the item testClass

Gradle tasks

There is only one task to call for executing all ui tests.

uiTest

This task executes the ui tests.

gradle uiTest