cake-build / cake-build/cake

SpecFlowStepDefinitionReport fails with Required option 'p, ProjectFile' is missing as of Specflow 2.4.0

Open
#2,414 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

### What You Are Seeing?

When I invoke `SpecFlowStepDefinitionReport` similar to the snippet below:

```
Task("SpecflowStepDefinitionReport")
.Does(() => {
var outputHtml = $"{Environment.CurrentDirectory}/SpecFlowStepDefinitionReport.html";
var reportingSettings = new SpecFlowStepDefinitionReportSettings
{
BinFolder = $"{Environment.CurrentDirectory}/{ParseProjectName(Projects.AcceptanceTests)}/bin/Debug",
Out = outputHtml
};
SpecFlowStepDefinitionReport(Projects.AcceptanceTests, reportingSettings);

var htmlContents = FileReadText(outputHtml);

if (htmlContents.Contains(""))
{
throw new CakeException($"Step definition is not present in any feature file. Please see {outputHtml}");
}
else if (htmlContents.Contains(""))
{
throw new CakeException($"Scenario step is not defined (implemented). Please see {outputHtml}");
}
});
```

It fails with the following error:

```
========================================
SpecflowStepDefinitionReport
========================================
Executing task: SpecflowStepDefinitionReport
Executing: /Users/cosminstirbu/Desktop/MyProject/tools/SpecFlow.2.4.1/tools/specflow.exe stepdefinitionreport "/Users/cosminstirbu/Desktop/MyProject/MyProject.AcceptanceTests/MyProject.AcceptanceTests.csproj" /binFolder:"/Users/cosminstirbu/Desktop/MyProject/MyProject.AcceptanceTests/bin/Debug" /out:"/Users/cosminstirbu/Desktop/MyProject/SpecFlowStepDefinitionReport.html"
TechTalk.SpecFlow 2.4.0-line-v2-4.52+Branch.line-v2.4.Sha.44ea7423c9bf4972a8b63427a0ab319654bb416e
Copyright © TechTalk 2011
ERROR(S):
Required option 'p, ProjectFile' is missing.

-x, --XsltFile Xslt file to use, defaults to built-in stylesheet if not provided.

-b, --binFolder (Default: bin\Debug) Path for Spec dll e.g. Company.Specs.dll. Defaults to bin\Debug.

-o, --OutputFile (Default: TestResult.html) Generated Output File. Defaults to TestResult.html

-d, --debug Used for tool integration.

-p, --ProjectFile Required. Visual Studio Project File containing specs.

--help Display this help screen.

--version Display version information.
```

This started happening since upgrading Specflow to 2.4.0, and I assume it is caused by https://github.com/techtalk/SpecFlow/pull/1112

### What is Expected?

It should work just as it used to work before 2.4.0 (e.g. 2.3.2)

### What version of Cake are you using?
0.26.0 / 0.31.0

### Are you running on a 32 or 64 bit system?
64

### What environment are you running on? Windows? Linux? Mac?
macOS

### Are you running on a CI Server? If so, which one?
Local and on CI

Contributor guide

Open the contributing guide

Research direction

Start at the SpecFlowStepDefinitionReport invocation and compare the generated specflow.exe stepdefinitionreport command with the SpecFlow 2.4.0 help output. Reproduce with the shown Cake versions and SpecFlow 2.3.2/2.4.0; done means the report command supplies the required project information and generates the HTML report as before.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.