Skip to content

reportportal/client-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());