我是 JBheave 和 Hive 框架的新手。
在探索问答存储库时,我碰巧从正确的问题答案之一中看到了以下短语,-
writing a JBehave story
That's what I've seen - and the data object should be setup/cleared with a @BeforeScenario/@AfterScenario method.
目前我正在编写测试故事。但不要进一步进入步骤。
从 JBehave 产品网站,我得到了以下示例测试故事。考虑到我从 StackOverFlow 的问答库中插入的短语,我有疑问。
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|
我可以在这里看到与@BeforeScenario/@AfterScenario 一样的内容。
我在这里有问题。我能写吗
Given
前后要具体Scenario:
在测试故事中。那是
Scenario:
输出对连续开放 Scenario:
在测试故事中。
最佳答案
@BeforeScenario/@AfterScenario 注释和 Lifecycle:Before/After 步骤之间存在一些差异
Lifecycle:
Before:
Given a step that is executed before each scenario with some parameter = 2
关于jbehave - @BeforeScenario/@AfterScenario 使用 Given 到测试故事中的特定场景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35646024/