Skip to content

Shakevg/ReportPortal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell Gallery - ReportPortal GitHub - Release AppVeyor - master

ReportPortal PowerShell Module

PowerShell module to interact with the Report Portal.

Introduction

With this module, a test execution can be uploaded to the Report Portal. The module is tested against Report Portal version 5. The module supports creating launches, tests items (suites, tests, steps) and test logs.

The following example shows a whole test run, of course without proper error handling. But it is recommended to put the Stop- cmdlet into the finally block, so that the started launches and items always will be stopped at the end.

Connect-RPServer -Url 'https://reportportal' -ProjectName 'MyProject' -Credential 'myuser'

try
{
    $launch = Start-RPLaunch -Name 'Demo' -Attribute 'Foo:Bar', 'Hello:World'

    try
    {
        $suite = Start-RPTestItem -Launch $launch -Type 'Suite' -Name 'Suite 1'

        try
        {
            $test = Start-RPTestItem -Launch $launch -Parent $suite -Type 'Test' -Name 'Test 1'

            try
            {
                $step = Start-RPTestItem -Launch $launch -Parent $test -Type 'Step' -Name 'Step 1'

                Add-RPLog -TestItem $step -Level 'Info' -Message 'My Info Message'
                Add-RPLog -TestItem $step -Level 'Error' -Message 'My Error Message'
            }
            finally
            {
                Stop-RPTestItem -TestItem $step
            }
        }
        finally
        {
            Stop-RPTestItem -TestItem $test
        }
    }
    finally
    {
        Stop-RPTestItem -TestItem $suite
    }
}
finally
{
    Stop-RPLaunch -Launch $launch
}

Features

  • Connect-RPServer
    Connect to the report portal server.

  • Disconnect-RPServer
    Disconnect from the report portal server.

  • Get-RPLaunch
    Get a specific report portal launch.

  • Start-RPLaunch
    Start a new report portal launch.

  • Stop-RPLaunch
    Finish a previously started report portal launch.

  • Remove-RPLaunch
    Remove a previously finished report portal launch.

  • Get-RPTestItem
    Get a test item by id.

  • Start-RPTestItem
    Start a new report portal test item.

  • Stop-RPTestItem
    Finish an existing report portal test item.

  • Add-RPLog
    Add a log entry to the test item.

Versions

Please find all versions in the GitHub Releases section and the release notes in the CHANGELOG.md file.

Installation

Use the following command to install the module from the PowerShell Gallery, if the PackageManagement and PowerShellGet modules are available:

# Download and install the module
Install-Module -Name 'ReportPortal'

Alternatively, download the latest release from GitHub and install the module manually on your local system:

  1. Download the latest release from GitHub as a ZIP file: GitHub Releases
  2. Extract the module and install it: Installing a PowerShell Module

Requirements

The following minimum requirements are necessary to use this module, or in other words are used to test this module:

  • Windows PowerShell 5.1
  • Windows Server 2016 / Windows 10

Contribute

Please feel free to contribute by opening new issues or providing pull requests. For the best development experience, open this project as a folder in Visual Studio Code and ensure that the PowerShell extension is installed.

About

Report Portal PowerShell Module.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%