PHPackages                             thienthu1410/behat-html-formatter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. thienthu1410/behat-html-formatter

ActiveLibrary[Testing &amp; Quality](/categories/testing)

thienthu1410/behat-html-formatter
=================================

This will create a html formatter for Behat.

0477PHP

Since Feb 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/thienthu1410/behat-html-formatter)[ Packagist](https://packagist.org/packages/thienthu1410/behat-html-formatter)[ RSS](/packages/thienthu1410-behat-html-formatter/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

BehatHtmlFormatterPlugin
========================

[](#behathtmlformatterplugin)

Suggestions are more than welcome !

This is a behat 3 extension to generate HTML reports from your test results.

Add this to your behat.yml file:

```
formatters:
    html:
        output_path: %paths.base%/build/html/behat
  extensions:
    thienthu1410\BehatHTMLFormatter\BehatHTMLFormatterExtension:
        name: html
        renderer: Twig
        not_count_tag: suite-setup,suite-teardown
        file_name: Index
        print_args: true
```

The *output* parameter is relative to %paths.base% and, when omitted, will default to that same path.

The *renderer* is the renderer engine and the report format that you want to be generated.

The *file\_name* is optional. When it is added, the report name will be fixed instead fo generated, and this file will be overwritten with every build.

The *not\_count\_tag* is optional. When it is added, the scenarios having the tag defined in *not\_count\_tag* will not be counted, but still be printed in detail. Apply for scenarios as suite-setup, or suite-teardown

Actually, there is 1 format :

- **Twig** : new report format based on Twig, **requires Twig installed**

You must specify the format that you want to use in the *renderer* parameter.

File names have this format : *"renderer name"*\_*"date hour"*

**Twig renderer only parameters:**

The *print\_args* is optional. When it is added, the report will contain the arguments for each step if exists. (e.g. Tables)

The *print\_outp* is optional. When it is added, the report will contain the output of each step if exists. (e.g. Exceptions)

To be done:
===========

[](#to-be-done)

1. Add parameters for behat.yml file
2. Add bootstrap as dependency
3. clean up html report
4. Add out parameter

Screenshots
===========

[](#screenshots)

Twig : [![](/images/reports_twig.PNG)](/images/reports_twig.PNG)

Analysis when viewing report:
=============================

[](#analysis-when-viewing-report)

[![](/images/overview_charts.PNG)](/images/overview_charts.PNG)

1. Overview charts
    - Feature charts: total number of features, how many features passed, how many features failed
    - Test Case charts: total number of test cases, how many test cases passed, how many test cases failed. Each test case is mapped with a scenario description in suite.
    - Scenario charts: total number of scenarios, how many scenarios passed, how many scenarios failed. Each scenario is mapped with a single scenario or and example in scenario outline
    - Examples about test cases and scenarios
        - Example 1: 1 test case, 1 scenario

         ```
         Scenario: test 1
             Given I am on "aaa"
             Then the url should match "aaa"

        ```

        - Example 2: 1 test case, 2 scenarios

         ```
         Scenario Outline: test 1
           Given I am on ""
           Then the url should match ""
           Examples:
             | page | url |
             | aaa  | aaa |
             | aaa  | bbb |

        ```

        - Example 3: 2 test cases, 2 scenarios ```
            Scenario: test 1
                Given I am on "aaa"
                Then the url should match "aaa"
            Scenario: test 2
                 Given I am on "bbb"
                 Then the url should match "bbb"
            ```
        - Example 4: 2 test cases, 3 scenarios ```
            Scenario: test 1
                Given I am on "aaa"
                Then the url should match "aaa"
            Scenario Outline: test 2
                Given I am on ""
                Then the url should match ""
                Examples:
                  | page | url |
                  | aaa  | aaa |
                  | aaa  | bbb |
            ```
2. Suite overview [![](/images/overview_suite.PNG)](/images/overview_suite.PNG)

- Contains all features run in the suite.
    - At the top of each feature, there is info about the feature description
    - At the bottom of each feature, there is info about how many test cases of that feature passed/failed. The number of failed test cases is in the red region, and the number of passed test cases is in the green region. There is also info about the feature's tags

3. Feature details
    - Click the feature in the suite overview above to view a feature in detail [![](/images/feature_details.PNG)](/images/feature_details.PNG)
    - Contains:
        - The feature overview (feature description, feature's tag)
        - The test cases of the features. Each test case contains info about the total number of scenarios, how many scenarios of test case passed, how many scenarios of test case failed, test case description, tags of test case. Click the scenario to view scenario details (includes scenario description, scenario's tags, all steps of scenario/passed step, failed step/reason why failed)
        - If the test case is not counted (has tags defined as *not\_count\_tag* in behat.yml), it will not have the info number of scenarios in total/passed scenarios/failed scenarios
        - Between each test case is a line break to separate them

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/454557aabfd8f9ea4567ea5cfa7ac41e1f1937a7f25ec89dd04c6efb0de023de?d=identicon)[thienthu1410](/maintainers/thienthu1410)

---

Top Contributors

[![thienthu1410](https://avatars.githubusercontent.com/u/15967414?v=4)](https://github.com/thienthu1410 "thienthu1410 (9 commits)")[![thubuiTMA](https://avatars.githubusercontent.com/u/47205137?v=4)](https://github.com/thubuiTMA "thubuiTMA (1 commits)")

### Embed Badge

![Health badge](/badges/thienthu1410-behat-html-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/thienthu1410-behat-html-formatter/health.svg)](https://phpackages.com/packages/thienthu1410-behat-html-formatter)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
