Code Monkey home page Code Monkey logo

behat-step-time-logger's Introduction

Behat-StepTimeLoggerExtension

License Latest Stable Version Scrutinizer Code Quality Build Status Build Status HHVM Status

Behat-StepTimeLoggerExtension helps you find slow behat scenario steps by logging the step times.

Installation

Install by adding to your composer.json:

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

Configuration

Enable the extension in behat.yml like this:

default:
  extensions:
    Bex\Behat\StepTimeLoggerExtension: ~

You can configure which output printer should be used:

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

You can even enable both output printer at once:

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:

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

You can configure the output directory of the csv printer as well:

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:

bin/behat --log-step-times

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

Example output

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

behat-step-time-logger's People

Contributors

masonm avatar

Watchers

James Cloos avatar Thiago Lima avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.