2017 © Pedro Peláez
 

library behat-choose-tests

Extension for behat to allow you to interactively choose tests to run

image

bex/behat-choose-tests

Extension for behat to allow you to interactively choose tests to run

  • Monday, May 28, 2018
  • by tkotosz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Behat-ChooseTestsExtension

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

Behat-ChooseTestsExtension allows you to interactively choose tests to run., (*2)

Installation

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

composer require --dev bex/behat-choose-tests

Configuration

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

default:
  extensions:
    Bex\Behat\ChooseTestsExtension: ~

Usage

Choose Suite

Run behat with --choose-suite option to interactively choose a suite to run:, (*5)

  1. it will not show the suite-chooser, (*6)

    • if you are running behat with --no-interaction option
    • if you already specified the suite with the --suite option
    • if you have only 1 suite
  2. it will allow you to choose All suite or a specific suite. Multiple choice is not allowed yet., (*7)

Example output:, (*8)

foo@bar:~$ bin/behat --choose-suite

 Choose suite:

  [0] All
  [1] First Suite
  [2] Second Suite
 > 

Choose Feature

Run behat with --choose-feature option to interactively choose a feature to run:, (*9)

  1. it will not show the feature-chooser, (*10)

    • if you are running behat with --no-interaction option
    • if you already specified the feature with passing the <paths> argument (e.g. bin/behat features/my_awesome.feature)
    • if you have only 1 feature
  2. it will allow you to choose All feature or a specific feature. Multiple choice is not allowed yet., (*11)

  3. it list all features or the features in the given suite if you already selected a suite with --suite or --choose-suite., (*12)

Example output:, (*13)

foo@bar:~$ bin/behat --choose-feature

 Choose feature:

  [0] All
  [1] First feature (features/first.feature)
  [2] Second feature (features/second.feature)
  [3] Third feature (features/third.feature)
  [4] Forth feature (features/forth.feature)
 >  
foo@bar:~$ bin/behat --suite="firstsuite" --choose-feature

 Choose feature:

  [0] All
  [1] First feature (features/first.feature)
  [2] Second feature (features/second.feature)
 > 

Choose Scenario

Run behat with --choose-scenario option to interactively choose a scenario to run:, (*14)

  1. it will not show the scenario-chooser, (*15)

    • if you are running behat with --no-interaction option
    • if you already specified the scenario with passing the <paths> argument and specifying a line number (e.g. bin/behat features/my_awesome.feature:3)
    • if you have only 1 scenario
  2. it will allow you to choose All scenario or a specific scenario. Multiple choice is not allowed yet., (*16)

  3. it list all scenarios or the scenarios in the given suite and feature if you already specified those. (Note that you can specify the suite with --suite or --chose-suite and you can specify the feature by passing the <paths> argument or using the --choose-feature option), (*17)

Example output:, (*18)

foo@bar:~$ bin/behat --suite="firstsuite" --choose-scenario

 Choose scenario:

  [0] All
  [1] First scenario (features/first.feature:3)
  [2] Second scenario (features/first.feature:8)
  [3] Third scenario (features/first.feature:13)
  [4] First scenario (features/second.feature:3)
  [5] Second scenario (features/second.feature:8)
  [6] Third scenario (features/second.feature:13)
 > 
foo@bar:~$ bin/behat features/first.feature --choose-scenario

 Choose scenario:

  [0] All
  [1] First scenario (features/first.feature:3)
  [2] Second scenario (features/first.feature:8)
  [3] Third scenario (features/first.feature:13)
 > 

Choose Tests

Run behat with --choose-tests option to interactively choose tests to run. It will simply enable all above choosers so --choose-tests is equivalent to --choose-suite --choose--feature --choose-scenario., (*19)

Example output: ```console foo@bar:~$ bin/behat --choose-tests, (*20)

Choose suite:, (*21)

[0] All [1] firstsuite [2] secondsuite, (*22)

1, (*23)

Choose feature:, (*24)

[0] All [1] First feature (features/first.feature) [2] Second feature (features/second.feature), (*25)

1, (*26)

Choose scenario:, (*27)

[0] All [1] First scenario (features/first.feature:3) [2] Second scenario (features/first.feature:8) [3] Third scenario (features/first.feature:13), (*28)

1, (*29)

Feature: First feature, (*30)

Scenario: First scenario # features/first.feature:3 Given I have a few things # FeatureContext::iHaveAFewThings() When I do whatever # FeatureContext::iDoWhatever() Then I should see something # FeatureContext::iShouldSeeSomething(), (*31)

1 scenario (1 passed) 3 steps (3 passed) 0m0.03s (7.85Mb) ```, (*32)

The Versions

28/05 2018

dev-master

9999999-dev https://github.com/tkotosz/behat-choose-tests

Extension for behat to allow you to interactively choose tests to run

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd tdd behat

28/05 2018

1.0.0

1.0.0.0 https://github.com/tkotosz/behat-choose-tests

Extension for behat to allow you to interactively choose tests to run

  Sources   Download

MIT

The Requires

 

The Development Requires

bdd tdd behat