OrderSettings¶
Order settings like [Arguments], [Setup], [Tags] inside Keywords and Test Cases.
Disabling the formatter
OrderSettings is included in the default formatters, but it can be also run separately with:
You can also disable it:
Test case settings [Documentation], [Tags], [Template], [Timeout], [Setup] are put before test case
body and [Teardown] is moved to the end of a test case.
Keyword settings [Documentation], [Tags], [Timeout], [Arguments], [Setup] are put before keyword
body and settings like [Teardown], [Return] are moved to the end of keyword.
Configure the order of the settings¶
The default order can be changed using the following parameters:
keyword_before = documentation,tags,arguments,timeout,setupkeyword_after = teardown,returntest_before = documentation,tags,template,timeout,setuptest_after = teardown
For example:
It is not required to overwrite all orders. For example, configuring only test_before and test_after keeps
keyword order as default.
Not all settings names need to be passed to a given parameter. Missing setting names are not ordered. Example:
It will order only test cases because all setting names for keywords are missing.
Setting name cannot be present in both before/after parts. For example keyword_before=tags keyword_after=tags
configuration is invalid because tags cannot be ordered both before and after. It is important if you are
overwriting the default order, since in most cases you need to overwrite both before/after parts.
This configuration is invalid because teardown is by default part of the test_after:
We need to overwrite both orders:
Settings comments¶
Comments next to settings will be moved together.