Software Development and QA Tips By QASource Experts

How Do You Run a Feature File in Cucumber?

Written by Timothy Joseph | Feb 7, 2022 5:00:00 PM

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.