You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are hitting this when calling methods annotated with AllureStep from within an NUnit SetupFixture, which I think is basically your scenario 1.
This currently doesn't work and results in a test failure:
using Allure.NUnit;
using Allure.NUnit.Attributes;
using Console = System.Console;
[SetUpFixture]
public class AssemblyInit{
[OneTimeSetUp]
public void OneTimeSetup()
{
Steps.Step1();
}
}
class Steps
{
[AllureStep("Step 1")]
public static void Step1()
{
Console.WriteLine("Step 1");
}
[AllureStep("Step 2")]
public static void Step2()
{
Console.WriteLine("Step 1");
}
}
namespace TestProject1
{
[AllureNUnit]
public class Tests
{
[Test]
public void Test1()
{
Steps.Step2();
}
}
}
Commenting out [AllureStep("Step 1")] gets the test running again - but we have many calls to various methods that we'd like to call from our setup fixture and use in our tests, and we currently can't mark those methods with the AllureStep attribute as we'd like (meaning they don't show up in our test reports).
I'm not sure if there is also a slightly seperate issue here that it is failing in the SetupFixture in the first place - tagging the fixture with AllureNunit does not change anything, and we still see the same failure. This may just be unsupported (in which case, maybe it should go in the docs somewhere if it isn't already?)
I'm submitting a ...
What is the current behavior?
AllureApi
breaks tests if no Allure context is active. The same goes forExtendedApi
.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
Suppose we have the following test in xUnit.net:
When running it with
dotnet test -- RunConfiguration.NoAutoReporters=true
, the test fails:What is the expected behavior?
The test should run without the error. Some kind of warning might be useful, but no exception should be thrown.
What is the motivation / use case for changing the behavior?
Exception-free API calls would allow the following scenarios that are currently impossible:
[AllureNUnit]
from a classNoAutoReporters
option to the runner.Please tell us about your environment:
Other information
That will probably require some consistent logging mechanism.
The text was updated successfully, but these errors were encountered: