我是JBheave和Hive框架的新手.
在探索Q&A存储库时,我碰巧看到以下短语来自对问题的正确答案之一, -
这就是我所见过的 - 应该使用@ BeforeScenario/@ AfterScenario方法设置/清除数据对象.
目前我正在撰写测试故事.然而,没有进一步进入步骤.
从JBehave产品网站,我得到以下示例测试故事.考虑到我从StackOverFlow的Q&A回购中插入的短语,我有问题.
A story is a collection of scenarios
Narrative:
In order to communicate effectively to the business some functionality
As a development team
I want to use Behaviour-Driven Development
Lifecycle:
Before:
Given a step that is executed before each scenario
After:
Outcome: ANY
Given a step that is executed after each scenario regardless of outcome
Outcome: SUCCESS
Given a step that is executed after each successful scenario
Outcome: FAILURE
Given a step that is executed after each failed scenario
Scenario: A scenario is a collection of executable steps of different type
Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event
Scenario: Another scenario exploring different combination of events
Given a [precondition]
When a negative event occurs
Then a the outcome should [be-captured]
Examples:
|precondition|be-captured|
|abc|be captured |
|xyz|not be captured|
Run Code Online (Sandbox Code Playgroud)
就像@ BeforeScenario/@ AfterScenario在这里一样,我可以看到相同的东西.
我在这里有问题.我是否可以在测试故事中Given前后编写具体内容Scenario:.
并且该Scenario:输出是否Scenario:在测试故事中连续打开.
@ BeforeScenario/@ AfterScenario注释和生命周期:前/后步骤之间存在一些差异
Lifecycle:
Before:
Given a step that is executed before each scenario with some parameter = 2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3900 次 |
| 最近记录: |