diff --git a/Gauge.CSharp.Lib/Gauge.CSharp.Lib.csproj b/Gauge.CSharp.Lib/Gauge.CSharp.Lib.csproj index a9b71d6..4dc2fa3 100644 --- a/Gauge.CSharp.Lib/Gauge.CSharp.Lib.csproj +++ b/Gauge.CSharp.Lib/Gauge.CSharp.Lib.csproj @@ -4,9 +4,9 @@ net6.0;net7.0;net8.0 CSharp bindings for Gauge. Write CSharp step implementation for Gauge specs. https://gauge.org enable - 0.11.1 - 0.11.1.0 - 0.11.1.0 + 0.11.2 + 0.11.2.0 + 0.11.2.0 getgauge ThoughtWorks Inc. Copyright © ThoughtWorks Inc. 2018 diff --git a/Gauge.CSharp.Lib/GaugeScreenshots.cs b/Gauge.CSharp.Lib/GaugeScreenshots.cs index baccf04..0e87a82 100644 --- a/Gauge.CSharp.Lib/GaugeScreenshots.cs +++ b/Gauge.CSharp.Lib/GaugeScreenshots.cs @@ -20,4 +20,27 @@ public static void Capture() { ScreenshotFiles.Add(screenshotWriter.TakeScreenShot()); } + + public static void CaptureByStream(int streamId) + { + SetDataStores(streamId); + ScreenshotFiles.Add(screenshotWriter.TakeScreenShot()); + } + + private static void SetDataStores(int streamId) + { + var dataStore = DataStoreFactory.GetDataStoresByStream(streamId); + lock (SuiteDataStore.Store) + { + SuiteDataStore.Store.Value = DataStoreFactory.SuiteDataStore; + } + lock (SpecDataStore.Store) + { + SpecDataStore.Store.Value = dataStore.GetValueOrDefault(DataStoreType.Spec, null); + } + lock (ScenarioDataStore.Store) + { + ScenarioDataStore.Store.Value = dataStore.GetValueOrDefault(DataStoreType.Scenario, null); + } + } } \ No newline at end of file