Automatically add a tag for a Java Cucumber method

212 Views Asked by At

Currently I'm writing tests with Java, Selenium WebDriver and Cucumber with IntelliJ. When auto generating a method we are required to add an @step tag above the method for our report functionality.

Is there a way for me to automatically copy the tag from cucumber to another tag @ step above it in IntelliJ when I Alt+Enter to create the method from the feature file?

For example:

@When("^I am on the stackoverflow page$")
public void openStackOverflow(){
    ...
}

Would result in:

@Step("I am on the stackoverflow page")
@When("^I am on the stackoverflow page$")
public void openStackOverflow(){
    ...
}
0

There are 0 best solutions below