2017 © Pedro Peláez
 

library behat-step-time-logger

Extension for behat to help find slow scenario steps by logging the step times

image

bex/behat-step-time-logger

Extension for behat to help find slow scenario steps by logging the step times

  • Thursday, July 12, 2018
  • by tkotosz
  • Repository
  • 2 Watchers
  • 11 Stars
  • 17,195 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 5 Versions
  • 15 % Grown

The README.md

Behat-StepTimeLoggerExtension

License Latest Stable Version Scrutinizer Code Quality Build Status Build Status, (*1)

Behat-StepTimeLoggerExtension helps you find slow behat scenario steps by logging the step times., (*2)

Installation

Install by adding to your composer.json:, (*3)

composer require --dev bex/behat-step-time-logger

Configuration

Enable the extension in behat.yml like this:, (*4)

default:
  extensions:
    Bex\Behat\StepTimeLoggerExtension: ~

You can configure which output printer should be used:, (*5)

default:
  extensions:
    Bex\Behat\StepTimeLoggerExtension:
      output: csv # possible values: console, csv. default value: console

You can even enable both output printer at once:, (*6)

default:
  extensions:
    Bex\Behat\StepTimeLoggerExtension:
      output: [console, csv]

You can enable the logger to run every time even if you don't use the --log-step-times flag:, (*7)

default:
  extensions:
    Bex\Behat\StepTimeLoggerExtension:
      enabled_always: true

You can configure the output directory of the csv printer as well:, (*8)

ci:
  extensions:
    Bex\Behat\StepTimeLoggerExtension:
      output_directory: /your/path/for/the/csvfile # by default it will be saved to the /tmp/steptimelogger directory

Usage

When debugging a particular scenario, use the --log-step-times flag at the cli:, (*9)

bin/behat --log-step-times

Or use the enabled_always config setting to run the logger every time. (See configuration section), (*10)

Example output

+------------------------+--------------+-----------------------------------------------------+
| Average execution Time | Called count | Total Cost | Step name                              |
+------------------------+--------------+-----------------------------------------------------+
| 1.73161                | 2            | 3.46322    | I am on page "test-product.html"       |
| 0.30817                | 1            | 0.30817    | I should see "$99,999.00" as the price |
| 0.05326                | 2            | 0.10652    | I should see "Add to Compare"          |
+------------------------+--------------+-----------------------------------------------------+
Step time log has been saved. Open at /tmp/steptimelogger/step-times-1447580698.csv

The Versions

12/07 2018
17/03 2018

dev-bug/do-not-depend-on-console-output-printer-class

dev-bug/do-not-depend-on-console-output-printer-class https://github.com/tkotosz/behat-step-time-logger

Extension for behat to help find slow scenario steps by logging the step times

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd tdd behat

16/11 2015