serenity-bdd/serenity-cucumber-starter

Cucumber Expressions doesn't work?

edricklacbayo opened this issue · 5 comments

image

{string} doesn't work with the step definition.

image

image

Only this (.*) works

I still can't make it work.

You must use either cucumber expressions or reg exes in a given step definition - you cannot use both. Refer to the Cucumber docs for more details.

@wakaleo I can't seem to make the cucumber expression work. Does it not work if I have already used a Regex on a step definition or I am just using the cucumber expression in a wrong format?

I am also facing the same issue,

@given("{actor} open a browser and Web portal")
public void webPortalLogin(Actor actor) {
actor.wasAbleTo(GoTo.theWebPortalPage());
actor.wasAbleTo(GoTo.clickLogin());
}

@then("{actor} should see the search results matched with search {searchText}")
public void shouldSeeTheSearchResultsForSearchText(Actor actor, String searchText) {
actor.attemptsTo(GoTo.VerifySearchResults(actor,searchText);
}

@ParameterType(".*")
public Actor actor(String actorName) {
return OnStage.theActorCalled(actorName);
}

Error:
Undefined Parameter type {actor}, please register parameter type {actor}

@wakaleo @edricklacbayo