PHPackages                             bookit/codeception-testrail - 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. bookit/codeception-testrail

ActiveLibrary

bookit/codeception-testrail
===========================

Codeception Extension for TestRail Reporting

1.0.0(9y ago)537.1k↓100%15[5 issues](https://github.com/bookitcom/codeception-testrail/issues)[1 PRs](https://github.com/bookitcom/codeception-testrail/pulls)MITPHP

Since Aug 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bookitcom/codeception-testrail)[ Packagist](https://packagist.org/packages/bookit/codeception-testrail)[ Docs](https://github.com/bookitcom)[ RSS](/packages/bookit-codeception-testrail/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Codeception TestRail Integration Module
=======================================

[](#codeception-testrail-integration-module)

This [Codeception](https://codeception.com) extension provides functionality for tests to report results to [TestRail](https://testrail.com) using the [TestRail API v2](http://docs.gurock.com/testrail-api2/start).

**Note:** The extension currently only supports the `Cest` Codeception test format. It cannot report PHPUnit or `Cept`tests.

Installation
------------

[](#installation)

The easiest way to install this plugin is using [Composer](https://getcomposer.org/). You can install module by running:

```
composer require --dev bookit/codeception-testrail

```

Theory of Operation
-------------------

[](#theory-of-operation)

The extension hooks the following Codeception events: `suite.after`, `test.success`, `test.skipped`, `test.incomplete`, `test.error`, and `test.fail`. The extension also provides an `_initialize()` method and some other helper methods.

During the `_initialize()` step, the module will fetch the project details and create a new plan for the run. The plan name can be procedurally generated but by default it will be the date and time formatted as *Y-m-d H:i;s*. Also during this step the default status list is overriden with any from the config.

During the `test.success`, `test.skipped`, `test.incomplete`, `test.error`, and `test.fail` events, a result is recorded for that event. TestRail Suites and TestRail Test Cases are set for the test using annotations (`@tr-suite` and `@tr-case`). The TestRail Suite can either be set at the class level or the method level; precedent is give to the method level annotation. The TestRail Test Case can only be set at the method level. Additionally, the elapsed time of the test will be formatted and recorded.

During the `after.suite` event, the collected results will be transmitted to TestRail. This is accomplished by performing two actions. The first action is to create a TestRail Test Plan Entry for each of the TestRail suites in the result set. The Test Plan Entry will only contain Test Cases which were also registered. The Test Plan Entry will be named after the Codeception suite and the TestRail suite, separated by a colon.

After the Test Plan Entry is created, the Test Run ID is captured from the response and the test results are transmitted using the bulk test result action. Before the results are passed to TestRail, they're filtered to remove any results which set the TestRail System Status of *Untested*. The TestRail API issues an error when a result attempts to set this status.

The default status map is:

Codeception StatusTestRail StatusTestRail Status IDsuccessSuccess1failureFailed5errorFailed5incompleteSuccess1skippedUntested3Configuration
-------------

[](#configuration)

The extension requires four configuration parameters to be set (`user`, `apikey`, `project`). There are additional configuration options for overriding statuses and disabling the connection to TestRail.

To enable the extension the following can be added to your `codeception.yml` config file:

```
extensions:
    enabled:
        - BookIt\Codeception\TestRail\Extension
```

Global configuration options (like the `user` and `apikey`) should also be set in the `codeception.yml` config:

```
extensions:
    config:
        BookIt\Codeception\TestRail\Extension:
            enabled: false                    # When false, don't communicate with TestRail (optional; default: true)
            user: 'mark.randles@bookit.com'   # A TestRail user (required)
            apikey: 'REDACTED'                # A TestRail API Key (required)
	  		url: 'https://myurl.testrail.com' # The base URL for you TestRail Instance
            project: 9                        # TestRail Project ID (required)
            status:
                success: 1                    # Override the default success status (optional)
                skipped: 11                   # Override the default skipped status (optional)
                incomplete: 12                # Override the default incomplete status (optional)
                failed: 5                     # Override the default failed status (optional)
                error: 5                      # Override the default error status (optional)
```

More Information
----------------

[](#more-information)

- [Codeception](https://codeception.com)
- [TestRail](https://testrail.com)
- [TestRail API](http://docs.gurock.com/testrail-api2/start)
- [TestRail API Keys &amp; Authentication](http://docs.gurock.com/testrail-api2/accessing#username_and_api_key)

License
-------

[](#license)

MIT

(c) BookIt.com 2016

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

3489d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e9363323d8c4e838f049a91032f447810318a99edd5cf13be0753e8c90d53bb?d=identicon)[bookitcom](/maintainers/bookitcom)

---

Top Contributors

[![randlem](https://avatars.githubusercontent.com/u/1175403?v=4)](https://github.com/randlem "randlem (1 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/bookit-codeception-testrail/health.svg)

```
[![Health](https://phpackages.com/badges/bookit-codeception-testrail/health.svg)](https://phpackages.com/packages/bookit-codeception-testrail)
```

###  Alternatives

[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15311.3M23](/packages/magento-magento2-functional-testing-framework)[captbaritone/mailcatcher-codeception-module

Test emails in your Codeception acceptance tests

1124.4M9](/packages/captbaritone-mailcatcher-codeception-module)[mlambley/swagception

Validate your API against Swagger 2.0 using Codeception

4629.4k1](/packages/mlambley-swagception)[kolyunya/codeception-markup-validator

Markup validator module for Codeception.

1413.7k3](/packages/kolyunya-codeception-markup-validator)

PHPackages © 2026

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