behat / common-formatters
Behat 常用格式化程序
v1.2.0
2013-10-22 09:55 UTC
Requires
- php: >=5.3.2
- hasbridge/json-schema-validator: dev-master
- webignition/json-pretty-print: dev-master
Requires (Dev)
- behat/behat: ~2.4.0
- phpunit/phpunit: ~3.7.24
This package is not auto-updated.
Last update: 2024-09-14 15:58:00 UTC
README
Behat 的额外格式化程序聚合,这些程序被普遍使用。
安装
见https://github.com/Behat/CommonFormatters/blob/master/doc/index.rst
在 xUnit 概念中区分错误和失败的格式化程序
- 失败的步骤在 xUnit 中相当于错误。
- 错误的步骤在 xUnit 中相当于失败(由格式化程序以洋红色着色)。
- 实际上,错误的步骤也是失败的步骤,它只是对失败的步骤的精细解释(互补地,失败的步骤中也可以有非错误的步骤)。
ProgressWithFalseStepsFormatter
PrettyWithFalseStepsFormatter
HtmlWithFalseStepsFormatter
将套件运行的最重要信息以 JSON 格式输出的格式化程序
JsonFormatter
https://github.com/Behat/CommonFormatters/blob/master/src/Behat/CommonFormatters/JsonFormatter.php
{
date: "2012-11-20: 14:55:31",
features: [
{
"title": "A feature",
"desc": null,
"tags": [
"foo"
],
"result": "passed",
"scenarios": [
{
"title": "A scenario",
"isOutline": false,
"tags": [
"bar"
],
"result": "passed",
"steps": [
{
"text": "some precondition",
"type": "Given",
"isBackground": false,
"result": "passed"
},
{
"text": "some action",
"type": "When",
"isBackground": false,
"result": "passed"
},
{
"text": "some outcome",
"type": "Then",
"isBackground": false,
"result": "passed"
}
]
}
]
}
]
}
为每次套件运行向 CSV 文件添加新行的格式化程序
CsvStatisticsFormatter
execution date,total execution time,number of features,number of features with failures,number of scenarios,number of scenarios with failures,number of steps,number of failed steps
Fri 30 Mar 2012 11:36:57,2m44.987s,2,1,39,2,155,2