Skip to content
Allure integrations for C# test frameworks
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
Allure.Commons.NetCore.Nuget.Tests allureConfig.json is renamed to allureConfig.Template.json in nuget p… Jan 2, 2019
Allure.Commons.Tests #21 fixed: Links are reduced to lower case Jan 3, 2019
Allure.Commons #21 fixed: Links are reduced to lower case Jan 3, 2019
Allure.SpecFlowPlugin #21 fixed: Links are reduced to lower case Jan 3, 2019
Allure.SpecflowPlugin.Nuget.Tests allureConfig.json is renamed to allureConfig.Template.json in nuget p… Jan 2, 2019
Tests.SpecRun SpecFlow dependency constraint is set to 2.* Jan 2, 2019
.gitattributes Allure.Commons v2 Jun 21, 2017
.gitignore tests Sep 7, 2018
AUTHORS update authors Jun 26, 2017
Allure.Commons.sln Configuration read refactoring Sep 5, 2018
Allure.Specflow.sln tests Sep 7, 2018 add github stuff Jun 26, 2017
LICENSE add github stuff Jun 26, 2017
Nuget.Tests.sln nuget tests proj rename Jan 2, 2019 Update Jan 2, 2019
allure-csharp.sln Link patterns support + project structure refactoring (#10) May 24, 2018
nuget.config allureConfig.json is renamed to allureConfig.Template.json in nuget p… Jan 2, 2019

Allure c# Integrations


.Net implementation of Allure java-commons.

Can be targeted either by .net 4.6.* or .net standard 2.* projects.

Use this library to create custom Allure adapters for .Net test frameworks.


Allure lifecycle is configured via json file with default name allureConfig.json. NuGet package installs allureConfig.Template.json which you can use as a template. There are 2 ways to specify config file location:

<None Update="allureConfig.json">

Raw json configuration can be accessed from AllureLifeCycle.Instance.JsonConfiguration to extend configuration by adapters. See extension example here:

Base configuration params are stored in AllureLifeCycle.Instance.Configuration

Allure configuration section is used to setup output directory and link patterns, e.g.:

  "allure": {
    "directory": "allure-results", // optional, default value is "allure-results"
    "title": "custom run title", // optional
    "links": //optional 

All Link pattern placeholders will be replaced with URL value of corresponding link type, e.g.

link(type: "issue", url: "BUG-01") =>


AllureLifecycle class provides methods for test engine events processing.

Use AllureLifecycle.Instance property to access.

Fixture Events

  • StartBeforeFixture
  • StartAfterFixture
  • UpdateFixture
  • StopFixture

Testcase Events

  • StartTestCase
  • UpdateTestCase
  • StopTestCase
  • WriteTestCase

Step Events

  • StartStep
  • UpdateStep
  • StopStep

Attachment Events

  • AddAttachment - adds attachment to the current lifecycle executable item
  • AddScreenDiff - adds needed artifacts to the test case with given uuid to be used with screen-diff-plugin

Utility Methods

  • CleanupResultDirectory - can be used in test run setup to clean old result files



SpecFlow Adapter NuGet

Currently supports SpecFlow v2.1 - 2.4. Please use corresponding NuGet package version.


Make sure your test project targets .net 4.6.1 or higher.

Install the latest version of Specflow.Allure nuget package.


The plugin uses Allure.Commons json configuration extended with custom sections.

Custom host name

In case if you want to customize host name which is displayed in Allure Timeline section, please configure allure.title property in json configuraion file.

If you use NUnit

Default value for in allureConfig.json is "allure-results", default working directory in NUnit 3.* is the working directory of console runner. If you don't want to place allure results into NUnit default working folder please either set absolute path in allure.config or set working directory for NUnit in your test setup, e.g.:

public void Init()
   Environment.CurrentDirectory = Path.GetDirectoryName(GetType().Assembly.Location);


Just run your SpecFlow scenarios and find allure-results folder ready to generate Allure report.



You can structure your scenarios in 3 Allure hierarchies using feature and scenario tags. Please read report structure Allure documentation section for additional details. Hierarchies consist of the following levels:


  • Parent Suite
    • Suite
      • Sub Suite


  • Epic
    • Feature
      • Story


  • Package
    • Class
      • Method

The plugin uses allure:grouping configuration section to parse tags with the regular expression. If the expression contains the group, it will be used as hierarchy level name otherwise entire match will be used. E.g:

^mytag.* : any tags starting with @mytag will be used for grouping.

^type:(ui|api) : @ui or @api tags from regex pattern will be used for grouping.

Check this config example as a starting point.


You can add links to your scenarios using tags. Tag and link patterns can be configured in allureConfig.json

  "allure": {
    "links": [
  "specflow": {
    "links": {
      "link": "^link:(.+)",
      "issue": "^\\d+",
      "tms": "^tms:(\\d+)"

The following scenario

@123456 @tms:42 @link: 
Scenario: I do like click on links in Allure report 

will have three links in Allure report: 123456, 42 and

In case there are links, which are generated during tests, then they can be added in code via AllureLifecycle:

AllureLifecycle.UpdateTestCase(testResult.uuid, tc =>
                tc.links.Add(new Link()
                    name = "Example link",
                    url = ""

This will show for scenario link with Text: Example link; and url: "".


You can add Severity for your scenarios using tags. It can be configured in allureConfig.json

 "labels": {
      "severity": "^(normal|blocker|critical|minor|trivial)"

The following scenario

Scenario: ....

will set current scenario severity in Allure report as Blocker

Tables conversion

Table arguments in SpecFlow steps can be converted either to step csv-attacments or step parameters in the Allure report. The conversion is configurable in specflow:stepArguments config section. With specflow:stepArguments:convertToParameters set to true the following table arguments will be represented as parameters:

  • one row tables
  • two column tables with the headers matching both specflow:stepArguments:paramNameRegex and specflow:stepArguments:paramValueRegex regular expressions.
SpecFlow Allure


You can add attachments to an Allure report from your step bindings:

using Allure.Commons;
AllureLifecycle.AddAttachment(path, "Attachment Title");
// or
AllureLifecycle.AddAttachment("Attachment Title", "application/txt", "path");
// where "application/txt" - type of your attachment
You can’t perform that action at this time.