Skip to content

Unicorn-TAF/report-portal-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

198 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nuget Nuget

Unicorn.Reporting.ReportPortal

Unicorn has ability to generate powerful test results report using Report Portal

Just deploy ReportPortal instance, add tests project dependency to Unicorn.Reporting.ReportPortal package and initialize reporter during tests assembly initialization.


Place ReportPortal.config.json configuration file to directory with test assemblies. Sample content is presented below:

{
    "enabled": true,
    "server": {
        "url": "https://report-portal-uri/api/v1/",
        "project": "Some project",
        "authentication": {
        "uuid": "your_uuid"
        },
    },
    "launch": {
        "name": "Unicorn tests run",
        "description": "Unit tests of Unicorn Framework",
        "debugMode": false,
        "tags": [ "Windows 10", "UnicornFramework" ]
    }
}  

then add code with reporting initialization to [TestsAssembly]

using Unicorn.Taf.Api;
using Unicorn.Taf.Core.Testing.Tests.Attributes;
using Unicorn.Reporting.ReportPortal;

namespace Tests
{
    [TestsAssembly]
    public static class TestsAssembly
    {
        private static ITestReporter reporter;

        [RunInitialize]
        public static void InitRun()
        {
            reporter = new ReportPortalReporter(); // Start new launch in Report Portal.
            
            /* in case you want to report into already started existing launch use
             * reporter = new ReportPortalReporter(existing_launch_id); */
            
        }

        [RunFinalize]
        public static void FinalizeRun()
        {
            reporter.Dispose(); // Finish launch in Report portal if it was not externally started.
            reporter = null;
        }
    }
}