【问题标题】:Run common jBehave story运行常见的 jBehave 故事
【发布时间】:2013-12-12 07:40:34
【问题描述】:

我有一个如下的 jBehave 故事;

Scenario: Setup test

GivenStories: common/story_1.story,
              common/story_2.story#{0},  
              common/story_2.story#{1},  
              common/story_3.story

Then my setup is done

Examples:
| Field1 | Field2 |
| Value1 | Value2 |
| Value3 | Value4 |

现在你可以看到,我正在使用一些常见的故事。

对于每一组,我想按以下顺序运行;

故事 1 > 故事 2(带示例 1)> 故事 3

然后

故事 1 > 故事 2(带有示例 2)> 故事 3

但目前它是按以下顺序运行的;

故事 1 > 故事 2(带有示例 1)> 故事 2(带有示例 2)> 故事 3

如您所见,问题在于故事 2 被背靠背调用(每个示例)。

如何让它们在每个示例中单独运行?

【问题讨论】:

    标签: java selenium selenium-webdriver jbehave


    【解决方案1】:

    我认为你的问题可以通过在你的故事 1 和故事 3 中使用 @BeforeStory 和 @AfterStory 来解决。

    看看http://jbehave.org/reference/stable/annotations.html

    【讨论】:

      猜你喜欢
      • 2011-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多