Skip to main content

Robot Framework Library for Tracking Test Cases

Project description

Automation Tracker

Use this package to quickly track your automation projects and usage. It has been developed to ensure easy and seamless integration with any third party automation tool.

Documentation: https://automation-tracker.readthedocs.io/en/latest/ for more information.

Examples of How To Use it on your Robot Framework

Setup Robot Framework

*** Settings ***
Library    AutomationTracker

Usage of the library in Robot Framework

*** Test Cases ***
Example
    Start Tracker    ${PROJECT_NAME}    ${PROJECT_VERSION}    ${PROJECT_DESCRIPTION}    ${PROJECT_URL}    ${PROJECT_EMAIL}
    Start Suite    ${SUITE_NAME}    ${SUITE_DOCUMENTATION}
    Start Test    ${TEST_NAME}    ${TEST_DOCUMENTATION}
    Start Keyword    ${KEYWORD_NAME}    ${KEYWORD_DOCUMENTATION}
    End Keyword
    End Test
    End Suite
    End Tracker

Examples of How To Use it on your Python

#import the DB tracker and use functions from it
from RobotTracker.TrackerDB import *

#invoke the tracker
TrackerDB("https://your_ip_or_domain").manually_start_tracker_detailed("POS",
"justus","UAT", "CRQ-1234","Q-OPS", "testType","API", "200", "100", "50","150","0","0","0","0", 
 "0","0", "0","100", "100", "0", "200","TEST-1234")

Using a listener to listen to your code runs and track the testcase runs

Setup the robot framework listener

*** Settings ***
Library    AutomationTracker
Suite Setup    Start Tracker    ${PROJECT_NAME}    ${PROJECT_VERSION}    ${PROJECT_DESCRIPTION}    ${PROJECT_URL}    ${PROJECT_EMAIL}
Suite Teardown    End Tracker
Test Setup    Start Test    ${TEST_NAME}    ${TEST_DOCUMENTATION}
Test Teardown    End Test

Create a folder in your directory Tracking and create file Justus_Shared.robot eg:

below is an example image of how the file should look like

Demo_Image

Copy the below code into the file Justus_Shared.robot

*** Settings ***
Documentation     This example demonstrates how to use current library and test status in a listener.
Library      ListenerLibrary
#import another python file
Library   ../Functions/tracker.py

*** Keywords ***
Listener Keyword
    [Arguments]    ${projectName}    ${userName}    ${crqReference}    ${uniqueRunRef}
  
  Log To Console  This line is always executed, ${TEST NAME} : ${TEST STATUS}
  # https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#automatic-variables
    
  #send request to track testcase
  tracker.Track Test Case  ${TEST NAME}    ${TEST STATUS}    ${projectName}    ${userName}    ${crqReference}    ${uniqueRunRef}   

  IF  "${TEST STATUS}" == "FAIL"
  Log To Console  **********This line is only executed when the test failed.**********
    Another Keyword
  END

Another Keyword
  Log To Console  This keyword only gets called by the listner when the test failed.

Teardown Keyword
  Log To Console  The teardown is called after the Listener Keyword, ${TEST NAME}: ${TEST STATUS}
  IF  "${TEST STATUS}" == "FAIL"
    Yet Another Keyword
  END

Yet Another Keyword
  Log To Console  This keyword only gets called by the teardown when the test failed.

Create 'tracker.py' inside your Functions folder and copy the below code into it

Please contact mwangijustus12@gmail.com for the source code or be part of the development team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

automation-tracker-1.0.0.4.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

automation_tracker-1.0.0.4-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page