PHPackages                             sweetchuck/behat-tap-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. sweetchuck/behat-tap-formatter

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

sweetchuck/behat-tap-formatter
==============================

A TAP formatter for Behat

1.x-dev(3mo ago)10[2 issues](https://github.com/Sweetchuck/behat-tap-formatter/issues)GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Jan 31Pushed 3mo agoCompare

[ Source](https://github.com/Sweetchuck/behat-tap-formatter)[ Packagist](https://packagist.org/packages/sweetchuck/behat-tap-formatter)[ RSS](/packages/sweetchuck-behat-tap-formatter/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (15)Versions (1)Used By (0)

Behat TAP Formatter
===================

[](#behat-tap-formatter)

[![QA](https://github.com/Sweetchuck/behat-tap-formatter/actions/workflows/qa.yml/badge.svg?branch=1.x)](https://github.com/Sweetchuck/behat-tap-formatter/actions/workflows/qa.yml)[![codecov](https://camo.githubusercontent.com/446aa74d1583c120352e1172edbc2914d0fc2d1256c8052beaa09590d5e76ded/68747470733a2f2f636f6465636f762e696f2f67682f5377656574636875636b2f62656861742d7461702d666f726d61747465722f6272616e63682f312e782f67726170682f62616467652e7376673f746f6b656e3d5058485641553839354e)](https://app.codecov.io/gh/Sweetchuck/behat-tap-formatter-1.x/branch/1.x)

What is This?
-------------

[](#what-is-this)

A **TAP (Test Anything Protocol) formatter for Behat** that converts Behat test results into standardized TAP format. This formatter outputs test results in a machine-readable format that conforms to the [TAP 14 specification](https://testanything.org/tap-version-14-specification.html), enabling integration with CI/CD systems and tools that consume TAP output.

When to Use
-----------

[](#when-to-use)

- **CI/CD Integration**: Parse Behat test results programmatically in your CI/CD pipeline
- **Machine-Readable Reports**: Generate structured test output for automated analysis and reporting
- **Multi-Format Testing**: Combine TAP output with other test formatters to serve different needs
- **Test Aggregation**: Feed results into TAP harnesses that aggregate and report on multiple test suites
- **Platform Integration**: Use with TAP-compatible tools for reporting, parsing, and analysis

Configuration
-------------

[](#configuration)

**Command line:**`behat --config-reference`:

**Output:**

```
tap:
    # If TRUE then the exception trace is added into the YamlBlock when a test fails.
    show_trace:           true

    # Number of entries from the call stack to show. 0 to show all.
    # Used only when "show_trace" is TRUE.
    trace_depth:          3

    # Show steps as subtests.
    # Allowed values:
    # - never: Do not show the steps as subtest test points.
    # - on_failure: Shows the steps as subtest test points only when there was a failure.
    # - always: Always shows the steps as test points.
    show_executed_steps:  on_failure

    # When there was a failure, show the remaining steps as skipped test points.
    # This only makes sense when "show_executed_steps" is set to "on_failure" or "always".
    show_remaining_steps: false
```

**Quick starter**

```
default:
    extensions:
        Sweetchuck\BehatTapFormatter\TapFormatterExtension: ~
    formatters:
        tap:
            show_trace: true
            trace_depth: 3
            show_executed_steps: 'on_failure'
            show_remaining_steps: false
```

Run your tests:

```
behat --format='tap'
```

Configuration Options
---------------------

[](#configuration-options)

### `show_trace` (boolean, default: `true`)

[](#show_trace-boolean-default-true)

Include exception stack traces in the TAP YAML block when tests fail. Useful for debugging.

### `trace_depth` (integer, default: `3`)

[](#trace_depth-integer-default-3)

Number of stack trace entries to display. Set to `0` to show all entries. Only used when `show_trace` is `true`.

### `show_executed_steps` (string, default: `'on_failure'`)

[](#show_executed_steps-string-default-on_failure)

Control how individual steps are reported as subtests.

**Allowed values:**

- `'never'`: Don't show steps as subtest points
- `'on_failure'`: Show steps as subtest points only when a scenario fails
- `'always'`: Always show steps as subtest test points

### `show_remaining_steps` (boolean, default: `false`)

[](#show_remaining_steps-boolean-default-false)

When a failure occurs, show remaining steps as skipped test points. Only meaningful with `show_executed_steps` set to `'on_failure'` or `'always'`.

Output Examples
---------------

[](#output-examples)

```
Feature: My feature 01

  Scenario: My scenario 01
    Given I have a thing
    When I create a thing
    Then I see two things

  Scenario: My scenario 02
    Given I have a thing
    When something broke
    Then I see two things
```

**Configuration:**

```
show_trace: false
show_executed_steps: 'never'
show_remaining_steps: false
```

**Output:**

```
TAP version 14
ok 1 - default: My feature 01 | My scenario 01
not ok 2 - default: My feature 01 | My scenario 02
1..2

```

**Configuration:**

```
show_trace: false
show_executed_steps: 'on_failure'
show_remaining_steps: false
```

**Output:**

```
TAP version 14
ok 1 - default: My feature 01 | My scenario 01
# Subtest: Steps
    ok 1 - I have a thing
    not ok 2 - When something broke
    1..3
not ok 2 - default: My feature 01 | My scenario 02
  ---
  feature:
    title: 'Scenario step arguments'
    file: my-feature-01.feature
  scenario:
    title: 'My scenario 02'
    line: 8
  step:
    text: 'When something broke'
    line: 10
  message: 'Depends on the exception.'
  ...
1..2

```

**Configuration:**

```
show_trace: false
show_executed_steps: 'on_failure'
show_remaining_steps: true
```

**Output:**

```
TAP version 14
ok 1 - default: My feature 01 | My scenario 01
# Subtest: Steps
    ok 1 - I have a thing
    not ok 2 - When something broke
    not ok 3 - Then I see two things # SKIP previous step failed
    1..3
not ok 2 - default: My feature 01 | My scenario 02
  ---
  feature:
    title: 'Scenario step arguments'
    file: my-feature-01.feature
  scenario:
    title: 'My scenario 02'
    line: 8
  step:
    text: 'When something broke'
    line: 10
  message: 'Depends on the exception.'
  ...
1..2

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance66

Regular maintenance activity

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

98d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/591103?v=4)[Andor](/maintainers/Sweetchuck)[@Sweetchuck](https://github.com/Sweetchuck)

---

Top Contributors

[![Sweetchuck](https://avatars.githubusercontent.com/u/591103?v=4)](https://github.com/Sweetchuck "Sweetchuck (8 commits)")

---

Tags

behatformattertapBehattap

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sweetchuck-behat-tap-formatter/health.svg)

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

###  Alternatives

[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M1.9k](/packages/behat-behat)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[sensiolabs/behat-page-object-extension

Page object extension for Behat

1166.5M27](/packages/sensiolabs-behat-page-object-extension)[laracasts/behat-laravel-extension

Laravel extension for Behat

2611.3M12](/packages/laracasts-behat-laravel-extension)[imbo/behat-api-extension

API extension for Behat

1082.5M9](/packages/imbo-behat-api-extension)[dmarynicz/behat-parallel-extension

Parallel extension for Behat

27544.3k](/packages/dmarynicz-behat-parallel-extension)

PHPackages © 2026

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