I'd want to insert a predefined string into my step definition in Cucumber using java. Here's what I have:
Java Code
public String temp = "hello";
//insert temp into my step:
@Then("^the "+temp+" should be empty$")
public void the_should_be_empty() throws Throwable {
//do things
}
But I keep getting this error:
"The value for annotation attribute Then.value must be a constant expression"
So, how do I insert a string into my capturing step?
=============
More Info
I am trying to have a set list of "global keywords" used in many of my BDD step definitios. So when I add a new "global keyword", it will be changed in all my BDD. For example (red|yellow|green)
could be used in 10 different BDD steps, and I want to add blue
without changing all 10 steps. Instead I want a String variable that contains the list, then insert this variable into my BDD.