RenameTestCases¶
Enforce test case naming. This transformer capitalizes first letter of test case name, removes trailing dot and strips leading/trailing whitespaces.
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
Supports global formatting params: --startline
and --endline
.