Behat Options Dry Run

Profile picture for user devraj

Dry run gives you a way to quickly scan your features without actually running them. It make sure that every Step have the corresponding method available in the Feature Context File. 

When it is not used, all statements/code inside the step definitions method will execute. This is fine when you have 1 or 2 scenarios, but it's really a trouble when there are many scenarios, you don't want to wait for long time to check which snippet is missing.

To use dry run add --dry-run to your command

$ behat --dry-run --tags mytest

It means that Behat will only checks that every Step mentioned in the Feature File have corresponding code written in Snippet file or not. So in case any of the function is missed in the Context file for any Step in Feature File, it will give us the message. Here code inside step definition method will not execute at all.

Hence, it will save lot of your time and makes debugging easier.

Tags