定制 bookit/codeception-testrail 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bookit/codeception-testrail

Composer 安装命令:

composer require bookit/codeception-testrail

包简介

Codeception Extension for TestRail Reporting

README 文档

README

This Codeception extension provides functionality for tests to report results to TestRail using the TestRail API v2.

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

Installation

The easiest way to install this plugin is using Composer. You can install module by running:

composer require --dev bookit/codeception-testrail

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 Status TestRail Status TestRail Status ID
success Success 1
failure Failed 5
error Failed 5
incomplete Success 1
skipped Untested 3

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

License

MIT

(c) BookIt.com 2016

bookit/codeception-testrail 适用场景与选型建议

bookit/codeception-testrail 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37.09k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2016 年 09 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bookit/codeception-testrail 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bookit/codeception-testrail 我们能提供哪些服务?
定制开发 / 二次开发

基于 bookit/codeception-testrail 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 37.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 15
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-30