From fe22040dcd11dbae2d844d758f78867841f54c6c Mon Sep 17 00:00:00 2001 From: Aliaksej Mialeshka Date: Wed, 28 Feb 2024 17:17:45 +0100 Subject: [PATCH] update to compatible dotnet and package versions --- ...quality.WinAppDriver.Template.SpecFlow.csproj | 16 ++++++++-------- .../Hooks/PluginsHooks.cs | 5 ++--- .../Hooks/ScreenshotHooks.cs | 15 ++++----------- .../Aquality.WinAppDriver.Template.csproj | 2 +- .../Resources/settings.json | 6 ++++++ 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Aquality.WinAppDriver.Template.SpecFlow.csproj b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Aquality.WinAppDriver.Template.SpecFlow.csproj index c40cdc2..55483ef 100644 --- a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Aquality.WinAppDriver.Template.SpecFlow.csproj +++ b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Aquality.WinAppDriver.Template.SpecFlow.csproj @@ -1,24 +1,24 @@  - netcoreapp3.1 + net8.0 false - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + diff --git a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/PluginsHooks.cs b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/PluginsHooks.cs index e0f80ad..9a7320c 100644 --- a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/PluginsHooks.cs +++ b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/PluginsHooks.cs @@ -1,4 +1,4 @@ -using Allure.Commons; +using Allure.Net.Commons; using AqualityTracking.Integrations.Core; using NUnit.Framework; using System.Text.RegularExpressions; @@ -19,8 +19,7 @@ public PluginsHooks(ScenarioContext context) [AfterScenario(Order = -1)] public void UpdateAllureTestCaseName() { - context.TryGetValue(out TestResult testresult); - AllureLifecycle.Instance.UpdateTestCase(testresult.uuid, testCase => + AllureLifecycle.Instance.UpdateTestCase(testCase => { testCase.name += GetScenarioNameSuffix(); testCase.historyId = TestContext.CurrentContext.Test.FullName; diff --git a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/ScreenshotHooks.cs b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/ScreenshotHooks.cs index 9470b61..0e34899 100644 --- a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/ScreenshotHooks.cs +++ b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.SpecFlow/Hooks/ScreenshotHooks.cs @@ -1,4 +1,4 @@ -using Allure.Commons; +using Allure.Net.Commons; using Aquality.WinAppDriver.Applications; using Aquality.WinAppDriver.Template.Utilities; using AqualityTracking.Integrations.Core; @@ -8,16 +8,9 @@ namespace Aquality.WinAppDriver.Template.SpecFlow.Hooks { [Binding] - public class ScreenshotHooks + public class ScreenshotHooks(ScreenshotProvider screenshotProvider) { - private readonly ScreenshotProvider screenshotProvider; - private readonly ScenarioContext scenarioContext; - - public ScreenshotHooks(ScenarioContext scenarioContext, ScreenshotProvider screenshotProvider) - { - this.scenarioContext = scenarioContext; - this.screenshotProvider = screenshotProvider; - } + private readonly ScreenshotProvider screenshotProvider = screenshotProvider; [AfterScenario(Order = 0)] public void TakeScreenshot() @@ -26,7 +19,7 @@ public void TakeScreenshot() { var pathToScreenshot = screenshotProvider.TakeScreenshot(); TestContext.AddTestAttachment(pathToScreenshot); - AllureLifecycle.Instance.AddAttachment(pathToScreenshot, "Screenshot"); + AllureApi.AddAttachment(pathToScreenshot, "Screenshot"); AqualityTrackingLifecycle.Instance.AddAttachment(pathToScreenshot); } } diff --git a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.csproj b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.csproj index cbd9958..04a1ec9 100644 --- a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.csproj +++ b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template.csproj @@ -15,7 +15,7 @@ - + diff --git a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Resources/settings.json b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Resources/settings.json index 7f97d20..aa3e6a9 100644 --- a/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Resources/settings.json +++ b/Aquality.WinAppDriver.Template/Aquality.WinAppDriver.Template/Resources/settings.json @@ -26,5 +26,11 @@ }, "elementCache": { "isEnabled": true + }, + "visualization": { + "defaultThreshold": 0.03, + "comparisonWidth": 16, + "comparisonHeight": 16, + "pathToDumps": "../../../Resources/VisualDumps/" } } \ No newline at end of file