ministryofjustice/behat-test-statistics

This package is abandoned and no longer maintained. No replacement package was suggested.

A Behat context file to add test suite statistics

dev-main 2021-06-09 13:42 UTC

This package is not auto-updated.

Last update: 2022-12-21 12:30:33 UTC


README

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License

About The Project

A place to store commonly used Behat context files that provide useful statistics on test suites.

Built With

Getting Started

The contexts included here are designed to be dropped in to a project without any setup required.

Prerequisites

  • behat
    composer require --dev behat/behat

Installation

Add to your project using composer:

composer require --dev ministryofjustice/behat-test-statistics

Alternatively, manually download the source code to persist in your project.

Usage

There are two approaches to using the context file.

  1. Add to your behat.yml suite config as a context:
default:
    suites:
        ui-tests:
            description: A minimal UI test suite
            paths: [ "%paths.base%/features" ]
            filters:
                tags: "@ui"
            contexts:
                - App\Tests\Behat\FeatureContext
                - MinistryOfJustice\BehatContexts\TestStatisticsContext
  1. Extend your base context file using MinistryOfJustice\BehatContexts\TestStatisticsContext:
<?php

declare(strict_types=1);

namespace App\Tests\Behat\v2\Common;

class BaseFeatureContext extends MinistryOfJustice\BehatContexts\TestStatisticsContext
{}

Once the feature context is plugged into your test suites it will automatically flag any slow running suites or steps at the end of the test run:

Behat test output

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.