diff --git a/Documentation/SpecFlow Guide.docx b/Documentation/SpecFlow Guide.docx index b1f94ec69..91afb45ae 100644 Binary files a/Documentation/SpecFlow Guide.docx and b/Documentation/SpecFlow Guide.docx differ diff --git a/Generator/TechTalk.SpecFlow.Generator.csproj b/Generator/TechTalk.SpecFlow.Generator.csproj index 956466643..241998e5f 100644 --- a/Generator/TechTalk.SpecFlow.Generator.csproj +++ b/Generator/TechTalk.SpecFlow.Generator.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/Installer/ImportGherkinParser/ImportGherkinParser.csproj b/Installer/ImportGherkinParser/ImportGherkinParser.csproj index 805f94a17..72586f436 100644 --- a/Installer/ImportGherkinParser/ImportGherkinParser.csproj +++ b/Installer/ImportGherkinParser/ImportGherkinParser.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/Installer/SpecFlowInstaller/Product.wxs b/Installer/SpecFlowInstaller/Product.wxs index d112e3878..7754bb176 100644 --- a/Installer/SpecFlowInstaller/Product.wxs +++ b/Installer/SpecFlowInstaller/Product.wxs @@ -1,8 +1,8 @@ - - + + diff --git a/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj b/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj index 885f2eeff..a3ae654ac 100644 --- a/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj +++ b/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj @@ -1,4 +1,4 @@ - + Debug x86 @@ -7,8 +7,8 @@ 2.0 SpecFlowSetup Package - $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.5\Wix.targets - $(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\Wix.targets + $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.5\Wix2010.targets + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\Wix2010.targets bin\$(Configuration)\ diff --git a/Parser/TechTalk.SpecFlow.Parser.csproj b/Parser/TechTalk.SpecFlow.Parser.csproj index 6335caf29..417e74fe8 100644 --- a/Parser/TechTalk.SpecFlow.Parser.csproj +++ b/Parser/TechTalk.SpecFlow.Parser.csproj @@ -1,5 +1,5 @@ - - + + Debug AnyCPU 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/Reporting/TechTalk.SpecFlow.Reporting.csproj b/Reporting/TechTalk.SpecFlow.Reporting.csproj index 9369e8bff..25cd2dad5 100644 --- a/Reporting/TechTalk.SpecFlow.Reporting.csproj +++ b/Reporting/TechTalk.SpecFlow.Reporting.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/Runtime.Silverlight/Properties/AssemblyInfo.cs b/Runtime.Silverlight/Properties/AssemblyInfo.cs index 9da5cad6a..79c201e17 100644 --- a/Runtime.Silverlight/Properties/AssemblyInfo.cs +++ b/Runtime.Silverlight/Properties/AssemblyInfo.cs @@ -21,15 +21,3 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("04dec58a-9677-4f58-ae8b-4744bbffb9a9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Runtime.Silverlight/TechTalk.SpecFlow.Silverlight.csproj b/Runtime.Silverlight/TechTalk.SpecFlow.Silverlight.csproj index 2ac937e87..31868d52a 100644 --- a/Runtime.Silverlight/TechTalk.SpecFlow.Silverlight.csproj +++ b/Runtime.Silverlight/TechTalk.SpecFlow.Silverlight.csproj @@ -1,4 +1,8 @@ - + + + + v3.5 + Debug AnyCPU @@ -10,10 +14,12 @@ Properties TechTalk.SpecFlow TechTalk.SpecFlow.Silverlight - v3.5 + v3.0 false true true + Silverlight + $(TargetFrameworkVersion) true @@ -169,15 +175,24 @@ UnitTestProvider\MbUnitRuntimeProvider.cs + + UnitTestProvider\MsTest2010RuntimeProvider.cs + UnitTestProvider\MsTestRuntimeProvider.cs UnitTestProvider\NUnitRuntimeProvider.cs + + UnitTestProvider\UnitTestRuntimeProviderHelper.cs + UnitTestProvider\XUnitRuntimeProvider.cs + + VersionInfo.cs + @@ -191,7 +206,7 @@ Languages.xml - + - + \ No newline at end of file diff --git a/Tests/ParserTests/ParserTests.csproj b/Tests/ParserTests/ParserTests.csproj index d25894cc8..1a298f4ac 100644 --- a/Tests/ParserTests/ParserTests.csproj +++ b/Tests/ParserTests/ParserTests.csproj @@ -1,5 +1,5 @@ - - + + Debug AnyCPU 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 1e9c46242..950e651ad 100644 --- a/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj +++ b/Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj @@ -1,5 +1,5 @@ - - + + Debug AnyCPU @@ -66,6 +66,7 @@ + diff --git a/Tests/ReportingTests/NUnitExecutionReport.feature b/Tests/ReportingTests/NUnitExecutionReport.feature new file mode 100644 index 000000000..6aab265a0 --- /dev/null +++ b/Tests/ReportingTests/NUnitExecutionReport.feature @@ -0,0 +1,79 @@ +Feature: Generating HTML report from NUnit execution result + In order to present the test results in a nice form + As a test manager + I want to be able to generate an HTML report from the NUnit execution result + +Scenario: Summary is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ + Summary + Features Success rate Scenarios Success Failed Pending Ignored + 2 features 40% 5 2 1 1 1 + """ + + +Scenario: Feature summary is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ + Feature Summary + Feature Success rate Scenarios Success Failed Pending Ignored + Feature with failing scenarios 0% 3 0 1 1 1 + Feature with successful scenarios 100% 2 2 0 0 0 + """ + + +Scenario: Successful test output is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ + 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) + """ + + +Scenario: Pending test output is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ + 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(); + } + } + """ + + +Scenario: Failing test output is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ + Given I have a precondition that is failing + -> error: simulated failure + """ + + +Scenario: Failing test exception is included in the HTML result + Given there are NUuit test execution results for the ReportingTest.SampleProject project + When I generate SpecFlow NUnit execution report + Then a report generated containing + """ +simulated failure +at ReportingTest.SampleProject.StepDefinitions.GivenIHaveAPreconditionThatIs(String result) in + """ diff --git a/Tests/ReportingTests/NUnitExecutionReport.feature.cs b/Tests/ReportingTests/NUnitExecutionReport.feature.cs new file mode 100644 index 000000000..6ee6202fd --- /dev/null +++ b/Tests/ReportingTests/NUnitExecutionReport.feature.cs @@ -0,0 +1,190 @@ +// ------------------------------------------------------------------------------ +// +// This code was generated by SpecFlow (http://www.specflow.org/). +// SpecFlow Version:1.3.2.0 +// Runtime Version:4.0.30319.1 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +#region Designer generated code +namespace ReportingTests +{ + using TechTalk.SpecFlow; + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")] + [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [NUnit.Framework.TestFixtureAttribute()] + [NUnit.Framework.DescriptionAttribute("Generating HTML report from NUnit execution result")] + public partial class GeneratingHTMLReportFromNUnitExecutionResultFeature + { + + private static TechTalk.SpecFlow.ITestRunner testRunner; + +#line 1 "NUnitExecutionReport.feature" +#line hidden + + [NUnit.Framework.TestFixtureSetUpAttribute()] + public virtual void FeatureSetup() + { + testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); + TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Generating HTML report from NUnit execution result", "In order to present the test results in a nice form\r\nAs a test manager\r\nI want to" + + " be able to generate an HTML report from the NUnit execution result", ((string[])(null))); + testRunner.OnFeatureStart(featureInfo); + } + + [NUnit.Framework.TestFixtureTearDownAttribute()] + public virtual void FeatureTearDown() + { + testRunner.OnFeatureEnd(); + testRunner = null; + } + + public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) + { + testRunner.OnScenarioStart(scenarioInfo); + } + + [NUnit.Framework.TearDownAttribute()] + public virtual void ScenarioTearDown() + { + testRunner.OnScenarioEnd(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Summary is included in the HTML result")] + public virtual void SummaryIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Summary is included in the HTML result", ((string[])(null))); +#line 6 +this.ScenarioSetup(scenarioInfo); +#line 7 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 8 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 9 +testRunner.Then("a report generated containing", "\tSummary \r\n\tFeatures\tSuccess rate\tScenarios\tSuccess\t\tFailed\tPending\t\tIgnored \r\n\t2" + + " features\t40%\t\t\t\t5\t\t\t2\t\t\t1\t\t1\t\t\t1 ", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Feature summary is included in the HTML result")] + public virtual void FeatureSummaryIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Feature summary is included in the HTML result", ((string[])(null))); +#line 17 +this.ScenarioSetup(scenarioInfo); +#line 18 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 19 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 20 +testRunner.Then("a report generated containing", "\tFeature Summary\r\n\tFeature\t\t\t\t\t\t\t\tSuccess rate\tScenarios\tSuccess\t\tFailed\tPending\t" + + "\tIgnored\t\t\r\n\tFeature with failing scenarios\t\t0%\t\t\t\t3\t\t\t0\t\t\t1\t\t1\t\t\t1\r\n\tFeature wi" + + "th successful scenarios\t100%\t\t\t2\t\t\t2\t\t\t0\t\t0\t\t\t0", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Successful test output is included in the HTML result")] + public virtual void SuccessfulTestOutputIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Successful test output is included in the HTML result", ((string[])(null))); +#line 29 +this.ScenarioSetup(scenarioInfo); +#line 30 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 31 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 32 +testRunner.Then("a report generated containing", @" 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)", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Pending test output is included in the HTML result")] + public virtual void PendingTestOutputIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pending test output is included in the HTML result", ((string[])(null))); +#line 43 +this.ScenarioSetup(scenarioInfo); +#line 44 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 45 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 46 +testRunner.Then("a report generated containing", @" 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(); + } + }", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Failing test output is included in the HTML result")] + public virtual void FailingTestOutputIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Failing test output is included in the HTML result", ((string[])(null))); +#line 62 +this.ScenarioSetup(scenarioInfo); +#line 63 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 64 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 65 +testRunner.Then("a report generated containing", "\tGiven I have a precondition that is failing\r\n\t-> error: simulated failure", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("Failing test exception is included in the HTML result")] + public virtual void FailingTestExceptionIsIncludedInTheHTMLResult() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Failing test exception is included in the HTML result", ((string[])(null))); +#line 72 +this.ScenarioSetup(scenarioInfo); +#line 73 +testRunner.Given("there are NUuit test execution results for the ReportingTest.SampleProject projec" + + "t"); +#line 74 +testRunner.When("I generate SpecFlow NUnit execution report"); +#line hidden +#line 75 +testRunner.Then("a report generated containing", "simulated failure\r\nat ReportingTest.SampleProject.StepDefinitions.GivenIHaveAPrec" + + "onditionThatIs(String result) in ", ((TechTalk.SpecFlow.Table)(null))); +#line hidden + testRunner.CollectScenarioErrors(); + } + } +} +#endregion diff --git a/Tests/ReportingTests/ReportingTests.csproj b/Tests/ReportingTests/ReportingTests.csproj index 6fdfe7291..b6b91ce38 100644 --- a/Tests/ReportingTests/ReportingTests.csproj +++ b/Tests/ReportingTests/ReportingTests.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -54,6 +54,11 @@ True CustomXsltTemplate.feature + + True + True + NUnitExecutionReport.feature + @@ -81,6 +86,10 @@ SpecFlowSingleFileGenerator CustomXsltTemplate.feature.cs + + SpecFlowSingleFileGenerator + NUnitExecutionReport.feature.cs + true true + false + false + false + false + false - - - $(SettingUpDevenvDependsOn);SkipDevenvSetup - - - - - + \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 6951f8184..d816c4041 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,9 @@ -1.3.2 - ??? +1.3.2 - 2010/06/29 New features: + Support for MsTest for .NET 4.0 categories. Configure the test provider name to "MsTest.2010" in order to use the [TestCategory] attribute. ++ Silverlight support (beta), see http://wiki.github.com/techtalk/SpecFlow/silverlight-support Fixed issues: + Report generation fails if no custom XSLT is provided