RenameTestCases¶
Enforce test case naming. This transformer capitalizes first letter of test case name removes trailing dot and
strips leading/trailing whitespaces. If capitalize_each_word
is True
, will capitalize each word in test case name.
Enabling the formatter
RenameTestCases is not included in default formatters, that’s why you need to call it with --select
explicitly:
robocop format --select RenameTestCases
Or configure enabled
parameter:
robocop format --configure RenameTestCases.enabled=True
It is also possible to configure replace_pattern
parameter to find and replace regex pattern. Use replace_to
to set a replacement value. This configuration:
robocop format --select RenameTestCases -c RenameTestCases.replace_pattern=[A-Z]{3,}-\d{2,} -c RenameTestCases.replace_to=foo
replaces all occurrences of given pattern with string ‘foo’:
*** Test Cases ***
test ABC-123
No Operation
*** Test Cases ***
Test foo
No Operation
Capitalize each word¶
If you set capitalize_each_word
to True
it will capitalize each word in the test case name:
robocop format --select RenameTestCases -c RenameTestCases.capitalize_each_word=True
*** Test Cases ***
compare XML with json
No Operation
*** Test Cases ***
Compare XML With Json
No Operation