承接 conoredwardscp/pest-plugin-qase 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

conoredwardscp/pest-plugin-qase

最新稳定版本:v1.0.3

Composer 安装命令:

composer require --dev conoredwardscp/pest-plugin-qase

包简介

Qase TMS reporter plugin for Pest

README 文档

README

This project is no longer going to be maintained. Qase has implemented their own Pest plugin and that should be used instead.

https://github.com/qase-tms/qase-pest

Pest Qase Plugin

Seamlessly integrate your Pest tests with Qase Test Management System

Latest Version on Packagist Total Downloads License

What is it?

The Pest Qase Plugin is a powerful integration that automatically reports your Pest test results to Qase TMS. Track test execution, manage test cases, and maintain comprehensive test documentation—all without leaving your testing workflow.

Why use it?

Automatic Reporting — Test results flow directly to Qase TMS after each run

🔗 Easy Linking — Connect tests to Qase test cases with a simple caseId() call

📊 Rich Metadata — Add custom fields, parameters, comments, and attachments

🎯 Smart Organization — Group tests into suites for better management

Parallel Execution — Fully supports concurrent test runs

Requirements

  • PHP 8.2 or higher
  • Pest 3.0 or 4.0
  • A Qase account with an API token

Installation

Install the plugin via Composer:

composer require conoredwardscp/pest-plugin-qase --dev

Then, register the extension in your phpunit.xml:

<phpunit>
    <extensions>
        <bootstrap class="Pest\Qase\QaseExtension"/>
    </extensions>
</phpunit>

Configuration

Configure the plugin using environment variables. You can set these in your .env file, CI/CD pipeline, or export them in your terminal:

# Required: Set the reporting mode
QASE_MODE=testops  # Options: testops, report, off

# Required: Your Qase API token
QASE_TESTOPS_API_TOKEN=your_api_token_here

# Required: Your Qase project code
QASE_TESTOPS_PROJECT=PROJECT_CODE

# Optional: Link results to an existing test run
QASE_TESTOPS_RUN_ID=123

# Optional: Set a custom test run title
QASE_TESTOPS_RUN_TITLE="My Test Run"

# Optional: For parallel execution (automatically set by most test runners)
TEST_TOKEN=thread_identifier

💡 Tip: Get your API token from your Qase account settings, and find your project code in the project URL or settings.

Usage

Basic Test Case Linking

Link a Pest test to a Qase test case by its ID:

it('validates user login', function () {
    qase()->caseId(123);

    $user = loginUser('test@example.com', 'password');

    expect($user)->toBeLoggedIn();
});

Multiple Test Case IDs

One test can report to multiple Qase test cases:

it('validates complex authentication flow', function () {
    qase()->caseId(101, 102, 103);

    // Your test code here
});

Organizing with Suites

Group related tests using suites for better organization:

it('validates user authentication', function () {
    qase()
        ->suite('Authentication')
        ->suite('Security')
        ->caseId(200);

    // Your test code here
});

Adding Custom Fields

Enhance your test results with custom metadata:

it('checks critical API endpoint', function () {
    qase()
        ->caseId(300)
        ->field('severity', 'critical')
        ->field('priority', 'high')
        ->field('layer', 'api');

    // Your test code here
});

Adding Parameters

Track test parameters for better context:

it('validates cross-browser compatibility', function () {
    qase()
        ->caseId(400)
        ->parameter('browser', 'chrome')
        ->parameter('environment', 'staging')
        ->parameter('viewport', '1920x1080');

    // Your test code here
});

Custom Test Titles

Override the default test name with a custom title:

it('tc_auth_001_validates_login_with_valid_credentials', function () {
    qase()
        ->caseId(500)
        ->title('User Login with Valid Credentials');

    // Your test code here
});

Adding Comments

Add runtime comments to your test results for additional context:

