0
votes

When I execute the test in the terminal, cucumber provides me the snippet in string formats, but I have seen for some others the snippet in regular expression format.
How can I get cucumber to default to regular expression snippets?

Output I received:

Then("Show All button should be enabled") do

pending # Write code here that turns the phrase above into concrete actions

end

Instead of:

Then (/^Show All button should be enabled$/) do

pending # Write code here that turns the phrase above into concrete actions

end

Using:

Ruby: ruby 2.3.3p222
Cucumber: 3.1.0

1
Any specific reason, why you want in Regex Format ? String format looks pretty good to me. - Sudipta Mondal
@SudiptaMondal Then(/^Show (.*)/) do |what| covers all the tests starting with Show and one might use caught matches as block parameters. - Aleksei Matiushkin
@SudiptaMondal please refer this URL for the reason stackoverflow.com/questions/50850727/… - AVarma

1 Answers

0
votes

With the newer version of Cucumber, there is no option for regex output and started providing cucumber-expressions. The default transformations available are documented below

https://github.com/cucumber/cucumber-js/issues/731