Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Guides    Changelog

Jenkins integration

In order to integrate your tests with Jenkins, first you need to have
node.js (version >= 6.0.0) installed on the Jenkins machine or one of its slave machines.

Now, just follow these steps:

  1. Create a New item in Jenkins:
  1. Enter job name (e.g. "Testim Tests"), and choose "Freestyle project" and click "OK":
  1. Add execute step

Linux:

3.1. Add "Execute Shell" step:

3.2. Set the command with the appropriate parameters, as described in the CLI page.
Here is the basic script template, containing the first part that makes sure you have the latest npm package, and the CLI command itself (no sudo required)

mkdir -p "${WORKSPACE}/.npm-packages"
prefix=${WORKSPACE}/.npm-packages
NPM_PACKAGES="${WORKSPACE}/.npm-packages"
export PATH="$PATH:$NPM_PACKAGES/bin"
export NODE_PATH="$NODE_PATH:$NPM_PACKAGES/lib/node_modules"
npm config set prefix ${WORKSPACE}/.npm-packages
npm install -g @testim/testim-cli

testim --label "<YOUR LABEL>" \
--token "<YOUR ACCESS TOKEN>" \
--project "<YOUR PROJECT ID>" \
--grid "<Your grid name>"  \
--report-file test-results/testim-tests-$BUILD_NUMBER-report.xml
Jenkins Execute Shell Command

Jenkins Execute Shell Command

Note: For the grid name, read here how to set up your grid.

Windows:

3.1 Add "Execute Windows batch command" step:

3.2 Set the command with the appropriate parameters, as described in the CLI page.
Here is the basic script template, containing the first part that makes sure you have the latest npm package, and the CLI command itself:

npm install -g @testim/testim-cli

testim --label "<YOUR LABEL>" \
--token "<YOUR ACCESS TOKEN>" \
--project "<YOUR PROJECT ID>" \
--grid "<Your grid name>"  \
--report-file test-results/testim-tests-$BUILD_NUMBER-report.xml
Jenkins Execute Windows Batch Command

Jenkins Execute Windows Batch Command

  1. In order for Jenkins to store, analyze and show the results, we generate a standard JUnitXMLReporter XML file. For Jenkins to use the file you need to add a post-build action of type "Publish JUnit test result report":
  1. Set the xml file value, according to the "report-file" parameter in section 4:

Jenkins integration


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.