Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Robonito Jenkins Shared Library

This directory contains the Jenkins Shared Library for integrating Jenkins with Robonito. This library provides the robonitoTrigger step, which allows you to easily trigger, monitor, and react to Robonito test suite executions directly from your Jenkins pipelines.

Setup

  1. Host the Library: Push this library to a Git repository accessible by your Jenkins instance.
  2. Configure Jenkins: In Jenkins, navigate to Manage Jenkins -> Configure System. Under "Global Pipeline Libraries", add a new library:
    • Name: robonito
    • Default version: main (or specific branch/tag)
    • Retrieval method: Modern SCM -> select your Git repo

Usage Instruction

You will need a Robonito Account, Workspace ID, Suite ID, and a Jenkins API Key generated from the Robonito Desktop App (Settings -> Integrations -> Jenkins).

Store the Jenkins API Key as a credential in Jenkins (e.g., a "Secret text" credential named robonito-api-key).

Example Jenkinsfile

@Library('robonito') _

pipeline {
    agent any

    environment {
        // Retrieve the API key securely from Jenkins Credentials
        ROBONITO_API_KEY = credentials('robonito-api-key')
    }

    stages {
        stage('Build') {
            steps {
                echo "Building application..."
                // Build instructions here
            }
        }

        stage('Deploy to Staging') {
            steps {
                echo "Deploying to staging environment..."
                // Deployment instructions here
            }
        }

        stage('Robonito E2E Tests') {
            steps {
                script {
                    // Trigger Robonito Test Suite
                    def result = robonitoTrigger(
                        apiKey: env.ROBONITO_API_KEY,
                        workspaceId: 'workspace-uuid-here',
                        suiteId: 'suite-uuid-here',

                        // Optional configurations:
                        failBuildOnTestFailure: true, // Fails pipeline if tests fail
                        pollIntervalSeconds: 15,      // Check status every 15 seconds
                        // robonitoBaseUrl: 'http://localhost:3000', // Override API endpoint if needed
                        // environmentId: 'env-uuid-here', // Override default suite environment
                        // testCaseIds: ['tc-1', 'tc-2'] // Run specific test cases only
                    )

                    echo "Execution Session ID: ${result.executionSessionId}"
                }
            }
        }

        stage('Release') {
            steps {
                echo "Releasing application successfully..."
            }
        }
    }
}

Parameters

Parameter Required Type Description
apiKey Yes String Your Robonito Jenkins API Key. Keep this secure.
workspaceId Yes String The ID of your Robonito Workspace.
suiteId Yes String The ID of the Suite you want to execute.
testCaseIds No List Specific test cases to run. Defaults to all active test cases in the suite.
environmentId No String ID of the Environment to run tests against, overriding the suite's default.
callbackUrl No String A webhook URL for Robonito to POST results to upon completion.
failBuildOnTestFailure No Boolean Fails the Jenkins step if tests fail. Default: true.
pollIntervalSeconds No Integer Frequency to check execution status. Default: 10.
waitTimeoutSeconds No Integer Max wait duration before timing out. Default: 3600 (1hr).
robonitoBaseUrl No String Used to hit a specific Robonito App Server instance. Default: https://api.robonito.com.

About

robonito-jenkins-library test repository

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages