I am using cucumber 4.3.0 and I would like to send an ArrayList of String in one of my sentences. It would give something like that:
Given I am on page <page>
When I do stuff
Then keywords "toto, tata, titi" are here
So far, I have thought of splitting the String "toto, tata, titi" into an Array (using "," as separator) however, I'm wondering if there are any cleaner solution?
I have tried doing this:
Given I am on page <page>
When I do stuff
Then the following keywords are here: toto, tata, titi
With
@Then("^the following keywords are here: (.*)$")
public void theFollowingKeywordsAreHere(List<String> datas) {
//some code
}
But I get the following error:
cucumber.runtime.CucumberException: Could not convert arguments for step ...
...
Caused by: io.cucumber.cucumberexpressions.CucumberExpressionException: ParameterType {anonymous} failed to transform [toto, tata, titi, tutu] to java.util.List<java.lang.String>
So, any idea on how to make that work without using the string split solution?