简体   繁体   中英

How To Run Multiple File Feature Automation Testing Using Behave On The Command Terminal

For an example, I have created some feature for automation testing using Behave login_account.feature and choose_product.feature . To run on a single feature, I use this command on the terminal behave -f behave_html_formatter:HTMLFormatter -i login_account.feature .

I want to run on multiple feature login_account.feature and choose_product.feature in one command on the terminal. Anyone, can you give me the example command to run multiple feature using Behave in one command on the terminal? Thank you in advance.

I think there might be two issues:

  1. I'm not sure if that's the way to run with that formatter. See behave-html-formatter docs for config and example. I can't trial myself as I don't want/need this formatter installed. I would suggest you worry about this after you understand how to run multiple features, which is where issue #2 comes in.

  2. -i expects a single argument, which is a regular expression pattern. Assuming you are in your features folder, just list the two features with space separator after the behave command:

behave login_account.feature choose_product.feature

Better still, you could use tags. This makes way more sense if you want to run more than the two files in your example. Add a tag at the top of each of the feature files you want to execute eg @runme .

Then execute only the ones having the preferred tag:

behave -t @runme

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM