How can i specify Scenario priority in MsTest

1,033 views
Skip to first unread message

Loki

unread,
Jun 25, 2010, 7:57:30 AM6/25/10
to SpecFlow
Is there a way to specify priority of the scenario in SpecFlow when
using with MsTest framework

Jonas Bandi

unread,
Jul 3, 2010, 9:07:49 AM7/3/10
to spec...@googlegroups.com
Hi,
SpecFlow maps @tags to [TestCategory] attributes if the target
unit-test framework supports these attributes.

MsTest 3.5 does not support [TestCategory], but MsTest 4.0 does.

If you are using MsTest 4.0 you have to configure the unit-test
provider like this in App.config:

<specFlow>
<unitTestProvider name="MsTest.2010" />
</specFlow>

Then you can mark your features and/or scenarios with tags that
reflect your priority-categories. Like: @wip, @smoke_test, @core_func,
...

You then can use VisualStudio 2010 to execute only tests that match a
certain [TestCategory].
Or you can use the /categories flag of MsTest.exe on the commandline:
http://msdn.microsoft.com/en-us/library/ms182489.aspx

Does this solve your requirements?


On Fri, Jul 2, 2010 at 1:11 PM, rakesh loki <rredd...@gmail.com> wrote:
> Sorry!! I should have been more clear in my explaination.
>
> I am an automation engineer and I would like to divide my scenario into
> Priority 1, 2 and 3 - this helps me to quickly run scripts on need.
>
> For example -
> Just run priority 1 tests after a new build
> Run all priority (1,2 and 3) tests during nightly builds
>
> This will be really help full for me during release testing - Can you please
> let me know if there is a way to do this using SpecFlow.
>
> Thanks
> Loki
>
>
>
> On Fri, Jul 2, 2010 at 7:25 AM, Jonas Bandi <jonas...@gmail.com> wrote:
>>
>> Could you explain a bit more, what your intentions are here?
>>
>> What would be the consequences of specifiying a priority on a scenario?
>>
>> Note: With SpecFlow 1.3.2 and MsTest 4.0 tags in the gherkin get
>> translated to [TestCategory] but you have to specify "MsTest.2010" as
>> your UnitTestProvider in the app.config...


>>
>>
>> On Fri, Jun 25, 2010 at 1:57 PM, Loki <rredd...@gmail.com> wrote:
>> > Is there a way to specify priority of the scenario in SpecFlow when
>> > using with MsTest framework
>> >
>>
>>
>>

>> --
>> mail: jonas...@gmail.com
>> web: www.jonasbandi.net
>> blog: blog.jonasbandi.net
>> twitter: twitter.com/jbandi
>
>

--
mail: jonas...@gmail.com
web: www.jonasbandi.net
blog: blog.jonasbandi.net
twitter: twitter.com/jbandi

Reply all
Reply to author
Forward
0 new messages