Behat: Get a list of scenarios

Created on 9 Oct 2013  路  9Comments  路  Source: Behat/Behat

I will find very usefull to have an option for formatting behat output only to list the scenarios that i have in the application.

The progress option is fine, but if i want only the list of scenarios i have it is useless.

The pretty option has the scenarios, but also have the steps, so it have too much information.

I understand that i have to have control of which scenarios i have and which not, but nowadays i have more than 200 scenarios (and growing), and sometimes it is difficult to know which ones are missing, and which ones are obsolete.

Feature

Most helpful comment

In addition to formatting executed test output (--format), it would be useful to be able to list the scenarios without executing them (like how --definitions works). I do this crudely at the moment with bash: for i in features/*.feature; do head -n 4 $i; grep ' Scenario' $i; echo; done

Another useful thing (both as a format output for executing and listing without executing) would be just listing features, with no scenarios or steps.

All 9 comments

I think this is a formatter which could be added in the core. What do you think @everzet ?

In the meantime, extensions are able to register formatters in 3.0

I think this feature will be awesome for core. And fairly easy to implement

In addition to formatting executed test output (--format), it would be useful to be able to list the scenarios without executing them (like how --definitions works). I do this crudely at the moment with bash: for i in features/*.feature; do head -n 4 $i; grep ' Scenario' $i; echo; done

Another useful thing (both as a format output for executing and listing without executing) would be just listing features, with no scenarios or steps.

@dave1010 there is --dry-run to skip the execution

@stof --dry-run still lists all the steps. I guess I'm thinking something along the lines of:

  • --format terse executes but doesn't show steps, just scenarios and features (as proposed by @patxi1980 originally)
  • --format very-terse executes but doesn't show steps or scenarios, just features
  • --dry-run --terse same as --dry-run but doesn't show steps, just scenarios and features
  • --dry-run --very-terse same as --dry-run but but doesn't show steps or scenarios, just features

I guess an extension could provide the different formatters for execution. I'm not sure about dry-run formatting.

@dave1010 using --dry-run has no impact on the format of the output. they are unrelated settings. So it would be --dry-run --format terse doing it

@stof ah, I think that makes sense. So if --format terse was implemented then it would automatically have the same output for --dry-run.

yes exactly.

Hi,
Is this solution developped on the actual version ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BentCoder picture BentCoder  路  8Comments

Nyholm picture Nyholm  路  10Comments

xorik picture xorik  路  3Comments

DavidGarciaCat picture DavidGarciaCat  路  8Comments

ice9js picture ice9js  路  7Comments