Testing pages with the DebugBear CLI
This guide explains how to use the CLI tool to test pages independently of a full CI integration.
- Read this guide for an example of reporting CI results to Github
- Follow the getting started guide to generate an API key and find a page ID
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
Builds
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:
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 http://example.com
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.
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