Configure your Playwright test suites to export all test run results into the mabl cloud. With the @mablhq/playwright-reporter
package, teams can see results from their Playwright tests alongside mabl test runs, making it easier to analyze outcomes and share insights across testing platforms.
Early access
The Playwright reporter is available in early access. Prior to general availability, change to this feature may be made without notice.
Before you start
To use the @mablhq/playwright-reporter
package, you will need:
- Playwright 1.43.1 or greater - see Playwright requirements for more information.
- mabl workspace ID - in the mabl workspace where you want to send Playwright test results, get the workspace ID from Settings > Workspace
- mabl API key - create a "Command Line Interface" API key in Settings > APIs in the mabl app
Install playwright-reporter
Install the @mablhq/playwright-reporter
package:
npm install @mablhq/playwright-reporter -D
Configure playwright-reporter
You can configure the reporter inside the playwright.config.ts
file under the reporter key in the defineConfig
function.
To use this sample script, replace the following values:
-
MABL_API_KEY
- use your "Command Line Interface" API key -
MABL_WORKSPACE_ID
- use your mabl workspace ID -
SAMPLE_PLAN_NAME
- create a plan name to use for the test execution
import { defineConfig } from '@playwright/test'; export default defineConfig({ use: { trace: "on", screenshot: "on", }, reporter: [ // here we reference the mabl Playwright reporter for use in our test runs [ '@mablhq/playwright-reporter', { // supply a mabl API key apiKey: process.env.MABL_API_KEY, // supply the ID of the mabl workspace the results should be sent to workspaceId: process.env.MABL_WORKSPACE_ID, planName: 'SAMPLE_PLAN_NAME' }, ], ], });
To get more complete test output, including screenshots and mabl step details, make sure that trace and screenshot are set to "on". For more information on configuring Playwright reports, refer to the following docs.
View results in mabl
When your Playwright tests run, the output is published back to mabl upon completion of the test. These results are available under the Results tab alongside all other mabl test results.