Bitbucket integration

Use the mabl integration with Bitbucket Cloud to integrate mabl tests into your Bitbucket pipeline workflows.

With the mabl Bitbucket integration, you can:

  • Run automated mabl tests for visual, functional, and performance regressions on every deployment
  • Decide whether to pass or fail a build based on mabl test results
  • Test every pull request (PR) and see results in the Code Insights report for the PR

Testing your pull requests with mabl helps you catch issues earlier in the development cycle, when it is easier, faster, and cheaper to fix them. Moreover, everyone reviewing the PR will have confidence that not just the code but also the user experience with the application has been tested.

Setup

Add the mabl deployment pipe to the script section of your bitbucket-pipelines.yml file:

1879

mabl Bitbucket pipe within the list of Bitbucket integrations

The mabl deployment pipe creates a deployment event in mabl, which is a parallel run of all plans in a workspace that match the specified conditions, such as application, environment, and plan label. The pipe waits for completion of the tests and returns success if all tests have passed or fail if any of the tests fail.

Configuring variables

In the variables section of the mabl deployment pipe, add a CI/CD integration API key from mabl.

Add additional variables to define which mabl tests you want to run:

  • At a minimum, the pipe must include either MABL_APPLICATION_ID or MABL_ENVIRONMENT_ID. Learn more about obtaining IDs for mabl applications and environments here.
  • For a complete list of available arguments for the variables section, see the options for the mabl deployments create command in the mabl CLI.

📘

Mabl CLI

Behind the scenes, the mabl deployment pipe relies on the mabl CLI to orchestrate the test runs and get the test results back to Bitbucket. You can use the mabl CLI outside of Bitbucket to create and run tests locally, including support for headless mode, and much more.

Results

After adding and running the mabl deployment pipe, you can view a results summary directly in your pipeline build output.

930

mabl test results inside the Bitbucket pipeline logs.

The output also includes a link to test results in the mabl app, which contains comprehensive diagnostics data such as screenshots, DOM snapshots, and network activity.

With the mabl deployment pipe, when you open up a pull request in Bitbucket and deploy the code commit, you automatically see mabl test results directly in the context of the PR via Bitbucket Code Insights.

1684

Bitbucket Code Insights report showing mabl test results for a pull request.