Allure.Net 3.0.0-preview.1

Prefix Reserved
This is a prerelease version of Allure.Net.
dotnet add package Allure.Net --version 3.0.0-preview.1
                    
NuGet\Install-Package Allure.Net -Version 3.0.0-preview.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Allure.Net" Version="3.0.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Allure.Net" Version="3.0.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Allure.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Allure.Net --version 3.0.0-preview.1
                    
#r "nuget: Allure.Net, 3.0.0-preview.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Allure.Net@3.0.0-preview.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Allure.Net&version=3.0.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Allure.Net&version=3.0.0-preview.1&prerelease
                    
Install as a Cake Tool

Allure.Net

Nuget release Nuget downloads

Allure.Net is a library that provides APIs and integration infrastructure for reporting .NET test execution to Allure.


Overview

Allure.Net provides APIs and integration infrastructure for reporting .NET test execution to Allure.

The package has two main audiences:

  • Test projects and libraries use AllureApi and the Allure attributes to add steps, labels, links, parameters, attachments, and other information to a report.
  • Test framework integrations implement an Allure runtime endpoint and register a route that connects API calls to the correct test execution.

Allure.Net supports multiple simultaneous executions, both in-process and out-of-process.

Using the API

The static AllureApi facade provides synchronous and asynchronous operations. The corresponding methods share the same facade; asynchronous method names use the Async suffix.

using Allure;
using Allure.Model;

public async Task CreateOrder()
{
    AllureApi.SetOwner("Payments team");
    AllureApi.SetSeverity(Severity.Critical);
    AllureApi.AddTags("checkout");
    AllureApi.AddIssue("https://issues.example/PAY-123", "PAY-123");
    AllureApi.AddTestParameter("currency", "USD");

    var orderId = await AllureApi.StepAsync(
        "Create the order",
        async () => await CreateOrderAsync()
    );

    AllureApi.AddAttachment(
        "Order response",
        $"{{\"orderId\":\"{orderId}\"}}",
        "application/json",
        ".json"
    );
}

Steps may receive a context for changing the step result at runtime:

var response = await AllureApi.StepAsync(
    "Send request",
    async context =>
    {
        await context.AddParameterAsync("attempt", "1");
        var result = await SendRequestAsync();
        await context.SetNameAsync($"Send request: {result.StatusCode}");
        return result;
    }
);

Attributes provide the same reporting capabilities for method-based instrumentation:

public sealed class CheckoutClient
{
    [AllureStep("Create order for {customerId}")]
    public async Task<string> CreateOrderAsync(string customerId)
    {
        // The call is represented as an Allure step.
        return await SendCreateOrderRequestAsync(customerId);
    }

    [AllureAttachment("Response for {orderId}", ContentType = "application/json")]
    public string GetResponseBody(string orderId) => LoadResponse(orderId);
}

Accessing the in-process model

Use AllureInProcessApi when a change cannot be expressed by the portable API:

AllureInProcessApi.UpdateTestResult(result =>
{
    result.Description = "Description computed during the test";
});

var testName = AllureInProcessApi.ReadTestResult(
    result => result.Name,
    fallback: "No active test"
);

These operations throw InvalidOperationException when the selected endpoint does not support in-process access.

Creating an integration

An integration exposes its runtime through IAllureRuntimeEndpoint and describes when that endpoint should receive calls with IAllureRuntimeRoute. MatchesCurrentScope should use framework-owned execution state, typically an AsyncLocal-backed test context, to identify calls belonging to the integration. Global data, such as global attachments and errors, is routed to the endpoint matching the current scope when one is available. MatchesGlobalScope controls whether the route accepts global data when no current-scope endpoint is available.

The following example shows the routing portion of an in-process integration. ExampleEndpoint supplies the integration's implementations of the synchronous and asynchronous operation interfaces.

using System.Collections.Immutable;
using Allure.Abstractions;
using Allure.Runtime;

public sealed class ExampleEndpoint : IAllureInProcessRuntimeEndpoint
{
    public string Name => "Example Framework";

    public bool IsAvailable => true;

    public required IAllureApiOperations Operations { get; init; }

    public required IAllureInProcessApiOperations InProcessOperations { get; init; }

    public required IAllureParameterSerializer ParameterSerializer { get; init; }
}

public sealed class ExampleRoute(ExampleEndpoint endpoint) : IAllureRuntimeRoute
{
    public string Id => "example-framework";

    public bool MatchesCurrentScope =>
        ExampleTestContext.Current?.TestId is not null;

    public bool MatchesGlobalScope => true;

    public ImmutableHashSet<string> SuppressedRouteIds { get; } =
        ImmutableHashSet<string>.Empty;

    public IAllureRuntimeEndpoint Endpoint => endpoint;
}

public sealed class ExampleIntegration : IDisposable
{
    private readonly IDisposable registration;

    public ExampleIntegration(ExampleEndpoint endpoint)
    {
        registration = AllureRuntimeRouter.Install(new ExampleRoute(endpoint));
    }

    public void Dispose() => registration.Dispose();
}

Keep the registration alive for as long as the integration can handle calls, and dispose of it during framework shutdown. Routes may declare SuppressedRouteIds when a more specific integration must take precedence over another matching route. If multiple unsuppressed routes match the same scope, endpoint resolution fails.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Allure.Net:

Package Downloads
Allure.Net.Sdk

Provides the API and utilities for building Allure integrations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-preview.1 77 8/26/2026