55.7 YAML syntax of the Procedure call definition node
This section covers the YAML syntax for configuring a Procedure call definition.
Only basic knowledge of YAML syntax is required to configure the Procedure call definition node. A brief overview can be found in the chapter Install CustomWebResolver node – Syntax.
A Procedure call definition refers to a specific procedure. In the YAML code, multiple node combinations can be specified for this procedure which, when they occur in the specified order, are converted into a Procedure call.
Each individual definition must conform to the following syntax:
| YAML entry | Description |
|---|---|
| name-of-the-definition: | |
| priority: | |
| sequential group: | or choice group: or unsorted group: |
| expected nodes: | The section contains the list of expected nodes |
| - sequential group: | or - choice group: or - unsorted group: |
| Entries as for top-level groups | |
| repeat/occurrences: | "repeat" or "occurrences" depending on group type |
| min: | Default for "repeat" is 1, for "occurrences" is 0 |
| max: | Default for "repeat" is 1, for "occurrences" is 1000 |
| - node: | |
| node type: your-node-name | Best changed via the edit button |
| attributes: | List of node attributes and states, depending on "node type" |
| your-attribute: attribute-value | Best added via the edit button |
| component: | |
| id: your-component-id | see Placeholders for component nodes |
| classes: | List of classes separated by spaces, or expand section. Best changed via edit button |
| name: expected-component-name | see Placeholders for component nodes |
| feature: expected-component-feature | see Placeholders for component nodes |
| extra features: | |
| subindexX: | Index of a sub-element. Best added via edit button |
| subindexseparatorX: | Values: "@", "&" or "%" |
| scope: | |
| condition: | Single-line expression in the scripting language of Script language |
| repeat/occurrences: | "repeat" or "occurrences" depending on group type |
| min: | Default for "repeat" is 1, for "occurrences" is 0 |
| max: | Default for "repeat" is 1, for "occurrences" is 1000 |
| set procedure call parameters: | Multiple parameters can be specified in this section |
| your-parameter: | free text, must be unique within the section |
| value: | Short form possible; empty string possible |
| overwrite option: | Values: "setifempty" (default), "replace", "append" |
| separator: | Separator for "overwrite option: append", default "|||" |
| set variable for return value: | |
| name: | Short form possible. Default is empty string |
| local: | "true" or "false". Default Enable 'Local variable' attribute by default |
| doctags: | List of doctags for the comment of the procedure call |
| your-doctag-name: your-doctag-value | freely selectable name and value |
The selection menu that opens via the edit button
next to the line numbering adapts to the current context and shows all applicable
actions for the currently selected line.
Use this menu to get an overview of possible actions. Another advantage of the menu
is that the correct syntax is provided automatically.
In the following, all YAML configuration sections and their sub-sections are briefly explained.
55.7.1 Individual definition
name-of-the-definition: priority: sequential group: # or choice group: or unsorted group::
A Procedure call definition node can contain multiple individual definitions, each defining different node sequences that apply to the same procedure call.
An individual definition must contain at the top level either a
sequential group, a
choice group, or an
unsorted group.
It can also contain a priority specification: priority.
55.7.2 priority
The order in which individual definitions are evaluated is determined firstly by the order in which they appear in the test suite and included test suites. The order in which test suites are included is relevant. (For information on including test suites see Include files.) Additionally, a positive integer can be assigned as the priority. Definitions with higher values are evaluated first. For definitions with equal values, the order in the test suites is used again. For more information see the order of definition evaluation in Mapping procedure structures.
When Procedure call definitions are created automatically, the priority is determined as described in Priority.
Default value: 0
Parent section: Individual definition.
55.7.3 sequential group
sequential group at top level:
sequential group:
expected nodes:
sequential group as a sub-group:
sequential group:
expected nodes:
repeat/occurrences:
The nodes and sub-groups listed under expected nodes must appear in the specified order.
It can also specify how many times the group can repeat; see repeat/occurrences.
Parent section: Individual definition or expected nodes.
55.7.4 choice group
choice group at top level:
choice group:
expected nodes::
choice group as a sub-group:
choice group:
expected nodes:
repeat/occurrences::
Exactly one of the nodes and sub-groups listed under expected nodes must match.
It can also specify how many times the group can repeat; see repeat/occurrences.
Parent section: Individual definition or expected nodes.
55.7.5 unsorted group
unsorted group at top level:
unsorted group:
expected nodes::
unsorted group as a sub-group:
unsorted group:
expected nodes:
repeat/occurrences::
The nodes and sub-groups listed under expected nodes can appear in any order.
It can also specify how many times the group can repeat; see repeat/occurrences.
Parent section: Individual definition or expected nodes.
55.7.6 expected nodes
expected nodes: - sequential group: - choice group: - unsorted group: - node:
A list of expected nodes or sub-groups of nodes.
Parent section: sequential group or choice group or unsorted group.
55.7.7 node
- node:
node type:
attributes:
component:
condition:
repeat/occurrences:
set procedure call parameters:
set variable for return value: #
doctags:
This section contains entries that specify the expected node,
entries relating to the Procedure call to be created,
and one for the number of repetitions of the node.
Parent section: expected nodes.
55.7.8 node type
This entry specifies the node type. Each node type has an associated value.
The easiest way to find the value is to click the edit button
next to the line numbering, choose Change "node type" from the list,
and then select the appropriate node type. In this list, the values correspond to
the node names as displayed in the test suite tree or as the heading of the node
details.
Parent section: node.
55.7.9 attributes
attributes:
your-attribute: attribute-value
Here you can specify node-specific attributes or states.
The available attributes depend on the node type.
Once you have entered the expected node type under
node type, click the edit button
to the left of the line number for - node:
and choose Add "attributes". All available attributes are inserted.
You can then set the desired values and delete any attributes that are not needed.
Information on the individual attributes can be found in the chapter Placeholders.
If component id is specified, the component
section is ignored. For more information on how component id is
evaluated, see Node attributes.
For check nodes, the Check type identifier can be specified in the
check type entry, e.g. text or item.
The special check type default accepts both default
and item during conversion.
Parent section: node.
55.7.10 component
component:
id: your-component-id
classes:
name: expected-component-name
feature: expected-component-feature
extra features:
subindexX:
subindexseparatorX:
scope:
This section can contain the entries listed in the "YAML" column of Placeholders for component nodes.
If id is specified, only the sub-index entries and, if applicable,
scope are evaluated. The latter only applies if the option
Name override mode (record) has the value
Name overrides everything. (In this case, specifying a scope is
only necessary if the option did not always have the value
Name overrides everything during component recording.)
Extra features are entered in the
extra features section.
A parent component can be specified in the
scope section.
Parent section: node.
55.7.10.1 classes
The classes specified here are found in the Class name attribute or
the Extra features of a component node. Classes including class type (extra
feature qfs:type) can also be specified.
In this section you can use the YAML short form to specify one or more classes, separated by spaces, directly after the section name. When the section is expanded, the classes are listed on individual lines below the section name.
Parent section: component.
55.7.10.2 extra features
In this section, the names of the Extra features relevant for the definition are used as keys.
Parent section: component.
55.7.10.3 subindexX
Specifies the index of a sub-element. X must be replaced by
a number here. subindex0 stands, for example, for the index a list entry,
or for the column index in a table. subindex1 would denote an element within
a list entry, if present. In tables, subindex1 stands for the row index.
Parent section: component.
55.7.10.4 subindexseparatorX
Specifies the index type: "@" for a text index, "&" for a numeric index,
"%" for a regular expression. X must be replaced by
a number here, like in subindexX
Parent section: component.
55.7.10.5 scope
In this section, a parent component can be specified via id,
name, feature, or extra features.
If an id has been entered in the
component section, the scope is only evaluated if
the option Name override mode (record) has the value
Name overrides everything.
If a component id has been entered in the
attributes section, the scope is not
evaluated.
Parent section: component.
55.7.11 condition
The condition can contain any single-line expression in the Script language specified.
Parent section: node.
55.7.12 set procedure call parameters
set procedure call parameters:
your-parameter:
This section contains a list of parameters to be entered into the Variable definitions of the procedure call to be created. The parameter names correspond to the names of the YAML entries. They must be unique.
Parent section: node.
55.7.13 your-parameter
The short form of a parameter entry consists of name and value on one line:
your-parameter-name: your-parameter-value
When the parameter entry is expanded, you can specify how an existing value for a parameter with this name is handled:
your-parameter-name:
value: your-parameter-value
overwrite option: setifempty
separator: |||
This section contains the parameters to be entered into the procedure call to be created. The parameter names correspond to the names of the YAML entries. They must be unique.
The parameter value can also be empty. In this case nothing needs to be specified after the colon.
Parent section: set procedure call parameters.
55.7.14 overwrite option
If multiple nodes in a definition contribute to the same parameter, this controls how an existing value is handled:
setifempty(default)- The parameter value is only set if no value exists yet for this parameter. This option is suitable when the first matching node should provide the definitive value and later nodes must not override it.
replace- An existing parameter value is always overwritten. This option is suitable when the last matching node should provide the decisive value, or when a previously set placeholder value should be replaced by the actual value.
append-
The new value is appended to the existing parameter value. If the existing
value is still empty, the new value is entered directly without a separator.
The separator between the old and new value can be configured via
separator(default|||). This option is useful when multiple nodes together build up a parameter value, e.g. to combine values from consecutive events into one parameter.
Parent section: your-parameter.
55.7.15 separator
Only relevant for the
overwrite option option with
the value append.
Specifies the separator to be placed between the existing and the newly appended
value. Default value: |||.
Parent section: your-parameter.
55.7.16 set variable for return value
Here you can specify which variable name should be entered in the Variable for return value attribute of the created procedure call.
The short form of the Variable for return value entry consists of the section name and the variable name on one line:
set variable for return value: your-variable-name
When the entry is expanded, you can override the default from the option Enable 'Local variable' attribute by default for Local variable:
set variable for return value: variable name: your-variable-name local variable:
By default the variable name is empty.
Parent section: node.
55.7.17 doctags
doctags: your-doctag-name: your-doctag-value
Here you can specify which doctags should be entered in the comment of the created procedure call. The name of the YAML entry corresponds to the name of the doctag. A value does not have to be specified. In this case only a doctag without a value is entered.
By default this section is empty.
Parent section: node.
55.7.18 repeat/occurrences
Depending on the group in which the entry is located, the section is named
either repeat or occurrences:
-
In a
sequential groupthe section name isrepeat, since the repeating nodes or groups must appear consecutively. -
In an
unsorted groupthe entry is namedoccurrencesand specifies how many times the node should appear in total within the group.
For the repeat section, a short form is possible when a specific
number of repetitions is expected:
repeat: number of repetitions
When the number of repetitions should lie between a minimum value (inclusive) and a maximum value (inclusive), the section can be expanded.
repeat: min: minimum number of repetitions max: maximum number of repetitions
In the repeat section the default value for both min
and max is 1.
Parent section for repeat:
node or
sequential group.
For the occurrences section, the minimum and maximum number of
occurrences must always be specified.
occurrences: min: minimum number of occurrences max: maximum number of occurrences
In the occurrences section the default value for min
is 0 and for max is 1000.
Parent section for occurrences:
node or
unsorted group.