@mablhq/playwright-reporter v0.2.1
Mabl Playwright Reporter
The Mabl Playwright reporter is a tool that can be configured inside Playwright test suites to export all test run results into the mabl cloud. With the reporter configured teams can track all their Playwright test runs both in their CI environments and locally. With results reported back to the mabl cloud, teams will no longer have to parse through CI log output or exported log files but instead have access to their test runs in mabl’s test results dashboards.
Quickstart
Before you begin
Sign up or login to your mabl workspace Create an API key to use in your test suite In the mabl web app, navigate to Settings > APIs and click “Create API key” Select “Command Line Interface” as the key option, give it a name, and click “Save” Get the ID of the workspace you’d like to send the result to In the mabl web app, navigate to Settings > Workspace and copy the workspace ID at the top
Prerequisites
To leverage the mabl Toolset for Playwright you will need a developer environment with:
- NodeJS >= 18.0.0
- Playwright test suite
- Playwright version 1.45.0 or higher
Installing the mabl Playwright Reporter
npm install @mablhq/@mablhq/playwright-reporter
Configuring the mabl Playwright Reporter
The reporter can be configured inside the playwright.config.ts file under the reporter key in the defineConfig function. The following docs can be referred to for more information on configuring Playwright reporters.
import { defineConfig } from '@playwright/test';
export default defineConfig({
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,
},
],
],
});