diff --git a/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs b/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs index b49bbf7b2..5fd0dfe86 100644 --- a/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs +++ b/Reporting/NUnitExecutionReport/NUnitExecutionReportParameters.cs @@ -11,7 +11,7 @@ public NUnitExecutionReportParameters(string projectFile, string xmlTestResult, : base(projectFile, outputFile, xsltFile) { this.XmlTestResult = Path.GetFullPath(xmlTestResult); - this.LabelledTestOutput = Path.GetFullPath(labelledTestOutput); + this.LabelledTestOutput = string.IsNullOrEmpty(labelledTestOutput) ? "" : Path.GetFullPath(labelledTestOutput); } } } \ No newline at end of file diff --git a/Tests/ReportingTest.SampleProject/MsTestResult/TestResult.trx b/Tests/ReportingTest.SampleProject/MsTestResult/TestResult.trx new file mode 100644 index 000000000..f079f4964 --- /dev/null +++ b/Tests/ReportingTest.SampleProject/MsTestResult/TestResult.trx @@ -0,0 +1,159 @@ + + + + This is a default test run configuration for a local test run. + + + + + + + + + + + + Scenario with pending steps + + + + + + FeatureTitle + Feature with failing scenarios + + + + + + + + Scenario with failing steps + + + + + + FeatureTitle + Feature with failing scenarios + + + + + + + + First successful scenario + + + + + + FeatureTitle + Feature with successful scenarios + + + + + + + + Second successful scenario + + + + + + FeatureTitle + Feature with successful scenarios + + + + + + + + + + + + + + + + + + + Given I have a precondition that is failing +-> error: Assert.Fail failed. simulated failure + + Assert.Fail failed. simulated failure + at ReportingTest.SampleProject.StepDefinitions.GivenIHaveAPreconditionThatIs(String result) in C:\Users\jba\Dev\Code\SpecFlowExamples\MsTestConversion\ReportingTest.MSTestSampleProject\StepDefinitions.cs:line 24 + at lambda_method(ExecutionScope , String ) + at TechTalk.SpecFlow.Bindings.MethodBinding.InvokeAction(Object[] arguments, ITestTracer testTracer, TimeSpan& duration) + at TechTalk.SpecFlow.TestRunner.ExecuteStepMatch(BindingMatch match, Object[] arguments) + at TechTalk.SpecFlow.TestRunner.ExecuteStep(StepArgs stepArgs) + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at ReportingTest.MSTestSampleProject.FeatureWithFailingScenariosFeature.ScenarioWithFailingSteps() in c:\Users\jba\Dev\Code\SpecFlowExamples\MsTestConversion\ReportingTest.MSTestSampleProject\FeatureWithFailingScenarios.feature:line 14 + + + + + + + Given I have a pending precondition +-> No matching step definition found for the step. Use the following code to create one: + [Binding] + public class StepDefinitions + { + [Given(@"I have a pending precondition")] + public void GivenIHaveAPendingPrecondition() + { + ScenarioContext.Current.Pending(); + } + } + + Assert.Inconclusive failed. No matching step definition found for one or more steps. +[Binding] +public class StepDefinitions +{ + [Given(@"I have a pending precondition")] + public void GivenIHaveAPendingPrecondition() + { + ScenarioContext.Current.Pending(); + } +} + + at lambda_method(ExecutionScope , String ) + at TechTalk.SpecFlow.UnitTestProvider.MsTestRuntimeProvider.TestInconclusive(String message) + at TechTalk.SpecFlow.ErrorHandling.ErrorProvider.ThrowPendingError(TestStatus testStatus, String message) + at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors() + at ReportingTest.MSTestSampleProject.FeatureWithFailingScenariosFeature.ScenarioWithPendingSteps() in c:\Users\jba\Dev\Code\SpecFlowExamples\MsTestConversion\ReportingTest.MSTestSampleProject\FeatureWithFailingScenarios.feature:line 11 + + + + + + + Given I have a precondition that is successful +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("successful") (0,0s) +When I do something that works +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("works") (0,0s) +Then I have a postcondition that is successful +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("successful") (0,0s) + + + + + Given I have a precondition that is successful +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("successful") (0,0s) +And I have a precondition that is successful +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("successful") (0,0s) +When I do something that works +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("works") (0,0s) +Then I have a postcondition that is successful +-> done: StepDefinitions.GivenIHaveAPreconditionThatIs("successful") (0,0s) + + + + \ No newline at end of file diff --git a/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj b/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj index 57e209d7b..eed72c0b0 100644 --- a/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj +++ b/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj @@ -64,6 +64,7 @@ +