Configuration Schema
Main Configuration {YAML}
The etr.yaml
configuration file has the following basic schema:
version: "1.0"
# By default test execution is randomized.
randomize: false
# List of plugins to load
plugins:
- "etr.plugins.robot" # Python plugin module
- (object)
The root
etr.yaml
configuration object.version
(“1.0”)Version field, in order to have the possibility to evolve schema with backwards compatibility.
Current value must be “1.0”.
plugins
(List[str]) default: []Python plugin modules to load. Each plugin amends the configuration schema with plugin specific configuration. For example the Robot Framework plugin
etr.plugins.robot
is configured via therobot
property.plugins: - "etr.plugins.robot"
See also
- List of plugins shipped with
etr
- List of plugins shipped with
randomize
(Optional[bool]) default: trueRandomize execution of tests. To reproduce a randomized order provide the random seed with
--seed
argument.
Robot Framework etr.plugins.robot
etr.plugins.robot is configured by the main configuration robot
property.
version: "1.0"
plugins:
- "etr.plugins.robot"
robot: # Robot Framework Main Configuration
Main Configuration {YAML}
Robot Framework plugin configuration.
- (object)
The etr.plugins.robot plugin configuration object under the
robot
root property.tests
(Union[List[str], Dict[str, Group]])Specifies either list of tests or groups containing lists of tests. If it is an object then each property specify a test group, see Test Group {YAML} for schema.
Example without groups:
tests: - "src/test.robot"
Example defining a group with name
group
:tests: "group": # Configures a group tests: - "src/test.robot" # Has test identifier "group/src/test.robot"
mergedName
(Optional[str])If provided it determines the top-level suite name for the merged report. It is optional and by default the name of the directory containing the configuration file (
etr.yaml
) is used.variables
(Optional[Dict[str, str]])Optionally specifies robot variables as key/value pairs. Only scalar strings are supported and each will be passed to robot using
--variable KEY:VALUE
.If variable is defined both in
variables
and in avariableFiles
the variable defined invariables
takes precedence.VARIABLE: "VALUE" ANOTHER_VARIABLE: "another value" EMPTY_STRING:
variableFiles
(Optional[List[str]])Optionally specifies robot variable files (
--variablefile
), each entry is the path to one of the supported variable file types: JSON, YAML or Python. Refer to the Robot Framework User Guide for details.Order is relevant and latter files takes precedence over preceding files.
Example with JSON, YAML and Python with arguments variable files:
variableFiles: - "src/resources/variables.json" - "src/resources/variables.yaml" - "src/resources/variables.py:argument"
Test Group {YAML}
- (object)
Structure for each test group.
tests
(List[str])Specifies the list of test files. The resulting test identifier is the concatenation of the parent group and the test name as
{group}/{test}
.variables
(Optional[Dict[str, str]])Like
variables
in the parent object but applies only to the local group. Overrides any variables with same name from parent object.variableFiles
(Optional[List[str]])Like
variableFiles
in the parent object but applies only to the local group.Order is relevant and latter files takes precedence over preceding files. Variable files specified in group takes precedence over variable files in parent object.
Resource Acquisition etr.plugins.resources
See etr.plugins.resources for documentation.
Main Configuration {YAML}
The etr.plugins.resources plugin configuration object under the resources
root property.
version: "1.0"
plugins:
- etr.plugins.resources
resources: # resources plugin configuration
"shutter": # resource name
type: "opcua-shutter" # resource type
- (object)
{resource}
(object)Abstract resource with that will use the name
{resource}
byetr
.type
(str)The type of resource that should be acquired.
tags
(List[str])The list of tags that must be associated with resource when acquiring.
Resources File
Schema for the resource file specified with --resource-file
.
Example:
version: "1.0"
plugins:
- etr.plugins.resources
resources: # etr.plugins.resources configuration
"lab-shutter-1":
type: "opcua-shutter"
tags:
- "v1"
attributes:
"server": "opc.tcp://134.171.12.186:4840"
"namespace": 4
"prefix": "MAIN.Shutter1"
"lab-shutter-2":
type: "opcua-shutter"
attributes:
"server": "opc.tcp://134.171.12.186:4840"
"namespace": 4
"prefix": "MAIN.Shutter2"
- (object)
version
(“1.0”)Version field, in order to have the possibility to evolve schema with backwards compatibility.
resources
(object)Dictionary of available resources. Each resource is defined by a resource-id and associated properties.
{resource-id}
(object)Defines properties for the resource “{resource-id}”.
type
(str)Main type of resource, used to filter and select resources. By convention the type should allow users to assume the schema of the associated attributes.
tags
(List[str])List of tags associated with resource, used to filter and select resources.
attributes
(Any)Generic attibutes that will made available to user.
Jinja2 Templates etr.plugins.jinja2
See etr.plugins.jinja2 for documentation.
Example use in etr.yaml
:
version: "1.0"
plugins:
- "etr.plugins.jinja2"
jinja2:
files:
- "src/first.j2": "src/first"
- "src/second.j2": "src/second"
Main Configuration {YAML}
The etr.plugins.jinja2 plugin configuration object under the jinja2
root property.
- (object)
files
(List[JinjaFile])List of Jinja2 templates to render.
- "src/config.yaml.j2": "src/config.yaml" - "src/variables.yaml.j2": "src/variables.yaml"
Jinja2 File {YAML}
Specifies a single mapping for how to render a jinja2 file source
-> destination
.
Example:
"src/config.yaml.j2": "src/config.yaml"
- (object)
{source}
(str)Jinja2 template source file.
{destination}
(str)Destination for rendered template.