webimp/codeception-performance-test

Codeception 扩展,用于测量测试性能

1.0.4 2017-01-08 07:25 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:25:26 UTC


README

Codacy Badge

Codeception 扩展,用于列出测试中的慢步骤。兼容 Codeception 2.2.7

运行测试后,您将看到慢测试的性能报告

Slow Steps (more than 2.5s) ----------------------
I click button 6s

安装

将 PerformanceTest 添加到您的 composer.json

  "require-dev": {
    ...
    "webimp/codeception-performance-test": "1.0.*",

用法

将此添加到您的 codeception.yml 文件的扩展行底部

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    helpers: tests/_support
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
extensions:
    enabled:
        - Codeception\Extension\PerformanceTest:
            benchmark: 2.5 # min seconds for step to be marked as "slow"

将文件包含到您的 _bootstrap.php

include('./vendor/webimp/codeception-performance-test/src/PerformanceTest.php');