PHPackages                             reportportal/behat - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. reportportal/behat

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

reportportal/behat
==================

Specific classes to integrate Behat-baset test framework with Report Portal (http://reportportal.io/).

1.0.x-dev(7y ago)12.2k2[1 issues](https://github.com/Mikalai-Kabzar/agent-php-Behat/issues)MITPHP

Since Apr 7Pushed 6y agoCompare

[ Source](https://github.com/Mikalai-Kabzar/agent-php-Behat)[ Packagist](https://packagist.org/packages/reportportal/behat)[ Docs](https://github.com/Mikalai-Kabzar/ReportPortal-Behat)[ RSS](/packages/reportportal-behat/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Reporting with Report Portal agent for the Behat framework.
===========================================================

[](#reporting-with-report-portal-agent-for-the-behat-framework)

Preconditions
-------------

[](#preconditions)

1. Behat framework (version 3.4.1).
2. Report Portal (RP) instance.

Steps
-----

[](#steps)

### 1) Create in the Behat-based test framework's root folder ‘config.yaml’ file with next fields:

[](#1-create-in-the-behat-based-test-frameworks-root-folder-configyaml-file-with-next-fields)

UUID – your own access key.

Host – RP instance address.

projectName – name of project to create launches.

timeZone – your time zone.

[![](screens/config_1.png)](screens/config_1.png)

[![](screens/rp_profile_1.png)](screens/rp_profile_1.png)

[![](screens/rp_profile_2.png)](screens/rp_profile_2.png)

### 2) Update composer.json file of your framework with "reportportal/behat" : "1.0.x-dev", dependency.

[](#2-update-composerjson-file-of-your-framework-with-reportportalbehat--10x-dev-dependency)

[![](screens/composer_1.png)](screens/composer_1.png)

Note: "reportportal/behat" : "1.0.x-dev", was tested for behat 3.4.1 and phpunit 3.7.30.

### 3) Open terminal in the root folder and execute “composer update” command.

[](#3-open-terminal-in-the-root-folder-and-execute-composer-update-command)

[![](screens/composer_update.png)](screens/composer_update.png)

### 4) Update/create your "base feature context" class with next dependencies.

[](#4-updatecreate-your-base-feature-context-class-with-next-dependencies)

Note: BaseFeatureContext is a class that extends RawMinkContext class and implements Comtext and SnippetAcceptingContext interfaces. You can't create a Behat-based framework without this class.

```
use BehatReportPortal\BehatReportPortalAnnotations;
use BehatReportPortal\BehatReportPortalService;
use ReportPortalBasic\Service\ReportPortalHTTPService;

```

[![](screens/integration_1.png)](screens/integration_1.png)

The base feature context class should implement BehatReportPortalAnnotations.

### 5) Implement BehatReportPortalAnnotations’ methods in the basic context class (BaseFeatureContext on the picture above).

[](#5-implement-behatreportportalannotations-methods-in-the-basic-context-class-basefeaturecontext-on-the-picture-above)

```
public static function startLaunch(HookScope $event)
public static function startFeature(HookScope $event)
public static function startScenario(HookScope $event)
public static function startStep(HookScope $event)
public static function finishStep(HookScope $event)
public static function finishScenario(HookScope $event)
public static function finishFeature(HookScope $event)
public static function finishLaunch(HookScope $event)

public static function startLaunch(HookScope $event)
{
    if (!ReportPortalHTTPService::isSuiteRunned()) {
        ReportPortalHTTPService::configureReportPortalHTTPService('config.yaml');
        BehatReportPortalService::startLaunch($event);
    }
}

public static function startFeature(HookScope $event)
{
    if (!ReportPortalHTTPService::isFeatureRunned()) {
        BehatReportPortalService::startFeature($event);
    }
}

public static function startScenario(HookScope $event)
{
    if (!ReportPortalHTTPService::isScenarioRunned()) {
        BehatReportPortalService::startScenario($event);
    }
}

public static function startStep(HookScope $event)
{
    if (!ReportPortalHTTPService::isStepRunned()) {
        BehatReportPortalService::startStep($event);
    }
}

public static function finishStep(HookScope $event)
{

    if (ReportPortalHTTPService::isStepRunned()) {
        $pictureAsString = '';
        if ($event->getTestResult()->getResultCode() === TestResult::FAILED) {
            $session = Service::getSession();
            if ($session != null) {
                $pictureAsString = $session->getDriver()->getScreenshot();
            }
        }
        BehatReportPortalService::finishStep($event, $pictureAsString);
    }
}

public static function finishScenario(HookScope $event)
{
    if (ReportPortalHTTPService::isScenarioRunned()) {
        Service::sessionToNull();
        BehatReportPortalService::finishScenario($event);
    }
}

public static function finishFeature(HookScope $event)
{
    if (ReportPortalHTTPService::isFeatureRunned()) {
        BehatReportPortalService::finishFeature($event);
    }
}

public static function finishLaunch(HookScope $event)
{
    if (ReportPortalHTTPService::isSuiteRunned()) {
        BehatReportPortalService::finishLaunch($event);
    }
}

```

### 6) Each feature context class should extend BaseFeatureContext class that implements BehatReportPortalAnnotations interface and methods.

[](#6-each-feature-context-class-should-extend-basefeaturecontext-class-that-implements-behatreportportalannotations-interface-and-methods)

[![](screens/integration_2.png)](screens/integration_2.png)

### 7) Run auto-tests to check RP integration.

[](#7-run-auto-tests-to-check-rp-integration)

[![](screens/rp_check_1.png)](screens/rp_check_1.png)

[![](screens/rp_check_2.png)](screens/rp_check_2.png)

[![](screens/test_example_1.png)](screens/test_example_1.png)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

2595d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0a87776915993383d37df80484bdaa6f6ebe8578194e8799cd059d6461aba82?d=identicon)[Mikalai-Kabzar](/maintainers/Mikalai-Kabzar)

---

Top Contributors

[![Mikalai-Kabzar](https://avatars.githubusercontent.com/u/31204535?v=4)](https://github.com/Mikalai-Kabzar "Mikalai-Kabzar (53 commits)")

---

Tags

reportingreportBehatReport Portal

### Embed Badge

![Health badge](/badges/reportportal-behat/health.svg)

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

###  Alternatives

[jimmyjs/laravel-report-generator

Rapidly Generate Simple Pdf &amp; Excel Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy &amp; maatwebsite/excel)

580157.4k1](/packages/jimmyjs-laravel-report-generator)[reportico-web/reportico

Reportico Open Source PHP Report Designer

17120.5k2](/packages/reportico-web-reportico)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)[aspose-cloud/aspose-words-cloud

Open, generate, edit, split, merge, compare and convert Word documents. Integrate Cloud API into your solutions to manipulate documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction.

32157.4k](/packages/aspose-cloud-aspose-words-cloud)[scheb/tombstone-analyzer

Generates reports based on the logs from scheb/tombstone-logger

28378.1k2](/packages/scheb-tombstone-analyzer)[silverstripe/securityreport

Generates a security and access report for CMS users

10292.1k4](/packages/silverstripe-securityreport)

PHPackages © 2026

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