LogoLogo
BugBug HomepageContact SupportLoginSign up free
  • Documentation
  • Tutorial for beginners
  • Best practices
  • BugBug App FAQ
  • Quick Start
    • What is test automation?
    • Start for free
    • Create your first project
    • Install Chrome extension
    • Create and run the tests
  • Creating Tests
    • Your first test
    • Independent tests
    • Duplicating tests
    • New test from here
  • Recording tests steps
    • BugBug overlay
    • Recording clicks
    • Recording hover
    • Recording keyboard typing
    • Recording assertions
    • Recording drag & drop
    • Record from here
    • Re-recording steps
    • Recording pop-up window actions
    • Using keyboard shortcuts
  • Editing tests
    • Grouping steps
    • Components
    • Manually editing steps
    • Actions
    • Assertions
    • Tabs & iframes
    • Variables
    • Local variables
    • Profiles
    • Custom JavaScript actions
  • Running tests
    • Running the tests
    • Statuses
    • Run (locally)
    • Run and pause here
    • Run in cloud
    • Schedules
    • Parallel runs
    • Running via API
    • Test your local build or protected web page using ngrok
  • Preventing failed tests
    • Waiting conditions
    • Smart click
    • Smart scroll
    • Selectors
    • Timeout
    • Delay / Sleep
    • Project settings
  • Debugging Tests
    • Runs history
    • Screenshots
    • Debug in Chrome
    • Breakpoint (run step-by-step)
  • Organizing tests
    • Naming your tests
    • Searching tests
    • Suites
    • Components
    • Projects
  • Workflow Tips
    • Edit & Rewind
    • Changing the test screen size
    • Multiple environments
    • Testing registration & login
    • Integrating with build systems
    • Mobile version testing
  • Collaboration
    • Organizations
    • Inviting team members
    • Alerts
      • Sending email notification
      • Sending webhook
      • Sending Slack message
      • Sending Teams message
  • Integrations
    • CLI
    • Zapier
    • Slack
    • GitHub
    • Bitbucket
    • Gitlab
    • Trello
    • Jira
  • Your account
    • Account settings
    • Edit your name and email
    • Forgot password
    • Manage Subscriptions
    • Account FAQ
  • Troubleshooting
    • Prohibited behaviors
    • Updating Chrome extension
    • Clear cookies and site data for BugBug
    • Testing basic auth password protected websites
    • Common selectors issues
    • CAPTCHA in automation testing
    • Cloud tests sometimes failing
    • IPs list of cloud runners
    • VPN or a Firewall
    • A/B tests
    • Report a bug
  • IN-DEPTH GUIDES
    • Beginners tutorial to automation testing
    • XPath Selectors without coding
    • Tech Leader's Guide to Automation Testing
    • Test automation guides
  • FREE TOOLS
    • BugBug Testing Inbox
    • Example SaaS App
    • No-code XPath Selector Builder
  • Other links
    • BugBug Homepage
    • Pricing
    • Terms & conditions
    • Privacy Policy
Powered by GitBook
On this page
  • Integrate with CI/CD using BugBug Command Line Interface
  • Install via NPM
  • Get your API token
  • Run tests from terminal
  • Find your suite ID
  • Run tests from your build pipeline
  • Available commands list
  • bugbug help <option>
  • bugbug config <option>
  • bugbug remote <option>
  • Examples of usage
  • Check the status of a test run by its ID:
  • Generate a report of a test run by its ID:
  • Generate a report of a test run by its ID that's exported to a junit format (XML file):
  • Execute a test suite by its ID:
  • Check test suite run's status:

Was this helpful?

  1. Integrations

CLI

PreviousSending Teams messageNextZapier

Last updated 9 months ago

Was this helpful?

Integrate with CI/CD using BugBug Command Line Interface

You can operate BugBug via the Command Line Interface (CLI). This empowers you to integrate with any continuous integration (CI) or continuous deployment (CD) pipelines or build system hooks.

Install via NPM

You need Node.js version 20 or newer

After you have NodeJS and npm installed simply run:

npm install -g @testrevolution/bugbug-cli

Remember that you need to have admin user permissions on NodeJS execution.

Get your API token

You need to take the API token of the project you want to run with CLI. You will find that in the BugBug web app in the Integrations tab from the side menu:

Then configure CLI with the project's API token:

bugbug config set-token <api-token-from-project-settings>

Run tests from terminal

On BugBug npm's page, you find the available commands. You can also just strike bugbug help to see what you can do and how.

Example: list suites within the connected project:

To run a particular test via CLI you need to find the ID of the test. It's easy, just go to your test, expand 3 dots, and select Run via CLI. Just simply copy the command for running, open the terminal, and paste and run. The command looks as below:

bugbug remote run test <test-id>