it('performs data migration', function () {
    qase()->caseId(600);

    qase()->comment('Starting migration of 10,000 records');

    $result = migrateData();

    qase()->comment('Migration completed successfully');
    qase()->comment('Total time: ' . $result->duration . ' seconds');

    expect($result->success)->toBeTrue();
});

Adding Attachments

Attach files or content directly to your test results:

it('generates user report', function () {
    qase()->caseId(700);

    $report = generateReport();

    // Attach a single file
    qase()->attach('/path/to/screenshot.png');

    // Attach multiple files
    qase()->attach([
        '/path/to/log.txt',
        '/path/to/report.pdf'
    ]);

    // Attach content directly
    qase()->attach((object)[
        'title' => 'api-response.json',
        'content' => json_encode($report),
        'mime' => 'application/json'
    ]);

    expect($report)->toBeValid();
});

Fluent API Chaining

Chain multiple methods together for clean, readable test setup:

it('validates complete user journey', function () {
    qase()
        ->caseId(800)
        ->suite('Integration Tests')
        ->suite('User Journey')
        ->field('severity', 'high')
        ->field('priority', 'critical')
        ->parameter('environment', 'production')
        ->parameter('user_type', 'premium')
        ->title('Complete Premium User Journey');

    // Your test code here
});

Working with Data Providers

The plugin automatically handles PHPUnit data providers:

it('validates different user roles', function ($role, $permissions) {
    qase()
        ->caseId(900)
        ->parameter('role', $role)
        ->parameter('permissions', implode(',', $permissions));

    $user = createUserWithRole($role);

    expect($user->permissions)->toBe($permissions);
})->with([
    ['admin', ['read', 'write', 'delete']],
    ['editor', ['read', 'write']],
    ['viewer', ['read']],
]);

Parallel Test Execution

The plugin is fully thread-safe and supports parallel execution out of the box:

# Pest parallel execution
./vendor/bin/pest --parallel

# With custom process count
./vendor/bin/pest --parallel --processes=4

API Reference

Global Helper

qase() Returns the Qase instance for the current test.

Available Methods

All methods return self for method chaining.

caseId(int ...$ids): self

Link the test to one or more Qase test case IDs.

qase()->caseId(123);           // Single ID
qase()->caseId(123, 456, 789); // Multiple IDs

suite(string ...$suites): self

Add one or more suites to organize the test.

qase()->suite('Authentication');
qase()->suite('API', 'Integration', 'Smoke');

field(string $name, string $value): self

Add a custom field to the test result.

qase()->field('severity', 'critical');
qase()->field('priority', 'high');

parameter(string $name, string $value): self

Add a parameter to the test result.

qase()->parameter('browser', 'chrome');
qase()->parameter('environment', 'staging');

title(string $title): self

Set a custom title for the test result.

qase()->title('User Login with Valid Credentials');

comment(string $message): void

Add a comment to the test result during execution.

qase()->comment('Starting validation phase');
qase()->comment('Validation completed successfully');

attach(mixed $input): void

Add an attachment to the test result.

// Single file path
qase()->attach('/path/to/file.png');

// Multiple file paths
qase()->attach(['/path/to/file1.txt', '/path/to/file2.json']);

// Content object
qase()->attach((object)[
    'title' => 'filename.txt',
    'content' => 'file contents',
    'mime' => 'text/plain'
]);

Development

Running Tests

# Run all tests
composer test

# Run specific test suites
composer test:unit      # Unit tests
composer test:lint      # Code style checks
composer test:types     # Static analysis

Code Quality

# Fix code style
composer lint

# Run refactoring
composer refacto

License

Pest Qase Plugin is open-sourced software licensed under the MIT license.

Links

Built with ❤️ by the Pest community

conoredwardscp/pest-plugin-qase 适用场景与选型建议

conoredwardscp/pest-plugin-qase 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 11 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「framework」 「php」 「testing」 「plugin」 「test」 「unit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 conoredwardscp/pest-plugin-qase 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-13