Skip to content

nvoronchev/client-Python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReportPortal python client

PyPI Build Status

Library used only for implementors of custom listeners for ReportPortal

Allready implemented listeners:

Installation

The latest stable version is available on PyPI:

pip install reportportal-client

Usage

Main classes are:

  • reportportal_client.ReportPortalService
  • reportportal_client.StartLaunchRQ
  • reportportal_client.StartTestItemRQ
  • reportportal_client.FinishTestItemRQ
  • reportportal_client.FinishExecutionRQ
  • reportportal_client.SaveLogRQ

Basic usage example:

from time import time
from reportportal_client import (ReportPortalService, 
                                 FinishExecutionRQ,
                                 StartLaunchRQ, StartTestItemRQ,
                                 FinishTestItemRQ, SaveLogRQ)

def timestamp():
    return str(int(time() * 1000))

endpoint = "https://urlpreportportal"
project = "ProjectName"
token = "uuid" #you can get it from profile page in ReportPortal
launch_name = "name for launch"
launch_doc = "Some text documentation for launch"

service = ReportPortalService(endpoint=endpoint,
                              project=project,
                              token=token)

#Start Launch
sl_rq = StartLaunchRQ(name=launch_name,
                      start_time=timestamp(),
                      description=launch_doc)                  
r = service.start_launch(sl_rq)
launch_id = r.id

#Finish Launch
fl_rq = FinishExecutionRQ(end_time=timestamp(),
                          status="PASSED")
service.finish_launch(launch_id, fl_rq)

Copyright Notice

Licensed under the GPLv3 license (see the LICENSE.txt file).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%