ReportPortal.Shared

Multithreaded reporter of test results to https://reportportal.io


Keywords
api, report, reporter, reportportal, testing, automation, cs, dotnet, reporting, test
License
Apache-2.0
Install
Install-Package ReportPortal.Shared -Version 2.0.0-beta1

Documentation

API client for Report Portal

Provides an ability to interact with Report Portal API in .NET/C#. Supports starting/finishing launches/tests, sending logs.

CI NuGet Badge codecov

Setup

Install ReportPortal.Client NuGet package.

PS> Install-Package ReportPortal.Client

Usage

The main entry point to start interact with API is ReportPortal.Client.Service class. It requires uri, project name and uuid. Uuid value is specific for an user and it can be obtained on User Profile page.

var service = new ReportPortal.Client.Service(
new Uri("https://demo.reportportal.com"), "my_project", "my_uuid");

Starting new launch:

var launch = await service.Launch.StartAsync(new StartLaunchRequest
    {
        Name = "LaunchName",
        Description = "LaunchDescription"
    });

To start test item we need to use the LaunchUuid received from the previous step:

var test = await service.TestItem.StartAsync(new StartTestItemRequest
    {
        LaunchUuid = launch.Uuid,
        Name = "Test1",
        Type = TestItemType.Test
    });

To send log item the TestItemUuid is used which was received from the previous step:

var log = await service.LogItem.CreateAsync(new CreateLogItemRequest
    {
        TestItemUuid = test.Uuid,
        Text = "My log",
        Level = LogLevel.Debug
    }); 

Finishing the test:

await Service.TestItem.FinishAsync(test.Uuid, new FinishTestItemRequest
    {
        Status = Status.Passed
    });

Finishing the launch:

await Service.Launch.FinishAsync(launch.Uuid, new FinishLaunchRequest());