Skip to content

Commit

Permalink
Implement requested changes for PR #371
Browse files Browse the repository at this point in the history
  - Add allure directory clean before all tests in Allure.NUnit.Examples
  - NUnit.Allure.Core.AllureExtensions.AddScreenDiff is back
    and marked as obsolete (it just directly calls
    AllureLifecycle.AddScreenDiff now).
  - Intendation in Allure.SpecFlowPlugin.csproj fixed.
  • Loading branch information
delatrie committed Aug 8, 2023
1 parent 013fcb6 commit a00d452
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 4 deletions.
17 changes: 17 additions & 0 deletions Allure.NUnit.Examples/AllureSetUpFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Allure.Net.Commons;
using NUnit.Allure.Core;
using NUnit.Framework;

namespace Allure.NUnit.Examples
{
[SetUpFixture]
public class AllureSetUpFixture
{
[OneTimeSetUp]
public static void CleanupResultDirectory() =>
AllureExtensions.WrapSetUpTearDownParams(
AllureLifecycle.Instance.CleanupResultDirectory,
"Clear Allure Results Directory"
);
}
}
17 changes: 14 additions & 3 deletions Allure.NUnit/Core/AllureExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Reflection;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using Allure.Net.Commons;
using NUnit.Framework.Internal;
using System.Linq;
using System.Threading.Tasks;

namespace NUnit.Allure.Core
{
Expand Down Expand Up @@ -204,5 +203,17 @@ public static async Task<T> WrapInStepAsync<T>(
throw;
}
}

[Obsolete(
"Use AllureLifecycle.AddScreenDiff instance method instead to " +
"add a screen diff to the current test."
)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void AddScreenDiff(
this AllureLifecycle lifecycle,
string expected,
string actual,
string diff
) => lifecycle.AddScreenDiff(expected, actual, diff);
}
}
2 changes: 1 addition & 1 deletion Allure.SpecFlowPlugin/Allure.SpecFlowPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>
<Nullable>enable</Nullable>
<PackageId>Allure.SpecFlow</PackageId>
<Version>2.10-SNAPSHOT</Version>
<Authors>Alexander Bakanov</Authors>
Expand Down

0 comments on commit a00d452

Please sign in to comment.