Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Triquetrum/RCP testing"

(Created page with "== 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 element...")
 
Line 19: Line 19:
  
 
=== Triquetrum UI tests in RCPTT IDE ===
 
=== Triquetrum UI tests in RCPTT IDE ===
You can download the RCPTT IDE for your environment from [https://www.eclipse.org/rcptt/download/ here]. I've used the 2.3.0 build for Windows 64-bit.
+
==== Preparation ====
 +
# You can download the RCPTT IDE for your environment from [https://www.eclipse.org/rcptt/download/ here]. I've used the 2.3.0 build for Windows 64-bit.
 +
# Create a Triquetrum build, or download it from the [https://hudson.eclipse.org/triquetrum/job/triquetrum/ Triquetrum build server].
 +
# Clone the [https://github.com/eclipse/triquetrum Triquetrum repository]
 +
# Import the project ''tests/org.eclipse.triquetrum.rcptt.test'' in your RCPTT IDE workspace
  
Create a Triquetrum build, or download it from the [https://hudson.eclipse.org/triquetrum/job/triquetrum/ Triquetrum build server].
+
==== 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>
 +
          <!-- This element describes where to get an AUT to run tests -->
 +
          <aut>
 +
            <!-- There are several ways to specify AUT location,
 +
                Uncomment an element corresponding to a most suitable way
 +
            -->
 +
            <!-- Use AUT from current build results. [classifier] will be
 +
            automatically replaced according to the current platform -->
 +
            <!--
 +
            <explicit>${project.basedir}/../product/target/products/org.eclipse.ui.examples.rcp.browser.product-[classifier].zip</explicit>
 +
            -->
 +
            <!-- Or specify a path to AUT folder -->
 +
            <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.

Revision as of 09:03, 30 June 2017

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