2

To configure and use many features of SpecRun (beefed up version of Specflow, the cucumber for .NET), you need some sort of .sfprofile file. A file "default.sfprofile" is supposedly and (I assume) typically created for you when the Nuget package is installed. But it did not do so for me.

Is there another way to trigger the creation of "default.sfprofile"? If not, will all be well if I create it myself? If that will work, could someone please post what the initial contents of this file should be? Thanks!

Patrick Karcher
  • 22,995
  • 5
  • 52
  • 66

2 Answers2

1

The SpecFlow+ Runner configuration file template is available as Item Template if you have the SpecFlow for Visual Studio extension installed:

enter image description here

It is the last one in the list.

Be aware that VS will try to create it as Default1.srProfile by default. You need to adjust the filename manually.

Old and outdated answer:

The template for the file is in packages\SpecRun.SpecFlow.1.2.0\content\Default.srprofile.pp

Copy that and replace the {...} Placeholders with your values. projectId is a Guid.

Andreas Willich
  • 5,665
  • 3
  • 15
  • 22
0

Andreas' answer is correct. But I've since discovered why nuget failed to install SpecRun.SpecFlow correctly. I believe it had to do with artifacts left over from a previous installation, which was later removed. It installed correctly after I:

  1. Removed the "SpecRun.Runner.1.2.0" and "SpecRun.SpecFlow.1.2.0" directories from my solution's \packages\ directory
  2. Removed the "SpecRun.Runner.1.2.0" directory from C:\Users\[me]\AppData\Local\Temp\VisualStudioTestExplorerExtensions\
  3. Removed the "obj\debug" and "bin\debug" directories from the project in question.
  4. (this was definitely part of the problem:) Removed these files from my project: "Default.srprofile", "runtests.cmd", "SpecRunTestProfile.xsd". These were removed from my solution with the previous uninstall, but were still there in the file system.
  5. For good measure, checked the entire project from source control and ran via the Nuget command line (Install-Package SpecRun.SpecFlow), because I was desperate and trying everything at this point.

After doing all that, SpecRun.Runner installed correctly. Not sure all of that was needed, but at least several of them were, each of them individually didn't do the trick. Oh, and another gotcha:

  1. Even when mostly successful (got my shiny new "Default.srprofile"!), I still had to fix something in the app.config: the install correctly added <unitTestProvider name="SpecRun" /> element, but mistakenly left in the old <unitTestProvider name="MsTest" /> element. Had to take that out for all to be joyful.

Of course, now I have this issue, but that's unrelated.

Community
  • 1
  • 1
Patrick Karcher
  • 22,995
  • 5
  • 52
  • 66