我有一个Specflow方案类似下面我可以在Specflow中重用场景吗?
Scenario: I Shoot a gun
When I pull the trigger
Then It should expel a bullet from the chamber
什么,我想是重用低于
Scenario: I Shoot a gun till there are no bullets left
Given I have a fun with 2 bullets in
And I Shoot a gun
And I Shoot a gun
Then There should be no bullets left in the gun
这种情况下,如代码在一刻起,我要重复场景中的所有步骤我拍枪像下面
Scenario: I Shoot a gun till there are no bullets left
Given I have a fun with 2 bullets in
When I pull the trigger
Then It should expel a bullet from the chamber
When I pull the trigger
Then It should expel a bullet from the chamber
Then There should be no bullets left in the gun
在这种情况下上述准许我只保存2个步骤,但在我的现实生活中的应用,我再节约在某些情况下写大约20+步。我相信能够调用场景使得阅读起来更容易,而不必担心隐藏的步骤。
这是可能的Specflow?
你的意思是重复使用步骤,例如“鉴于我有一枪有两颗子弹”? – 2012-08-02 00:23:10
否重用整个方案有点像功能。 – pengibot 2012-08-02 08:40:01