Automation Packages
An Automation Package (formally called Executable Bundle) is a self-contained set of Plans and their related entities (Keywords, Parameters and Resources) that can be executed on a Step controller.
Supported formats: Automation Packages currently support Java as software platform. The format of an Automation Package for Java is a compiled jar containing Plans and their related entities as Java classes or resources. Additional software platforms like .NET might be supported in future releases.
Supported entities: Following entity types are currently supported:
- Plans in plain-text format (*.plan files)
- Inlined plain-text Plans using the newly introduced @Plan java annotation
- Java Keywords
- Inlined Parameters
Automation Package for Java
Keywords Declaration
The keyword are defined as usual, follow the dedicated documentation for more details.
Plans Declaration
An Automation Package for Java contains at least one Plan. Plans can either be specified in a .plan File following the plain-text format or as inline plain-text plan using the newly introduced @Plan java annotation.
Plain text plans
Plain text plans files can be simply added to an Automation Package as jar resource and have to be referenced by a class using the class annotation step.junit.runners.annotations.Plans. The class annotation @Plans specifies the list of plain text plan file names to be executed. Please note that these plain-text plan files have to be located within the same java package as the class declaring them.
Here’s a simple example of a class referencing 2 plan files:
@Plans({"MyPlan1.plan", "MyPlan2.plan"}) //Reference 2 plans in plain-text format
public class MyTestSet1 {
}
MyPlan1.plan located as resource in the same package as the class MyTestSet1:
"Open Chrome"
"Search in google" search="STEP"
MyPlan2.plan located as resource in the same package as the class MyTestSet1:
"Open Chrome"
"Search in google" search="exense"
Inline plans
Inline plans are plain text plans that are directly defined within a Java-Class using the method annotation step.junit.runners.annotations.Plan. Inline Plans are java methods annotated by the annotation @Plan. The value of the annotation declares the Plan in plain-text syntax. The implementation of the annotated method is ignored.
Here’s a simple example of a class containing one inline plan:
public class MyTestSetUsingInlinePlans {
@Plan("myKeyword")
public void myInlinePlan() {}
@Keyword
public void myKeyword() {
output.add("hello","world");
}
}
For simple Plans made of only one Keyword the above example can be shortcuted as follows:
public class MyTestSetUsingInlinePlans {
@Plan()
@Keyword
public void myPlanMadeOfOneKeyword() {
output.add("hello","world");
}
}
Execution parameters
Execution parameters can be defined using the class annotation step.junit.runners.annotations.ExecutionParameters.
Here’s an example of a class containing one inline Plan relying on one execution parameter declared by @ExecutionParameters:
@ExecutionParameters({"URL","https://url.com/"})
public class MyTestSetUsingInlinePlans extends AbstractKeyword {
@Plan("myKeyword")
public void myInlinePlan() {}
@Keyword
public void myKeyword() {
System.out.println(properties.get("URL"));
}
}