Jenkins

Configure Jenkins in minutes to run your end-to-end tests concurrently via Testery Cloud

Testery integrates with Jenkins via the Testery CLI or Testery REST API. We strongly recommend using the CLI as it is usually faster to get running and provides better integration functionality. The CLI requires Python 3.6 or greater.

Step 1. Retrieve your Testery API Token. To retrieve your token, click Settings → Integrations → Show API Token and copy the token that is displayed. Keep this token secure as it allows access to Testery on your behalf. If you don't already have a Testery account, you can sign up for a free account in a few minutes here.

Step 2. Store your Testery API Token in Jenkins as a secret. For more information on the various options for doing this, see https://www.jenkins.io/doc/book/using/using-credentials/

You can now access this token as follows in your Jenkinsfile:

pipeline {
    // ...
    environment {
        TESTERY_API_TOKEN = credentials('testery-api-token')
    }
    // ...
}

Step 3. Add steps to your Jenkins pipeline to install the Testery CLI and tell Testery when there are deployments ready to be tested.

Here is a sample Jenkinsfile:

pipeline {
    agent any

    stages {
        // ...
        stage('Testery Tests') {
            steps {
                script {
                    echo "Running E2E tests..."
                    def commit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
                    sh 'pip install testery --upgrade'
                    sh 'testery create-deploy --token ${TESTERY_API_TOKEN} --project <yourTesteryProjectKey> --environment <yourTesteryEnvironmentKy> --build-id ${BUILD_ID} --commit ${commit}' 
                }
            }
        }
        // ...
    }
}

Step 4. Configure Testery to trigger a test run whenever there are deployments.

Go to Schedules, click Add New Schedule and then specify that you want the tests to Run on Deploy. The Run on Deploy option will only be available after you have completed the previous steps.

Step 5. You're all set!

Tests will now run whenever your Jenkins pipeline is run. If you get stuck and would like any assistance, please don't hesitate to reach out to support@testery.io.

Last updated