For teams that use Xray for test case management, we’re happy to share a new Xray-compatible option for exporting test artifacts!
The Xray export option generates step-level results from a mabl browser test, including screenshots. By tracking mabl results in Xray, you can ensure compliance with industry standards, respond to audits, and provide better visibility into the testing process.
Viewing mabl execution results in Xray
To get started with Xray export, follow the steps outlined below:
Initial setup
Setting up Xray export requires some preliminary setup in Xray and mabl to ensure the JSON export contains the necessary fields.
In your Xray project, an admin should create a new test type option for mabl test runs. In the Options field, give the test type a name, such as "mabl". Set the Kind to "Steps".
In mabl, set up an Xray integration on the Integrations page: Settings > Integrations.
- In the Project key field, enter the Xray project key where you want to import your mabl tests.
- In the Test type field, enter the test type option that you created in Xray and set up the Xray integration.
Export test run artifacts
Export mabl browser test output in an Xray-compatible format from the mabl app, mabl CLI, or mabl API.
From the app
To export Xray-compatible test results from the mabl app, take the following steps:
- Click on More actions (…) > Export test run artifacts.
- Check the Xray JSON box
- Click Export to download the file.
Exporting test run artifacts on the test output page
From the mabl CLI
To export Xray-compatible test results from the mabl CLI, log in to the mabl CLI and update to the latest version:
npm i -g @mablhq/mabl-cli
Then run the following command, replacing <TEST-RUN-ID>
with the actual test run ID ending in -jr
:
mabl test-runs export <TEST-RUN-ID> --type xray_json
The CLI downloads the export as a zip file.
From the mabl API
To export Xray-compatible results from the mabl API, use the "run artifacts" endpoints in the Reporting API.
- Send a POST request to the create test run artifact endpoint . Include
"xray_json"
in the array for the"artifact_types"
field within the request body parameters. The POST request returns an export ID ending in-ex
. - Send a GET request to the get test run artifact export endpoint with the export ID. The mabl API returns a URL where you can access a zip file containing the export.
Import mabl test results into Xray
After exporting the JSON file from mabl, add it to an Xray test execution as execution results.
The imported mabl test results include the step descriptions, expected result, actual result, and screenshots, if available.
Viewing screenshots from a mabl test run in Xray