Skip to content

How to modify content of "Set up" and "Tear down" within the Execution (Suites) #2665

Discussion options

You must be logged in to vote

By default, cucumber doesn't provide a way to change hook names. It's already introduced in the latest version of the cucumber protocol, but it is not yet available for Java. See cucumber/messages#73

As the solution, you can update the hook names using Allure Runtime API:

@Before("@hooks")
public void before() {
    Allure.getLifecycle().updateFixture(hook -> hook.setName("Human readable before name"));
    // do something
}

PS: Make sure you're using the latest version of allure-cucumber7-jvm (2.29.0 as of today) since I remember fixes were recently made for this particular use case.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@dariuszkanicki
Comment options

@baev
Comment options

@dariuszkanicki
Comment options

Answer selected by baev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants