allure-java icon indicating copy to clipboard operation
allure-java copied to clipboard

Allow customizing automatic step name format

Open theangrydev opened this issue 5 years ago • 2 comments

I'm submitting a ...

  • [x] feature request

What is the current behavior?

When using @Step with no name given, the method name is used directly as the step name. There is no way to customize how the step name is translated into a string.

What is the expected behavior?

I would like the ability to specify a function that takes the method name and translates it into the display string.

For example, I might translate givenUserHasLoggedIn to Given user has logged in inserting spaces and capitalizing.

Also related issue https://github.com/allure-framework/allure2/issues/331 would help to put some simple HTML formatting e.g. <b>Given</b> user has logged in with a bold first word.

What is the motivation / use case for changing the behavior?

Improve readability of automatic step names. Have some simple formatting to BDD Given/When/Then first words of step names.

Please tell us about your environment:

Any

theangrydev avatar Oct 27 '20 13:10 theangrydev

Hello, will it be implemented?

paul-gladoon avatar May 11 '23 11:05 paul-gladoon

You can now use io.qameta.allure.listener.StepLifecycleListener or io.qameta.allure.listener.TestLifecycleListener to post-process the report data, including step names.

baev avatar May 11 '23 15:05 baev