Configuring Specflow scenarios tags running in CI (Jenkins)

945 views
Skip to first unread message

Ana Sousa

unread,
Jan 14, 2016, 3:58:10 AM1/14/16
to Jenkins Users
Hi all, 

I have a lot of specflow feature files in my .Net code with loads of scenarios for each feature file. 
I'm putting some tags in the scenarios in order to categorize my tests and only run sub-sets of the tests. My tags are as simple as @smoke @integration @regression @critical.

I was wondering if someone knows a way to configure CI (jenkins) in order to run only the "smoke" or "critical" or "integration&regression" tags.

Thank you for your help.

Best regards,
Ana

Victor Martinez

unread,
Jan 20, 2016, 10:58:30 AM1/20/16
to Jenkins Users
Hi Ana,

 Do you use any build scripts? If so, as long as that logic is part of the script itself you can easily run those commands in Jenkins. Other than that, I don't see any other way of doing it.

Cheers

André Carmo

unread,
Jan 20, 2016, 2:32:01 PM1/20/16
to Jenkins Users
Hi Ana,

Sure it is possible, but it will depend on the test runner you are using with Specflow(NUnit, MSTest, Specflow+ Runner, ConsoleUnitTestRunner, and so on). Check your App.config file, and search for the "unitTestProvider" key.

Then you will need to configure your Jenkins job to call the test runner using the correct parameters. For example, if you are using NUnit you can use something like this, you can use a batch command:
nunit-console myassembly.dll /include:Smoke

It would be easier to help if you could tell us what do you have right now. Do you already have your Jenkins job configured? Can you run all your tests in Jenkins? 

Regards,
André
Reply all
Reply to author
Forward
0 new messages