Command line interface for running Testing on your CI
npm install @testim/testim-cliFor more information please check out https://testim.io and https://help.testim.io/docs
For any questions please talk to our support from the chat window at https://app.testim.io
For the live and up to date documentation of this tool please check out this guide on integrating Testim into your CI/CD.
Install the testim CLI globally:
``sh`
$ npm i -g @testim/testim-cli
sh
--token
`
Use the token you got from testim.io (if you don't have one email info@testim.io)
`sh
testim --token my.token
`Project:
`sh
--project
`
Select which project to run tests from
`sh
testim -project "My Project"
`
Label:
`sh
--label or -l
`
Run all tests comprising one of the mentioned labels
`sh
testim -l my-label1 -l my-label2
`
Run by test name:
`sh
testim -n test-name1 -n test-name2
`
Grid host url
`sh
--host
`
Grid host port
`sh
--port or -p
`
Run on a specific Selenium Grid
`sh
testim -host 127.0.0.1 -p 4444
`
Console Reporter
`sh
testim --reporters console
`
JUnit Reporter
`sh
testim --reporters junit --report-file ~/report.xml
`
TeamCity Reporter
`sh
testim --reporters teamcity
`
Base URL
`sh
--base-url
`
Starting URL after browser opens
`sh
testim --base-url www.testim.io
`
Applitools Key
`sh
--applitools-key
testim --applitools-key sadfsdflkjdsf-sdf-fds
`
Sauce Labs Key
`sh
--sauce-key
testim --sauce-key sadfsdflkjdsf-sdf-fds
`
Sauce Labs User
`sh
--sauce-user
testim --sauce-user sadfsdflkjdsf-sdf-fds
`
BrowserStack Key
`sh
--browserstack-key
testim --browserstack-key sadfsdflkjdsf-sdf-fds
`
BrowserStack User
`sh
--browserstack-user
testim --browserstack-user sadfsdflkjdsf-sdf-fds
`
BrowserStack Options
`sh
--browserstack-options
testim --browserstack-options browser-stack.json
`
BrowserStack Options Config File Example`json
{
"browserName" : "chrome",
"browser_version" : "53.0",
"os" : "Windows",
"os_version" : "7"
}
`#### Tunnel
Open a tunnel between your local server and the selenium server.
Test base url will be replaced by the tunnel url.
`sh
--tunnel
--tunnel-port - optionaltestim --tunnel --tunnel-port 8080
`#### Version Control (Branches)
To run on a specific branch, use this parameter in your CLI
`sh
--branch
`If you are using one of the following: Jenkins, CircleCI or TravisCI, The Testim CLI will automatically run tests for the same branch if the following parameter is used.
`sh
--branch auto-detect
`$3
The following are Environment Variables that the runner listens to:*
"SERVICES_HOST": "http://localhost:8080"
* "DEBUG_MODE": "1"
* "LOGGER_DEBUG": "1"
* "LOGGER_CONSOLE": "1"
* "DEFAULT_REQUEST_TIMEOUT": "3000000"
* "OVERRIDE_TIMEOUTS": "1000000"
* "WEBDRIVER_DEBUG": "1"
* "OVERRIDE_SCHEDULER": "true$3
To test runner code changes by locally running executions via the CLI, you can do any of the following:
1. Go to the Runner folder, (i.e cd apps/runner) and copy-paste a CLI command - remove the 'testim' command and instead do 'pnpm start'
Example: pnpm start --token
2. You can follow the instructions on runner's DOC.md file, to create a beta version - than, you can do: node {{full path to runner folder}}/deploy/cli.js
Example: node apps/runner/deploy/cli.js --token Important note - due to multi region support, when you want to run local runner against non-production environments, you will need to add an env var
named RUNNER_ENVIRONMENT to take the correct services configuration - the values are production (default), staging, development.
Example:
RUNNER_ENVIRONMENT=staging pnpm start --token License
----
© 2014-2025 Testim. All Rights Reserved.