Build/Test Issues

NCruch running Specflow Test and getting "No Matching step definition"

Started by craigrichards on 5,091 views

Hi,
Currently getting into troubles with NCrunch and Specflow. I am getting missing step definitions. Work perfectly through the Resharper / MSTest runner with the MSTestAdapter.

I am running
- NCrunch 3.14.0.1
- Specflow 2.3.0
- Specflow Extension 2017.1.12
- VS 2017

Here is a copy of the standard error.

Given an order that will RunAllVetting
-> done: Steps.GivenAnOrderThatWillRunAllVetting() (0.0s)
And the vetting script raises a Referral Broken Rule with Code A Action orderRefer Overwrite FALSE Queue sendtoMarginlendingQueue
-> No matching step definition found for the step. Use the following code to create one:
[Given(@"the vetting script raises a Referral Broken Rule with Code A Action orderRefer Overwrite FALSE Queue sendtoMarginlendingQueue")]
public void GivenTheVettingScriptRaisesAReferralBrokenRuleWithCodeAActionOrderReferOverwriteFALSEQueueSendtoMarginlendingQueue()
{
ScenarioContext.Current.Pending();
}

And the vetting script raises a Referral Broken Rule with Code A Action orderRefer Overwrite FALSE Queue sendtoInternetQueue
-> No matching step definition found for the step. Use the following code to create one:
[Given(@"the vetting script raises a Referral Broken Rule with Code A Action orderRefer Overwrite FALSE Queue sendtoInternetQueue")]
public void GivenTheVettingScriptRaisesAReferralBrokenRuleWithCodeAActionOrderReferOverwriteFALSEQueueSendtoInternetQueue()
{
ScenarioContext.Current.Pending();
}

Edited

Hi, thanks for sharing this problem.

When you say missing step definitions, do you mean that you're not seeing NCrunch coverage markers on SpecFlow code where you're expecting them? Or are you experiencing build issues when using NCrunch? (i.e. the definition code isn't being generated).
Thanks for the quick response. Firstly I am a huge fan and have been since v1.

NCrunch builds my project ok.
Some Specflow tests run ok.
Other Tests fail with a 'Missing step definition error'.

If I run these tests through MSTest / Resharper they are all successful.

Thanks for the extra info. Does setting the engine in compatibility mode make any difference?
Thanks for your quick responses. I was able to troubleshoot the issues from my side and it was my issue and nothing to do with NCrunch in the end. The updated NCrunch version also resolved the Com+ issues i was having. The tests all run fine now.

Post a reply

Log in to reply.