Can I use SpecRun to verify whether all steps are bound?

616 views
Skip to first unread message

Dirk Rombauts

unread,
Sep 25, 2012, 6:02:50 AM9/25/12
to spe...@googlegroups.com
Hi,

I have an extensive library of SpecFlow scenarios, and we are considering to "refactor" the bindings: reword them, merge them, you name it.  This is (of course) a potentially error-prone job, so I would like to have frequent feedback whether all my steps are still bound to C# code.  Unfortunately, our tests take long to execute, so getting that frequent feedback from test execution is not feasable.  As far as I know, Cucumber (the Ruby original) has a mode that will run scenarios by only verifying the bindings, but not execute the bindings themselves.

Does SpecRun have a mode like that too?

Thanks!

chassa

unread,
Sep 25, 2012, 6:07:39 AM9/25/12
to spe...@googlegroups.com
Dirk, I think the SpecFlow step definition report is what you are looking for:  https://github.com/techtalk/SpecFlow/wiki/Reporting 

Christian

Dirk Rombauts

unread,
Sep 25, 2012, 6:34:46 AM9/25/12
to spe...@googlegroups.com
Hi Christian,

Thanks for your reply - the step definition report looks interesting, but I don't think it's precisely what I'm looking for.

Let me see if I understand the output of the step definition report: the step definition report collects all steps that are defined in the automation layer, and then tells me how often each of those steps is used.  That is interesting to know because I can see right away that I have several steps that are not used anymore.

What I want to know is something else: I'd like to have a report that analyzes all feature files, and then tells me whether those steps have bindings.  Or to put it another way: Visual Studio shows SpecFlow steps that have no binding as purple.  I would like to have a report/tool window/whatever that shows me all "purple/not bound" steps in the project.

Dirk

chassa

unread,
Sep 25, 2012, 7:01:26 AM9/25/12
to spe...@googlegroups.com
To my knowledge the step definition report shows 
+) steps used in scenarios that have no step definition (binding code) in yellow
+) step definitions (binding code) that is not used in any scenarios in red

Christian

Dirk Rombauts

unread,
Sep 25, 2012, 7:06:42 AM9/25/12
to spe...@googlegroups.com
Oh, I see - then I misinterpreted the step definition report.  I interpreted it like this: red steps are those that are not used at all, yellow steps are those that are used few times, and "white" steps are those that are used often.

With your help I see that the yellow steps are indeed the steps that I was looking for.

Thank you, that solves my issue.

chassa

unread,
Sep 25, 2012, 8:46:24 AM9/25/12
to spe...@googlegroups.com
Glad I could help. Maybe you can take the time to post your findings on the SpecFlow wiki for futher reference :-).

Dirk Rombauts

unread,
Sep 25, 2012, 8:59:48 AM9/25/12
to spe...@googlegroups.com

Done.  Feel free to polish it :-)
Reply all
Reply to author
Forward
0 new messages