Cucumber:自动创建步骤文件?步骤、文件、Cucumber

2023-09-08 10:22:21 作者:转身一世

When i run cucumber it displays the possible steps that i should define, an example from the RSpec book:

1 scenario (1 undefined)
4 steps (4 undefined)
0m0.001s
You can implement step definitions for undefined steps with these snippets:
Given /^I am not yet playing$/ do
  pending
end
When /^I start a new game$/ do
  pending
end
Then /^the game should say "Welcome to CodeBreaker"$/ do
  pending
end
Then /^the game should say "Enter guess:"$/ do
  pending
end

Is there a way that it will automaticly create the step definitions file, so i don't have to rewrite or copy paste by hand but i can just to customize them to be more generic?

解决方案 TheCucumberBook Web开发文档类资源 CSDN下载

Cucumber doesn't offer this feature. Probably because you would have to tell it where to put the step definitions file, and what to name it.