behat/common-formatters

Behat 常用格式化程序

安装数: 82,698

依赖者: 2

建议者: 0

安全: 0

星标: 22

关注者: 8

分支: 11

公开问题: 2

类型:behat-extension

v1.2.0 2013-10-22 09:55 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:58:00 UTC


README

Build Status

Behat 的额外格式化程序聚合,这些程序被普遍使用。

安装

https://github.com/Behat/CommonFormatters/blob/master/doc/index.rst

在 xUnit 概念中区分错误和失败的格式化程序

Behat/Behat#111

  • 失败的步骤在 xUnit 中相当于错误。
  • 错误的步骤在 xUnit 中相当于失败(由格式化程序以洋红色着色)。
  • 实际上,错误的步骤也是失败的步骤,它只是对失败的步骤的精细解释(互补地,失败的步骤中也可以有非错误的步骤)。

ProgressWithFalseStepsFormatter

https://github.com/Behat/CommonFormatters/blob/master/src/Behat/CommonFormatters/ProgressWithFalseStepsFormatter.php

ProgressWithFalseStepsFormatter

PrettyWithFalseStepsFormatter

https://github.com/Behat/CommonFormatters/blob/master/src/Behat/CommonFormatters/PrettyWithFalseStepsFormatter.php

PrettyWithFalseStepsFormatter

HtmlWithFalseStepsFormatter

https://github.com/Behat/CommonFormatters/blob/master/src/Behat/CommonFormatters/HtmlWithFalseStepsFormatter.php

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

https://github.com/Behat/CommonFormatters/blob/master/src/Behat/CommonFormatters/CsvStatisticsFormatter.php

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