Skip to main content

Testing pages with the DebugBear CLI

This guide explains how to use the CLI tool to test pages independently of a full CI integration.

Ad hoc tests

Instead of just scheduling tests at fixed intervals you can trigger a one-off page test like this:

DEBUGBEAR_API_KEY=YOUR_KEY debugbear --pageId=1234


A build is just a page test with an attached commit hash:

debugbear --pageId=1234 --commitHash=abcdefg

This test will not show up among the scheduled test results. Instead you can see it in the project's Builds tab:

DebugBear CI builds tab

When running in CI you can use the --inferBuildInfo flag to try and detect the version control details, like the current branch and commit message.

If your site is deployed to a staging server you can override the URL that's normally used for scheduled tests:

debugbear --pageId=1234 --commitHash=abcdefg

Failing and passing builds

By default builds will always finish in a neutral state, but if you specify a performance budget for API builds they'll finish with a pass/fail state.

Failing build in builds tab

Testing local URLs with ngrok

You can use ngrok to publicly expose a local server so that DebugBear can test it.

Instead of manually overriding the normal page URL you can pass in --ngrokWebPort=4040 to automatically extract the URL from ngrok:

debugbear --pageId=1234 --commitHash=abcdefg --ngrokWebPort=4040