Find your suite ID

You can run the whole suite as well by going to Suites the tab, expanding the details, and selecting Run via CLI. The command is the same but SUITE_ID is different. That's how we recognize you want to run the whole suite!

Run tests from your build pipeline

Update your CI/CD build scripts to see test results directly in your build management tool (for example in Bitbucket)

Here's an example of what you can add to your build script:

If you're ambitious

Command line variables override allows you to test various combinations of test data. You could create a for each type of script and execute a suite with all the combinations.

When you run your pipeline, BugBug tests would be triggered and your build will only be successful if all tests passed.

Available commands list

Here is a list of the commands that may be in use with different options and/or flags:

bugbug help <option>

Options
Flags
Description
  • config

  • remote

  • version

N/A

Show help menu for a specific command.

bugbug config <option>

Options
Flags
Description

set-token <token>

N/A

You can use this option for the command to set a valid token from your web app project settings

bugbug remote <option>

Options
Flags
Description

list test

  • --no-wait Exit immediately without waiting for the result

  • --no-progress Don't show progress spinner

  • --debug Show more data (like raw API response)

Returns a list of all existing tests

list suite

  • --no-wait Exit immediately without waiting for the result

  • --no-progress Don't show progress spinner

  • --debug Show more data (like raw API response)

Returns a list of all existing test suites

list profile

  • --no-wait Exit immediately without waiting for the result

  • --no-progress Don't show progress spinner

  • --debug Show more data (like raw API response)

Returns a list of all existing test profiles

run test <test-id>

  • --no-wait Exit immediately without waiting for the result

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --with-details Show result with details

  • --profile "<profile-name>" Run with a specific, existing profile

  • --variable "<variable-name>" Override default variable during a single run

  • --reporter The name of the reporter to use (default: "inline"). Instead of "inline" you can also set "junit" for the report to be exported to an XML file

  • --output-path The path to save the test report. Relative to the current working directory

Runs a specific test based on its ID

stop test <test-run-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --result-timeout <int> Modify the default result waiting time (minutes, default: 60)

Stop the test run based on its ID

run suite <suite-id>

  • --no-wait Exit immediately without waiting for the result

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --with-details Show result with details

  • --profile "<profile-name>" Run with a specific, existing profile

  • --variable "<variable-name>" Override default variable during a single run

  • --reporter The name of the reporter to use (default: "inline"). Instead of "inline" you can also set "junit" for the report to be exported to an XML file

  • --output-path The path to save the test report. Relative to the current working directory

Runs a specific test suite based on its ID

stop suite <suite-run-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --result-timeout <int> Modify the default result waiting time (minutes, default: 60)

Stop the test suite run based on its ID

status test <test-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

Display the test's status based on a run ID

status suite <suite-run-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

Display the test suite's status based on a run ID

result test <test-run-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --with-details Show results with details

Display the test result based on a run ID

result suite <test-run-id>

  • --no-progress Exit immediately without waiting for the result

  • --debug Show more data (like raw API response)

  • --with-details Show results with details

Display the test suite's result based on a run ID

Examples of usage

Check the status of a test run by its ID:

bugbug remote status test <test-run-id>

Output:

ℹ Test name: [REG] Popup handling #2 (testRunId: 10a696b2-3ce6-4b45-8b9f-0a0a0abc00000)
✔ Status: passed

Generate a report of a test run by its ID:

By default "reporter" option is set to "inline".

bugbug remote status test <test-run-id> --reporter

Output:

ℹ Test name: Test number 71 (testRunId: ba5e19d8-609d-4529-95f6-0c6179e59614)
✔ Status: passed

Generate a report of a test run by its ID that's exported to a junit format (XML file):

bugbug remote status test <test-run-id> --reporter junit

Output:

bugbug remote status test <test-run-id> --reporter junit
â ¹ Waiting for result...

The XML file is automatically exported to your project's main directory:

Execute a test suite by its ID:

bugbug remote run suite <test-suite-id>

Output:

bugbug remote status suite bceb9701-23d3-4b67-bfb7-a000a000a00
✔ Status: passed

Check test suite run's status:

bugbug remote status suite <suite-run-id>

Output:

bugbug remote status suite 8de73c22-c8a3-4141-c111-0a0a0a0a0a
✔ Status: passed

Open your terminal. First of all, you need installed on your machine and installed.

You can also override individual from the command line with --variable variableName="customVariableValue". This allows you to run different combinations of test data in different environments, for example, you can insert a different user password on prod and a different one on staging.

Also read:

Node.js
npm
our advanced guide to automation testing for startups
Logonpm: @testrevolution/bugbug-clinpm
variables
The API token for the project
Run in CLI option in the more drop-down menu
Run this suite via CLI modal
Preview of a test report exported to an XML file