参考地址:http://lettuce.it/reference/terrain.html
------------------------------------------------
------------------------------------------------
@before.all
This hook is ran before lettuce look for and load feature files
The decorated function takes NO parameters
[popexizhi]这个没有参数的应该相对于其他的比较特殊吧!全部feature文件加载前.
@after.all
This hook is ran after lettuce run all features, scenarios and steps
The decorated function takes a TotalResult as parameter, so that you can use the result statistics somehow
[popexizhi]这里的total应该是一个不错的出report的收集者,回头集成报告可以直接使用了。
---------------------------------------------------------------------------
@before.each_feature
@after.each_feature
[popexizhi]This hook is ran before/after lettuce run each feature
这里的要求参数是feature,下面例子是after的,这个可以看成测试用例集或测试suit吧!
-------------------------------------------------------------------------------
@before.each_scenario
@after.each_scenario
[popexizhi]This hook is ran before/after lettuce run each scenario.
感觉lettuce给了很充分的插槽处理位置,可以针对不同位置,一类位置的处理
-----------------------------------------------------------------------------------
@before.each_step
This hook is ran before lettuce run each step
The decorated function takes a Step as parameter, so that you can use it to fetch tables and so.
@after.each_step
This hooks behaves in the same way @before.each_step does, except by the fact that its ran after lettuce run the step.
[popexizhi] next看一下
django-specific hooks
Since lettuce officially supports Django, there are a few specific hooks that help on setting up your test suite on it.
@before.harvest
感觉lettuce的锚点定义好丰富啊,eg之后再来总结吧!
没有评论:
发表评论