Skip to main content

Behat Options Dry Run

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
Submitted by tgoswami on April 12, 2021

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.