Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Triquetrum/RCP testing

Automating RCP UI testing

As the Triquetrum editor is getting more features (e.g. repository view, dynamic palette etc) while we're still refactoring underlying elements and models, we need automated tests to prevent regression issues. With issue #249 an effort has started to implement such automated UI testing on Triquetrum's RCP workflow editor.

Eclipse RCPTT is already used by several projects of the science group (e.g. ChemClipse/OpenChrom) and with positive feedback. It promises GUI test automation for traditional RCP components and also GEF/Graphiti!

Some more info :

Getting started with RCPTT on Triquetrum

RCPTT can be used in two ways :

  • With the RCPTT IDE, test definitions are created & maintained as files in an Eclipse project.
  • The RCPTT maven plugin can be used to run tests in automated builds.

In both cases, a reference to the to-be-tested RCP application (Application Under Test a.k.a. AUT) must be configured. With the RCPTT IDE this typically means pointing to a local installation of a Triquetrum RCP. With the maven plugin it's possible to point to the product target folder where the build has stored its resulting product zip files. Other options to identify/locate the AUT are supported, check the RCPTT docs for more info on this.

Triquetrum UI tests in RCPTT IDE

Preparation

  1. You can download the RCPTT IDE for your environment from here. I've used the 2.3.0 build for Windows 64-bit.
  2. Create a Triquetrum build, or download it from the Triquetrum build server.
  3. Clone the Triquetrum repository
  4. Import the project tests/org.eclipse.triquetrum.rcptt.test in your RCPTT IDE workspace

Configuring the Triquetrum AUT

Creating new tests

Integrating in a maven build

The pom.xml file in the project org.eclipse.triquetrum.rcptt.test can be used to run local maven test builds. To try this out, you need to change the AUT directory to what is applicable on your system, in the <explicit> element in the POM :

 <build>
   <plugins>
     <plugin>
       <groupId>org.eclipse.rcptt</groupId>
       <artifactId>rcptt-maven-plugin</artifactId>
       <version>${rcptt-maven-version}</version>
       <extensions>true</extensions>
       <configuration>
         <aut>
           <explicit>C:/temp/triquetrum/repository/triquetrum</explicit>
...

When that is ok, you can run a plain mvn clean verify in the project directory, and you should see lots of logging and then Triquetrum popping up with stuff happening in the editor etc!

KNOWN issue : the test createConnectedHelloModel often fails in drawing the connection. It appears that the click/selection event often fails to pick the Constant.output port as start of the new connection. Instead the Graphiti context menu pops up. And then the test assertion fails that checks for the presence of the connection.

TODO : add it in our HIPP build, i.e. include it in the overall mvn build & change the AUT reference to the product build output folder.

Back to the top