How Do You Run a Feature File in Cucumber?

Timothy Joseph | February 7, 2022

How do you run a feature file in cucumber?

Cucumber is a BDD framework and we use Gherkin language to create scenarios. Cucumber is a useful tool for mobile and web application testing. To achieve this, we define ‘Features and Steps Definition’ files in the appropriate directory structure. We can categorize feature files using various tags and use multiple tags in a feature file.

  • Below is the cucumber command to execute cucumber feature files:-

    cucumber --tags "@smoke and @regression"
    This command will execute all feature files having "@smoke and @regression" tags.
  • Cucumber can also ignore scenarios with a particular tag. For example:-

    cucumber --tags "not @smoke"
    This command will execute all other feature files except the ones having a "@smoke" tag.
  • To list out available options for cucumber execution, please use below-mentioned command:-

    cucumber --help

 

Need reliable QA resources to ramp up your existing processes, contact QASource.

Disclaimer

This publication is for informational purposes only, and nothing contained in it should be considered legal advice. We expressly disclaim any warranty or responsibility for damages arising out of this information and encourage you to consult with legal counsel regarding your specific needs. We do not undertake any duty to update previously posted materials.

Post a Comment

Categories