YAML Tag¶
!argument
: Define an argument¶
Using !argument
tag, you can define an argument placeholder,
which is filled with argument options given on run time or Parameterized Test.
A not filled argument is regarded as null
value.
!include
: Including other YAML files¶
Using !include
tag, you can include other YAML files.
This tag is available anywhere in your scenario.
!include path/to/other.yaml
A good practice of this feature is locating subscenarios on subdirectories.
label: Subscenario inclusion example
subscenarios:
- !include subscenarios/subscenario1.yml
- !include subscenarios/subscenario2.yml
UNIX-like wildcard expansion is available. A wildcard inclusion results in the list of matching inclusion.
!include path/to/*.yml
Note
Anchors in a included YAML are not available in including YAMLs, because the included YAMLs are parsed after the including YAML is parsed.
Note
Names of included files should not contain any wildcard characters because not all of the wildcard expansion rules are covered.
!relative_datetime
: Give a relative datetime value with a format¶
Using !relative_datetime
tag, you can give a datetime with a format
relating to the executing datetime.
!relative_datetime
delta: -60 seconds
format: "%Y-%m-%d %H:%m:%s"
Key |
Type |
Default |
Description |
---|---|---|---|
delta |
|
The duration from the origin to the desired datetime. |
|
format |
|
The datetime format, Which is used not only to dump a datetime value but also to parse the compared datetime value. |
When simply given as a string, the value is regarded as delta
.
# These expressions have the same meaning.
- !relative_datetime 3 days
- !relative_datetime
delta: 3 days
Duration¶
A Duration
is given as a combination of one or more string values in particular formats.
- When given time such like
12:34+01:00
, then uses the combination of the relative date and the given time. When given plural time like
12:34+01:00 23:45+02:00
, even though it has no reasonable meaning, then uses the last part (23:45+02:00
).
- When given time such like
- When given an offset, then uses the datetime that the request starts.
Days, hours, minutes and seconds offsets are available.
When given a positive offset like
1 day
or+2 hours
, then uses the future datetime.When given a negative offset like
-1 minute
or-2 seconds
, then uses the past datetime.- When given plural offsets like, then uses the total offset.
1 hour 2 minutes
means “62 minutes later”.Note that
-1 hour 2 minutes
means “58 minutes ago”. It is interpreted as-1 hour
plus+2 minutes
.
now
means zero offset, the same as0 second
.
Here are some examples:
now
: just the evaluation starts.1 day
: after a day later.+1 hour +1 minute
: an hour and a minute later.-1 hour -2 minutes
: an hour and two minutes ago.12:34+01:00
: the combination of the date that the evaluation starts and time 12:34 with an hour time difference between London.+1 day +2 hour 12:34+01:00
: the combination of the date that is an hour and two minute later and time 12:34 with an hour time difference between London.
Note
A Duration
can also be an absolute datetime
to be compatible with matcher arguments such like be_before
.
Timestamp Format¶
When given
iso8601
, then the format is an ISO 8601 format.When given another string, then the format is regarded as a format string in format codes, almost all of which are required by 1989 C standard.
!context
: Use a Contextual value¶
Use a contextual value of a given name. See context for details.