SpecFlow+LivingDoc error
I added the Specflow+Living doc to 2 projects. In 1st project it is working absolutely fine. However when I added similar code to yaml pipeline in 2nd one, it started giving this weird error. It fails while running following command:
##[debug]dotnet "C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.943\CLI\LivingDoc.CLI.dll" test-assembly "output\x64\release\SystemTests.dll" --output-type JSON --include-test-output "All" --output "C:\agent\_work\11\s\38764\FeatureData.json" --project-language "en"
ERROR BELOW:
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: An item with the same key has already been added. Key: value
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at LivingDoc.CLI.Services.StepInformationCollector.GetStepData(List`1 features) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Services\StepInformationCollector.cs:line 73
at LivingDoc.CLI.Services.StepInformationCollector.GetStepInformation(List`1 featureNodes) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Services\StepInformationCollector.cs:line 23
at LivingDoc.CLI.Services.UnusedStepDefinitionsService.GetUnusedStepDefinitions(List`1 featureNodes, List`1 testAssemblyPaths, GeneratorSource generatorSource) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Services\UnusedStepDefinitionsService.cs:line 35
at LivingDoc.CLI.Services.UnusedStepDefinitionsService.BuildUnusedStepDefinitionsReport(List`1 featureNodes, List`1 testAssemblyPaths, GeneratorSource generatorSource) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\Services\UnusedStepDefinitionsService.cs:line 68
at LivingDoc.CLI.ReportGenerator.FillStepReports(Report report, Parameters parameters, GeneratorSource generatorSource) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ReportGenerator.cs:line 132
at LivingDoc.CLI.ReportGenerator.Generate(GeneratorSource source, Parameters parameters) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ReportGenerator.cs:line 118
at LivingDoc.CLI.ArgumentResolver.Handle(String workingFolder, GeneratorSource source, Parameters parameters) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ArgumentResolver.cs:line 234
at LivingDoc.CLI.ArgumentResolver.<>c__DisplayClass5_0.<Resolve>b__0(Parameters p) in D:\a\1\s\src\SpecFlow.Integration\LivingDoc.CLI\ArgumentResolver.cs:line 176
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
YAML CODE:
-
This is a bug that the build task fails with this error.
You have a scenario outline where you have an inconsistent example section table where multiple columns have the same title. something likeScenario Outline: Add two numbers
Given I have entered <First> in the calculator
And I have entered <Second> into the calculator
When I press add
Then the result should be <value> on the screen
Examples:
| First | Second | value | value |
| 50 | 70 | 120 | 120 |
| 30 | 40 | 70 | 70 |
| 60 | 30 | 90 | 90 |Here you have two value column which causing an error is SpecFlow because it won't know which column to use.
If you find this scenario outline and give a unique column name to every column also it should work in the build task.0
Please sign in to leave a comment.
Comments
1 comment