Bitbucket Pipelines E2E tests
Run Monito browser tests from Bitbucket Pipelines with an API key and your deployed URL. Untested config example, URL handoff between steps and limits.
CI/CD · Checked 2026-11-17
Add a step after your deploy step and wait for Monito's browser verdict. The Monito CLI path works today; our team has not run this config in Bitbucket Pipelines.
How it works
- Your deploy step finishes and writes the deployed URL to a file declared as a step artifact.
- A Node step receives that artifact, authenticates with MONITO_TOKEN, and runs the project's saved tests against that URL with --base-url.
- The CLI waits and exits nonzero for failed or errored tests, failing the step. Inspect browser evidence in Monito's run report.
Set it up
Pro or Team to create the API key used as MONITO_TOKEN. Browser runs use your credits. Plan details
- Create a Monito API key on Pro or Team. In Repository settings, Pipelines, Repository variables, store it as a secured variable named MONITO_TOKEN. Set MONITO_PROJECT_ID to your project ID.
- Have the deploy step write the deployed URL, for example echo "$URL" > deploy-url.txt, and list deploy-url.txt under artifacts. Keep the token out of that file.
- Add the config below. The second step follows the deploy step in the same pipeline, reads the artifact, and runs the saved tests with --base-url.
- If a failed pipeline should block merges, add the merge check Minimum number of successful builds for the last commit with no failed builds and no in progress builds on the branch restriction. Without Premium, Bitbucket warns about an unresolved merge check and still allows the merge. Preventing the merge requires Premium and Prevent a merge with unresolved merge checks. This setup does not post a pull request comment.
image: node:24
pipelines:
default:
- step:
name: Record the deployed URL
script:
- echo "$URL" > deploy-url.txt
artifacts:
- deploy-url.txt
- step:
name: Run saved browser tests
script:
- DEPLOY_URL="$(cat deploy-url.txt)"
- test -n "$DEPLOY_URL" || { echo "DEPLOY_URL is empty"; exit 1; }
- npx -y @monitodev/cli@4 project run "$MONITO_PROJECT_ID" --wait --base-url "$DEPLOY_URL"
Example our team has not run in Bitbucket Pipelines. The first step stands in for your deployment and only writes the URL. Replace the echo with the URL your deploy command prints. The guard fails the step if the URL is empty so the CLI cannot silently test the project's default environment. This file uses the default pipeline, which runs on every push except tag pushes unless a branch-specific pipeline is defined. The image is the official Docker Hub library/node tag node:24. On 2026-11-17 that tag and node:24.22.3 shared one index digest.
Using GitLab CI instead?
Using GitLab CI instead? The same CLI command runs after a review deploy when the URL arrives through a dotenv artifact. Our team has not run that YAML in GitLab.
Using CircleCI instead?
Using CircleCI instead? Add a job that reads the deployed URL from a workspace and runs the same CLI command. Our team has not run that config in CircleCI.
Bitbucket sources
The Bitbucket behavior on this page was checked against the following documentation on 2026-11-17. node:24 was an official Docker Hub library/node tag that day, and node:24.22.3 shared its index digest. The benchmark reports below do not validate the Bitbucket configuration.
Example result
Example result: field names from the CLI, values illustrative
Selected fields from project run --wait --json. Each runs entry has its own id, status and sessionId. Add --json to read the full result. Open /session/<sessionId> on Monito, or follow the run report from the dashboard or GitHub summary to inspect browser evidence.
{
"runs": [
{
"id": "run_example",
"scenarioId": "scenario_example",
"status": "failed",
"sessionId": "session_example"
}
]
}Limits to account for
Each step starts a separate Docker container. Environment variables generated in a step are not visible to other steps. Files in BITBUCKET_CLONE_DIR are available to later steps when the step lists them under artifacts. A step can also export named variables with output-variables by appending KEY=VALUE lines to BITBUCKET_PIPELINES_VARIABLES_PATH. This example passes the URL as an artifact.
A secured variable can be used in the step's scripts, and its value is hidden in the build logs. Bitbucket masks matching values, including URL-encoded variants. Secured variables are stored encrypted and can be replaced or deleted, not edited. Repository variables are copied to child processes the build spawns, and anyone with write access to the repository can retrieve secured variables.
Pull requests from a forked repository don't trigger a pull-requests pipeline.
Deployment variables are specific to an environment. They override team and repository variables, and the same name can hold a different value in each environment. A step reads them when it, or its stage, sets environment to that environment name and the branch and admin permission checks pass. The deployments guide attaches the environment with deployment.
A base-URL override preserves scenario paths and saved-login origin restrictions. It does not authorize credentials on a new preview origin.
Comparable benchmark runs
Our team published these runs in the reliability benchmark. They show comparable browser journeys, not executions of the configuration or illustrative result above. Run your own scenario before relying on this integration.
Questions
Is there a Monito Bitbucket Pipe?
No. Monito does not publish a Bitbucket Pipe for browser tests. This page runs the Monito CLI with npx.
Which plan do I need?
Pro or Team. Creating the API key used as MONITO_TOKEN requires Pro ($79/mo) or Team ($199/mo). Browser runs use credits.
Can it test preview or staging deployments?
Yes. Pass the deployed URL with --base-url. The override preserves scenario paths and saved-login origin restrictions. It does not authorize credentials on a new preview origin.