Search code examples
reportasp.net-core-2.0xunit.netallure

How to generate Allure2 report for Xunit.net project


Does Allure2 support xunit project? I do not find it in the Allure2 documentation https://docs.qameta.io/allure/2.0/ But is there some adapter to implement it?


Solution

  • Allure2 does support xunit project. It does not require special adapter. Allure2 has inbuilt plugin trx-plugin and xunit-xml-plugin. Steps taken for .netcore2 xunit test project using allure-commandline.

    Refer to the docs to install allure commandline

    Mac OS X brew install allure

    Windows scoop install allure

    Linux for debian-based repositories a PPA is provided

    sudo apt-add-repository ppa:qameta/allure
    sudo apt-get update
    sudo apt-get install allure
    

    TRX report

    1. Generated output xunit trx report with command: dotnet test --logger:trx
    2. Generate Allure report with command: allure serve /home/path/to/project/target/surefire-reports/

    XML Report

    1. Add a reference to the Xunit Logger nuget package in test project.

    2. Generate output xunit xml report with command: dotnet test --logger:xunit

    3. Generated Allure report with command: allure serve /home/path/to/project/target/surefire-reports/