From a9aa38b565072cb79bea9eaf115ca4e29678b5eb Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 7 Jun 2024 11:38:36 +0200 Subject: [PATCH 01/16] Context has parameters info Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 14 ++++++++++++-- src/Gauge.Dotnet.csproj | 4 ++-- src/dotnet.json | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 9baaba2..22192b2 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -6,9 +6,11 @@ using System; +using System.Collections.Generic; using System.Linq; using Gauge.Dotnet.Wrappers; using Gauge.Messages; +using Gauge.CSharp.Lib; namespace Gauge.Dotnet { @@ -61,10 +63,18 @@ private dynamic StepFrom(StepInfo currentStep) if (currentStep == null || currentStep.Step == null) return activatorWrapper.CreateInstance(executionContextStepType); - return activatorWrapper.CreateInstance( + var parameters = new List>(); + foreach (var paramneter in currentStep.Step.Parameters) { + if (paramneter.ParameterType == Parameter.Types.ParameterType.Static) + parameters.Add(new List { "static", paramneter.Name, paramneter.Value }); + } + + var inst = activatorWrapper.CreateInstance( executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, - currentStep.StackTrace, currentStep.ErrorMessage); + currentStep.StackTrace, currentStep.ErrorMessage, parameters); + + return inst; } } } \ No newline at end of file diff --git a/src/Gauge.Dotnet.csproj b/src/Gauge.Dotnet.csproj index a211c11..6eff6a7 100644 --- a/src/Gauge.Dotnet.csproj +++ b/src/Gauge.Dotnet.csproj @@ -5,7 +5,7 @@ net6.0;net7.0;net8.0 Runner.NetCore30 The Gauge Team - 0.5.8 + 0.5.9 ThoughtWorks Inc. Gauge C# runner for Gauge. https://gauge.org @@ -23,7 +23,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/dotnet.json b/src/dotnet.json index 7ddaab9..2df5040 100644 --- a/src/dotnet.json +++ b/src/dotnet.json @@ -1,6 +1,6 @@ { "id": "dotnet", - "version": "0.5.8", + "version": "0.5.9", "description": "C# support for gauge + .NET 6.0/7.0/8.0", "run": { "windows": [ From 1bfe160f76612b423cf9fbdef9767f9186d87727 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 11 Jun 2024 13:52:43 +0200 Subject: [PATCH 02/16] Context params and table params Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 22192b2..675098d 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -11,6 +11,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.Messages; using Gauge.CSharp.Lib; +using System.Diagnostics.Tracing; namespace Gauge.Dotnet { @@ -64,15 +65,29 @@ private dynamic StepFrom(StepInfo currentStep) return activatorWrapper.CreateInstance(executionContextStepType); var parameters = new List>(); - foreach (var paramneter in currentStep.Step.Parameters) { - if (paramneter.ParameterType == Parameter.Types.ParameterType.Static) - parameters.Add(new List { "static", paramneter.Name, paramneter.Value }); + Table parametersTbl = null; + foreach (var parameter in currentStep.Step.Parameters) { + if (parameter.ParameterType == Parameter.Types.ParameterType.Static) + parameters.Add(new List { "Static", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) + parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) + parameters.Add(new List { "Special", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || + parameter.ParameterType == Parameter.Types.ParameterType.Table) { + parameters.Add(new List { "Table", parameter.Name, parameter.Value }); + parametersTbl = new Table(new List(parameter.Table.Headers.Cells)); + foreach (var row in parameter.Table.Rows) { + parametersTbl.AddRow(new List(row.Cells)); + } + } } var inst = activatorWrapper.CreateInstance( executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, - currentStep.StackTrace, currentStep.ErrorMessage, parameters); + currentStep.StackTrace, currentStep.ErrorMessage, + parameters, parametersTbl); return inst; } From 9d6b4e45c1d8c4b5e03388c96dcec8c6ac131ba5 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 11 Jun 2024 14:29:22 +0200 Subject: [PATCH 03/16] Context Step params and table params Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 675098d..ab52a7f 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -12,6 +12,7 @@ using Gauge.Messages; using Gauge.CSharp.Lib; using System.Diagnostics.Tracing; +using Microsoft.VisualBasic; namespace Gauge.Dotnet { @@ -69,16 +70,27 @@ private dynamic StepFrom(StepInfo currentStep) foreach (var parameter in currentStep.Step.Parameters) { if (parameter.ParameterType == Parameter.Types.ParameterType.Static) parameters.Add(new List { "Static", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) parameters.Add(new List { "Special", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || parameter.ParameterType == Parameter.Types.ParameterType.Table) { parameters.Add(new List { "Table", parameter.Name, parameter.Value }); - parametersTbl = new Table(new List(parameter.Table.Headers.Cells)); - foreach (var row in parameter.Table.Rows) { - parametersTbl.AddRow(new List(row.Cells)); + + List headers = new List(); + foreach (var header in parameter.Table.Headers.Cells) + headers.Add(header); + parametersTbl = new Table(headers); + + foreach (var currentRow in parameter.Table.Rows) { + List row = new List(); + foreach (var item in currentRow.Cells) + row.Add(item); + parametersTbl.AddRow(row); } } } From 2b6152737d963aeff8be48483080c8cf8a83d0dd Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 18 Jun 2024 15:39:13 +0200 Subject: [PATCH 04/16] StepFrom parameters update Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index ab52a7f..5a24b5f 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -11,6 +11,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.Messages; using Gauge.CSharp.Lib; +using Gauge.Dotnet.Processors; using System.Diagnostics.Tracing; using Microsoft.VisualBasic; @@ -20,11 +21,13 @@ public class ExecutionInfoMapper : IExecutionInfoMapper { private Type _executionContextType; private readonly IActivatorWrapper activatorWrapper; + private readonly ITableFormatter tableFormatter; public ExecutionInfoMapper(IAssemblyLoader assemblyLoader, IActivatorWrapper activatorWrapper) { _executionContextType = assemblyLoader.GetLibType(LibType.ExecutionContext); this.activatorWrapper = activatorWrapper; + tableFormatter = new TableFormatter(assemblyLoader, activatorWrapper); } public dynamic ExecutionContextFrom(ExecutionInfo currentExecutionInfo) @@ -66,32 +69,20 @@ private dynamic StepFrom(StepInfo currentStep) return activatorWrapper.CreateInstance(executionContextStepType); var parameters = new List>(); - Table parametersTbl = null; foreach (var parameter in currentStep.Step.Parameters) { - if (parameter.ParameterType == Parameter.Types.ParameterType.Static) + if (parameter.ParameterType == Parameter.Types.ParameterType.Static) { parameters.Add(new List { "Static", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) { parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) { parameters.Add(new List { "Special", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || parameter.ParameterType == Parameter.Types.ParameterType.Table) { - parameters.Add(new List { "Table", parameter.Name, parameter.Value }); - - List headers = new List(); - foreach (var header in parameter.Table.Headers.Cells) - headers.Add(header); - parametersTbl = new Table(headers); - - foreach (var currentRow in parameter.Table.Rows) { - List row = new List(); - foreach (var item in currentRow.Cells) - row.Add(item); - parametersTbl.AddRow(row); - } + var asJSon = tableFormatter.GetJSON(parameter.Table); + parameters.Add(new List { "Table", parameter.Name, asJSon }); } } @@ -99,7 +90,7 @@ private dynamic StepFrom(StepInfo currentStep) executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, currentStep.StackTrace, currentStep.ErrorMessage, - parameters, parametersTbl); + parameters); return inst; } From 3624899b1c26496714ffc35f21ef16def65351f3 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 14:17:11 +0200 Subject: [PATCH 05/16] Update to force pipeline Signed-off-by: Piotr Nestorow --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 3e7d7ca..2f6cde9 100644 --- a/README.MD +++ b/README.MD @@ -37,7 +37,7 @@ gauge run specs #### Install specific version ``` -gauge install dotnet --version 0.5.2 +gauge install dotnet --version 0.5.3 ``` #### Offline installation From 9da0bd10f2700c7e22669eee7284c86d037f74f9 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 15:33:36 +0200 Subject: [PATCH 06/16] ShouldMapStepDetails fix Signed-off-by: Piotr Nestorow --- test/ExecutionInfoMapperTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/ExecutionInfoMapperTests.cs b/test/ExecutionInfoMapperTests.cs index 8862e00..ba44385 100644 --- a/test/ExecutionInfoMapperTests.cs +++ b/test/ExecutionInfoMapperTests.cs @@ -4,6 +4,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.CSharp.Lib; using System.Linq; +using System.Collections.Generic; namespace Gauge.Dotnet.UnitTests { @@ -23,7 +24,7 @@ public void Setup() Retries = new ScenarioRetriesInfo{MaxRetries = 0, CurrentRetry = 0} }, CurrentSpec = new SpecInfo {FileName = "dummy.spec", Name = "Dummy Spec", IsFailed = true}, CurrentStep = new StepInfo {IsFailed = true, ErrorMessage = "Dummy Error", StackTrace = "Dummy Stacktrace", - Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"} + Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"}, } }; } @@ -77,7 +78,7 @@ public void ShouldMapStepDetails() var mockActivatorWrapper = new Mock(); mockActivatorWrapper.Setup(x => x.CreateInstance(typeof(ExecutionContext.StepDetails), executionInfo.CurrentStep.Step.ActualStepText, executionInfo.CurrentStep.IsFailed, - executionInfo.CurrentStep.StackTrace, executionInfo.CurrentStep.ErrorMessage)).Verifiable(); + executionInfo.CurrentStep.StackTrace, executionInfo.CurrentStep.ErrorMessage, new List>())).Verifiable(); new ExecutionInfoMapper(mockAssemblyLoader.Object, mockActivatorWrapper.Object).ExecutionContextFrom(executionInfo); mockActivatorWrapper.VerifyAll(); } From 13a8a6e62d3e80ebc8640bb0c9f4d9f7026e2613 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 15:37:20 +0200 Subject: [PATCH 07/16] project file update Signed-off-by: Piotr Nestorow --- src/Gauge.Dotnet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gauge.Dotnet.csproj b/src/Gauge.Dotnet.csproj index 6eff6a7..edb6cc2 100644 --- a/src/Gauge.Dotnet.csproj +++ b/src/Gauge.Dotnet.csproj @@ -24,7 +24,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From b97bb129c1a0c3776a0c340f982c9f7de606c847 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 15:42:04 +0200 Subject: [PATCH 08/16] csproj update Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 14 ++++++++++++-- src/Gauge.Dotnet.csproj | 4 ++-- src/dotnet.json | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 9baaba2..22192b2 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -6,9 +6,11 @@ using System; +using System.Collections.Generic; using System.Linq; using Gauge.Dotnet.Wrappers; using Gauge.Messages; +using Gauge.CSharp.Lib; namespace Gauge.Dotnet { @@ -61,10 +63,18 @@ private dynamic StepFrom(StepInfo currentStep) if (currentStep == null || currentStep.Step == null) return activatorWrapper.CreateInstance(executionContextStepType); - return activatorWrapper.CreateInstance( + var parameters = new List>(); + foreach (var paramneter in currentStep.Step.Parameters) { + if (paramneter.ParameterType == Parameter.Types.ParameterType.Static) + parameters.Add(new List { "static", paramneter.Name, paramneter.Value }); + } + + var inst = activatorWrapper.CreateInstance( executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, - currentStep.StackTrace, currentStep.ErrorMessage); + currentStep.StackTrace, currentStep.ErrorMessage, parameters); + + return inst; } } } \ No newline at end of file diff --git a/src/Gauge.Dotnet.csproj b/src/Gauge.Dotnet.csproj index e34bbd4..abd4585 100644 --- a/src/Gauge.Dotnet.csproj +++ b/src/Gauge.Dotnet.csproj @@ -5,7 +5,7 @@ net6.0;net7.0;net8.0 Runner.NetCore30 The Gauge Team - 0.5.8 + 0.5.9 ThoughtWorks Inc. Gauge C# runner for Gauge. https://gauge.org @@ -23,8 +23,8 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/dotnet.json b/src/dotnet.json index 7ddaab9..2df5040 100644 --- a/src/dotnet.json +++ b/src/dotnet.json @@ -1,6 +1,6 @@ { "id": "dotnet", - "version": "0.5.8", + "version": "0.5.9", "description": "C# support for gauge + .NET 6.0/7.0/8.0", "run": { "windows": [ From a8aaeba231ce198ad47f1c2f60184757ffcd05ca Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 11 Jun 2024 13:52:43 +0200 Subject: [PATCH 09/16] Context params and table params Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 22192b2..675098d 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -11,6 +11,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.Messages; using Gauge.CSharp.Lib; +using System.Diagnostics.Tracing; namespace Gauge.Dotnet { @@ -64,15 +65,29 @@ private dynamic StepFrom(StepInfo currentStep) return activatorWrapper.CreateInstance(executionContextStepType); var parameters = new List>(); - foreach (var paramneter in currentStep.Step.Parameters) { - if (paramneter.ParameterType == Parameter.Types.ParameterType.Static) - parameters.Add(new List { "static", paramneter.Name, paramneter.Value }); + Table parametersTbl = null; + foreach (var parameter in currentStep.Step.Parameters) { + if (parameter.ParameterType == Parameter.Types.ParameterType.Static) + parameters.Add(new List { "Static", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) + parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) + parameters.Add(new List { "Special", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || + parameter.ParameterType == Parameter.Types.ParameterType.Table) { + parameters.Add(new List { "Table", parameter.Name, parameter.Value }); + parametersTbl = new Table(new List(parameter.Table.Headers.Cells)); + foreach (var row in parameter.Table.Rows) { + parametersTbl.AddRow(new List(row.Cells)); + } + } } var inst = activatorWrapper.CreateInstance( executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, - currentStep.StackTrace, currentStep.ErrorMessage, parameters); + currentStep.StackTrace, currentStep.ErrorMessage, + parameters, parametersTbl); return inst; } From 049753c52842eafbe48ba72da6c16164d605fb69 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 11 Jun 2024 14:29:22 +0200 Subject: [PATCH 10/16] Context Step params and table params Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 675098d..ab52a7f 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -12,6 +12,7 @@ using Gauge.Messages; using Gauge.CSharp.Lib; using System.Diagnostics.Tracing; +using Microsoft.VisualBasic; namespace Gauge.Dotnet { @@ -69,16 +70,27 @@ private dynamic StepFrom(StepInfo currentStep) foreach (var parameter in currentStep.Step.Parameters) { if (parameter.ParameterType == Parameter.Types.ParameterType.Static) parameters.Add(new List { "Static", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) parameters.Add(new List { "Special", parameter.Name, parameter.Value }); + if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || parameter.ParameterType == Parameter.Types.ParameterType.Table) { parameters.Add(new List { "Table", parameter.Name, parameter.Value }); - parametersTbl = new Table(new List(parameter.Table.Headers.Cells)); - foreach (var row in parameter.Table.Rows) { - parametersTbl.AddRow(new List(row.Cells)); + + List headers = new List(); + foreach (var header in parameter.Table.Headers.Cells) + headers.Add(header); + parametersTbl = new Table(headers); + + foreach (var currentRow in parameter.Table.Rows) { + List row = new List(); + foreach (var item in currentRow.Cells) + row.Add(item); + parametersTbl.AddRow(row); } } } From 6a98bc111b4e2f71112eb84ead388ccc9a840e09 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Tue, 18 Jun 2024 15:39:13 +0200 Subject: [PATCH 11/16] StepFrom parameters update Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index ab52a7f..5a24b5f 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -11,6 +11,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.Messages; using Gauge.CSharp.Lib; +using Gauge.Dotnet.Processors; using System.Diagnostics.Tracing; using Microsoft.VisualBasic; @@ -20,11 +21,13 @@ public class ExecutionInfoMapper : IExecutionInfoMapper { private Type _executionContextType; private readonly IActivatorWrapper activatorWrapper; + private readonly ITableFormatter tableFormatter; public ExecutionInfoMapper(IAssemblyLoader assemblyLoader, IActivatorWrapper activatorWrapper) { _executionContextType = assemblyLoader.GetLibType(LibType.ExecutionContext); this.activatorWrapper = activatorWrapper; + tableFormatter = new TableFormatter(assemblyLoader, activatorWrapper); } public dynamic ExecutionContextFrom(ExecutionInfo currentExecutionInfo) @@ -66,32 +69,20 @@ private dynamic StepFrom(StepInfo currentStep) return activatorWrapper.CreateInstance(executionContextStepType); var parameters = new List>(); - Table parametersTbl = null; foreach (var parameter in currentStep.Step.Parameters) { - if (parameter.ParameterType == Parameter.Types.ParameterType.Static) + if (parameter.ParameterType == Parameter.Types.ParameterType.Static) { parameters.Add(new List { "Static", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.Dynamic) { parameters.Add(new List { "Dynamic", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialString) { parameters.Add(new List { "Special", parameter.Name, parameter.Value }); - - if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || + } + else if (parameter.ParameterType == Parameter.Types.ParameterType.SpecialTable || parameter.ParameterType == Parameter.Types.ParameterType.Table) { - parameters.Add(new List { "Table", parameter.Name, parameter.Value }); - - List headers = new List(); - foreach (var header in parameter.Table.Headers.Cells) - headers.Add(header); - parametersTbl = new Table(headers); - - foreach (var currentRow in parameter.Table.Rows) { - List row = new List(); - foreach (var item in currentRow.Cells) - row.Add(item); - parametersTbl.AddRow(row); - } + var asJSon = tableFormatter.GetJSON(parameter.Table); + parameters.Add(new List { "Table", parameter.Name, asJSon }); } } @@ -99,7 +90,7 @@ private dynamic StepFrom(StepInfo currentStep) executionContextStepType, currentStep.Step.ActualStepText, currentStep.IsFailed, currentStep.StackTrace, currentStep.ErrorMessage, - parameters, parametersTbl); + parameters); return inst; } From c51c0407f8ab9d3c741090eaf4c15458f15ca999 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 14:17:11 +0200 Subject: [PATCH 12/16] Update to force pipeline Signed-off-by: Piotr Nestorow --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index 3eb47ef..46643e7 100644 --- a/README.MD +++ b/README.MD @@ -37,7 +37,7 @@ gauge run specs #### Install specific version ``` -gauge install dotnet --version 0.5.2 +gauge install dotnet --version 0.5.3 ``` #### Offline installation From 5ab2ae2525997faed7c9b2fb468120371e9fa1a9 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 15:33:36 +0200 Subject: [PATCH 13/16] ShouldMapStepDetails fix Signed-off-by: Piotr Nestorow --- test/ExecutionInfoMapperTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/ExecutionInfoMapperTests.cs b/test/ExecutionInfoMapperTests.cs index 8862e00..ba44385 100644 --- a/test/ExecutionInfoMapperTests.cs +++ b/test/ExecutionInfoMapperTests.cs @@ -4,6 +4,7 @@ using Gauge.Dotnet.Wrappers; using Gauge.CSharp.Lib; using System.Linq; +using System.Collections.Generic; namespace Gauge.Dotnet.UnitTests { @@ -23,7 +24,7 @@ public void Setup() Retries = new ScenarioRetriesInfo{MaxRetries = 0, CurrentRetry = 0} }, CurrentSpec = new SpecInfo {FileName = "dummy.spec", Name = "Dummy Spec", IsFailed = true}, CurrentStep = new StepInfo {IsFailed = true, ErrorMessage = "Dummy Error", StackTrace = "Dummy Stacktrace", - Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"} + Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"}, } }; } @@ -77,7 +78,7 @@ public void ShouldMapStepDetails() var mockActivatorWrapper = new Mock(); mockActivatorWrapper.Setup(x => x.CreateInstance(typeof(ExecutionContext.StepDetails), executionInfo.CurrentStep.Step.ActualStepText, executionInfo.CurrentStep.IsFailed, - executionInfo.CurrentStep.StackTrace, executionInfo.CurrentStep.ErrorMessage)).Verifiable(); + executionInfo.CurrentStep.StackTrace, executionInfo.CurrentStep.ErrorMessage, new List>())).Verifiable(); new ExecutionInfoMapper(mockAssemblyLoader.Object, mockActivatorWrapper.Object).ExecutionContextFrom(executionInfo); mockActivatorWrapper.VerifyAll(); } From facfd51b50a132e0fc8c8d9de52a6aafdb980440 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Fri, 16 Aug 2024 15:37:20 +0200 Subject: [PATCH 14/16] project file update Signed-off-by: Piotr Nestorow --- src/Gauge.Dotnet.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gauge.Dotnet.csproj b/src/Gauge.Dotnet.csproj index abd4585..d7e799e 100644 --- a/src/Gauge.Dotnet.csproj +++ b/src/Gauge.Dotnet.csproj @@ -23,8 +23,8 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 4772e124c3d09d45e29256ec072e577711481a9a Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Mon, 19 Aug 2024 09:11:36 +0200 Subject: [PATCH 15/16] Version update Signed-off-by: Piotr Nestorow --- src/dotnet.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dotnet.json b/src/dotnet.json index 2df5040..da2ab82 100644 --- a/src/dotnet.json +++ b/src/dotnet.json @@ -1,6 +1,6 @@ { "id": "dotnet", - "version": "0.5.9", + "version": "0.6.0", "description": "C# support for gauge + .NET 6.0/7.0/8.0", "run": { "windows": [ From 777c5d727634b4437b6f09103cd8b2b0d44ae7c9 Mon Sep 17 00:00:00 2001 From: Piotr Nestorow Date: Mon, 19 Aug 2024 09:20:23 +0200 Subject: [PATCH 16/16] Cosmetic updates Signed-off-by: Piotr Nestorow --- src/ExecutionInfoMapper.cs | 2 -- test/ExecutionInfoMapperTests.cs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ExecutionInfoMapper.cs b/src/ExecutionInfoMapper.cs index 5a24b5f..a8a519e 100644 --- a/src/ExecutionInfoMapper.cs +++ b/src/ExecutionInfoMapper.cs @@ -12,8 +12,6 @@ using Gauge.Messages; using Gauge.CSharp.Lib; using Gauge.Dotnet.Processors; -using System.Diagnostics.Tracing; -using Microsoft.VisualBasic; namespace Gauge.Dotnet { diff --git a/test/ExecutionInfoMapperTests.cs b/test/ExecutionInfoMapperTests.cs index ba44385..5d5e18f 100644 --- a/test/ExecutionInfoMapperTests.cs +++ b/test/ExecutionInfoMapperTests.cs @@ -24,7 +24,7 @@ public void Setup() Retries = new ScenarioRetriesInfo{MaxRetries = 0, CurrentRetry = 0} }, CurrentSpec = new SpecInfo {FileName = "dummy.spec", Name = "Dummy Spec", IsFailed = true}, CurrentStep = new StepInfo {IsFailed = true, ErrorMessage = "Dummy Error", StackTrace = "Dummy Stacktrace", - Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"}, + Step = new ExecuteStepRequest {ActualStepText = "Dummy Step Text"} } }; }