Jbehave - Annotation

来源:互联网 发布:fast迅捷网络登录密码 编辑:程序博客网 时间:2024/06/04 18:11


1. method step annotations:

  • @Given
  • @When
  • @Then
  • @Alias
  • @Aliases(当一个method可以被多个 step 使用时)
  • @Pending( 当当前还不能确定时)

  • Each step candidate corresponds to one Java method and to oneStepTyp

 Note that each method can supports aliases and a different step candidate is created for each alias.

2.  method scenario annotations:

  • @BeforeScenarioa
  • @AfterScenario

Optionally,theScenarioType can bespecified to execute only upon that type, e.g. for scenariosparametrised by examples. In addition, @AfterScenarioallows the setting of an optionalOutcome value,which specifies whether the method should be executed depending on the outcomeof the scenario:

3. method story annotations:

  • @BeforeStory
  • @AfterStory

The @BeforeStory and @AfterStory annotations allow the corresponding methods to be executed before and aftereach story, either aGivenStory ornot:

4. Behave supports the following method stories annotations:

  • @BeforeStories
  • @AfterStories

The @BeforeStories and @AfterStories annotations allow the corresponding methods to be executed before and after acollection of stories: (如何选取story?)

5. parameter annotations:

  • @Named  ( 如何使用?)

Parameter annotations are used in parameterinjection.

6. configuration annotations:( 如何使用?)

  • @AsParameterConverter
  • @Configure
  • @UsingEmbedder
  • @UsingSteps
  • @UsingGuice
  • @UsingNeedle
  • @NeedleInjectionProvider
  • @UsingPico
  • @UsingSpring


0 0