
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
@flakiness/playwright
Advanced tools
A custom Playwright test reporter that generates Flakiness Reports from your Playwright test runs
A custom Playwright test reporter that generates Flakiness Reports from your Playwright test runs. The reporter automatically converts Playwright test results into the standardized Flakiness JSON format, capturing test outcomes, attachments, system utilization, and environment information.
npm install @flakiness/playwright
Add the reporter to your playwright.config.ts:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['@flakiness/playwright']
],
});
Run your tests. The report will be automatically generated in the ./flakiness-report folder:
npx playwright test
View the interactive report:
npx flakiness show ./flakiness-report
Reports are automatically uploaded to Flakiness.io in the onExit() hook. Authentication can be done in two ways:
token option or the FLAKINESS_ACCESS_TOKEN environment variable.flakinessProject option must be set to your Flakiness.io project identifier (org/project).If upload fails, the report is still available locally in the output folder.
After test execution, you can view the report using:
npx flakiness show ./flakiness-report
All Playwright test attachments (screenshots, traces, videos, etc.) are automatically:
attachments/ directory in the output folderIf an attachment file cannot be accessed, a warning is displayed but the report generation continues.
For each Playwright project, the reporter creates a unique environment that includes:
collectBrowserVersions is enabled)FK_ENV_Environment variables prefixed with FK_ENV_ are automatically included in the environment's userSuppliedData. The prefix is stripped and the key is converted to lowercase.
Example:
export FK_ENV_DEPLOYMENT=staging
export FK_ENV_REGION=us-east-1
This will result in the environment containing:
{
"userSuppliedData": {
"deployment": "staging",
"region": "us-east-1"
}
}
Flakiness.io will create a dedicated history for tests executed in each unique environment. This means tests run with FK_ENV_DEPLOYMENT=staging will have a separate timeline from tests run with FK_ENV_DEPLOYMENT=production, allowing you to track flakiness patterns specific to each deployment environment.
The reporter automatically detects CI environments and includes:
The reporter accepts the following options:
flakinessProject?: stringThe Flakiness.io project identifier in org/project format. Used for GitHub OIDC authentication — when set, and the Flakiness.io project is bound to the GitHub repository running the workflow, the reporter authenticates uploads via GitHub Actions OIDC token with no access token required.
reporter: [
['@flakiness/playwright', { flakinessProject: 'my-org/my-project' }]
]
endpoint?: stringCustom Flakiness.io endpoint URL for uploading reports. Defaults to the FLAKINESS_ENDPOINT environment variable, or https://flakiness.io if not set.
Use this option to point to a custom or self-hosted Flakiness.io instance.
reporter: [
['@flakiness/playwright', { endpoint: 'https://custom.flakiness.io' }]
]
token?: stringAccess token for authenticating with Flakiness.io when uploading reports. Defaults to the FLAKINESS_ACCESS_TOKEN environment variable.
If no token is provided, the report will still be generated locally but won't be uploaded automatically.
reporter: [
['@flakiness/playwright', { token: 'your-access-token' }]
]
outputFolder?: stringDirectory path where the Flakiness report will be written. Defaults to flakiness-report in the current working directory, or the FLAKINESS_OUTPUT_DIR environment variable if set.
reporter: [
['@flakiness/playwright', { outputFolder: './test-results/flakiness' }]
]
open?: 'always' | 'never' | 'on-failure'Controls when the report viewer should automatically open in your browser after test completion.
'on-failure' (default): Opens the report only if tests failed and running in an interactive terminal (not in CI)'always': Always opens the report after test completion (when running in an interactive terminal)'never': Never automatically opens the reportreporter: [
['@flakiness/playwright', { open: 'always' }]
]
collectBrowserVersions?: booleanWhen enabled, the reporter will launch each browser type used in your Playwright projects to detect and record the actual browser version. This information is added to the environment metadata.
Note: This option requires launching browsers, which adds overhead to report generation. Enable only when browser version information is critical for your analysis.
reporter: [
['@flakiness/playwright', { collectBrowserVersions: true }]
]
The reporter respects the following environment variables:
FLAKINESS_ACCESS_TOKEN: Access token for Flakiness.io uploads (equivalent to token option)FLAKINESS_ENDPOINT: Custom Flakiness.io endpoint URL (equivalent to endpoint option)FLAKINESS_OUTPUT_DIR: Output directory for reports (equivalent to outputFolder option)Here's a complete example with all options:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['@flakiness/playwright', {
flakinessProject: 'my-org/my-project',
endpoint: process.env.FLAKINESS_ENDPOINT,
token: process.env.FLAKINESS_ACCESS_TOKEN,
outputFolder: './flakiness-report',
open: 'on-failure',
collectBrowserVersions: false,
}]
],
// ... rest of your config
});
FAQs
A custom Playwright test reporter that generates Flakiness Reports from your Playwright test runs
The npm package @flakiness/playwright receives a total of 1,167 weekly downloads. As such, @flakiness/playwright popularity was classified as popular.
We found that @flakiness/playwright demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.