Jubula API

the basics

Exercise 0

Check prerequisites 1

  1. Tools installed: JDK 8 + Samples
    
    >java -version
    java version "1.8.0_144"
  2. Jubula ready: AUT-Agent and ITE

DEMOnstrate

Exercise 0

Check prerequisites 2

  1. Eclipse for Committer (PDE)
  2. Tutorial git repo cloned and up-to-date
    
        git clone https://github.com/open-co-de/
                          tutorial-jubula-api.git
  3. Project imported, target platform set, no compile errors
    
        o.e.j.e.a.j.j.e.osgi/ide/api-OSGi.target

DEMOnstrate

Jubula

AUT-Agent

AUT

CAPs

Object Mapping

Jubula

the big picture

AUT-Agent

controls the AUTs lifecycle


AUTAgent agent = MakeR.createAUTAgent("hostname", 4711);
         agent.connect();
[...]
         agent.startAUT(...);
         agent.stopAUT(...);
[...]
         agent.disconnect();

Exercise01.java


launch/Exercise01.launch

right-click -> Run As -> JUnit

Connect to AUT-Agent

Disconnect from AUT-Agent

DEMOnstrate

AUT

Application under Test

Exercise02.java

Connect to AUT-Agent

Starting the AUT

Stopping the AUT

Disconnect from AUT-Agent

AUT Configuration

information to create and manage process


AUTConfiguration config = new JavaFXAUTConfiguration(
                "arbitrary name for AUT",
                "AUT-ID",
                "command",
                "workingDirectory",
                new String[]{"arg0", "arg1"});
[...]
AUTAgent agent.startAUT(config);
[...]
    

LocalSettings.java

Adjust path to AUTs JAR


public static AUTConfiguration myAUTStartConfig() {
    return new JavaFXAUTConfiguration(
            "My first AUT",
            "Ensemble8_AUT_ID", 
            "java",
            "/pathToEnsembleJAR/",
            new String[] { "-jar", "Ensemble8.jar" }
    );
}

then run: Exercise02.java

DEMOnstrate

CAPs

UI object proxies


// independent from AUTs UI state
Application app = JavafxComponents.createStage();
CAP waitForWindow = app.waitForWindow(...);
[...]

// execution in AUTs context
Result result = m_aut.execute(waitForWindow, ...);
[...]
    

Exercise03.java

Execute your first UI test

fix test specification problem

DEMOnstrate

Object Mapping

required for nearly all CAPs

Application and MenuBar use "default mapping"

represents GUI widget instance in source code

Exercise04.java

search for "FXML Login Demo"

Exercise04o.java

launch AUT

collect search textfield

DEMOnstrate

Exercise04.java

add component identifier into OM.java

run Exercise04

DEMOnstrate

Exercise05.java

enter username and password:


"demo/demo"

and login afterwards

DEMOnstrate