Executable bundles
An 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. It is a beta feature that has been introduced with Step 3.14.
Supported formats: Executable Bundles currently support Java as software platform. The format of an Executable Bundle 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
Executable bundle for Java
Declaration
An Executable Bundle 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 Executable bundle 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"));
}
}