Rayrun
← Back to Discord Forum

Change default name of reports generated with blob reporter

Hey Playwright enthusiasts!

Is there some way how to set the name of files created by blob reporter? It is possible with HTML or JSON reporter. The default value is report.zip or report-{shard_index}.zip. There is a problem when running multiple test projects within one shard (e.g. running yarn playwright test --config=./asdf.playwright.config.ts for multiple targets via nx affected) because all generate reports with the same name. There is a PLAYWRIGHT_HTML_REPORT env variable that works with HTML reporter but I miss some equivalent that works even with blob reporter.

This thread is trying to answer question "Is there a way to set the name of files created by blob reporter in Playwright?"

0 replies

Answer

Sure, you can customize the name of the report folder generated by the blob reporter in Playwright. By default, the blob reporter writes the report into the playwright-report folder in the current working directory.

You can change this by using the PLAYWRIGHT_HTML_REPORT environment variable. Here's how you can do it:

PLAYWRIGHT_HTML_REPORT=my-custom-report npx playwright test --reporter=blob

This command will create a folder named my-custom-report for the report.

Alternatively, you can also set the output folder directly in your playwright.config.ts file. Here's how:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['blob', { outputFolder: 'my-custom-report' }]],
});

This configuration will also create a folder named my-custom-report for the report.

So, whether you prefer using environment variables or setting it directly in your configuration file, you have the flexibility to set a custom name for your report folder.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].