Run mabl tests GitHub Action

Mabl gives you the tools to build and maintain intelligent CI/CD pipelines. By utilizing Github Action 2.0, the "run mabl tests" GitHub Action allows you to trigger mabl tests as soon as you initiate a new deployment. Additionally, it's easy to view the results of these tests within GitHub. The Action itself specifies the application and environment that the test will run on as well as a number of optional parameters such as browsers, whether the build should be considered a "baseline" for new visual changes, and more.

How it works

As soon as mabl receives a deployment event from your pipeline, it automatically triggers the relevant tests based on the specific parameters defined in the Action. From there, the Action continually polls mabl until all triggered tests are completed. Once this happens, the Action completes and the action returns a failure by default and subsequently stop the pipeline. You can also configure the Action to continue the pipeline regardless of failure. You're always able to view the results of your tests directly from GitHub as well.

2310

📘

Combine the mabl GitHub Action and mabl GitHub integration

Installing the mabl GitHub integration (app) allows for richer interactions, like results in Pull Requests. Be sure to include the GITHUB_TOKEN as an environment variable to tie it to the commit hash.

See GitHub integration setup for the full details.

Flexibility and automation

Core to this model is flexibility. The mabl Action takes advantage of a number of test results statistics provided by the Actions 2.0 output feature, which give you control over what subsequent actions are executed by your pipeline. For example, you can customize your pipeline to fail based on a specific threshold or percent of passing tests instead of failing automatically on a single test failure.

Additionally, you can configure your pipeline to automatically promote the build to the next environment in the event that all tests pass to eliminate the need to manually tag or trigger a push to development or production.

Using the mabl GitHub Action

With Actions 2.0, you're able to integrate mabl's "run mabl tests" Action directly with your repo's workflow. If you wish to use the mabl GitHub Action to trigger your deployment instead of another CI/CD tool such as Jenkins, you'll need to add the mabl Action directly into your workflow so that mabl can run your tests.

Viewing Actions logs

After a deployment has occurred, you can see the results of the mabl tests triggered by the Action directly in the Action logs.

Navigate to the PR that triggered the deployment and you will see a mabl Test section included as a check. Click Details to be brought to the new Actions 2.0 logs. In these logs, you'll find helpful information about the mabl tests including a table with information about the: browser, status, test name, duration of the run, and a direct link back to the output in the mabl app.

2374

A view of the output logs for the Action.