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 transformer
RenameTestCases is not included in default transformers, that’s why you need to call it with --transform
explicitly:
robotidy --transform RenameTestCases src
Or configure enabled
parameter:
robotidy --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:
robotidy --transform RenameTestCases -c RenameTestCases:replace_pattern=[A-Z]{3,}-\d{2,}: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:
robotidy --transform RenameTestCases -c RenameTestCases:capitalize_each_word=True
*** Test Cases ***
compare XML with json
No Operation
*** Test Cases ***
Compare XML With Json
No Operation