How To Save Multiple HTML Reports In Playwright
and how to not overwrite your previous HTML reports with the latest run

Search for a command to run...
and how to not overwrite your previous HTML reports with the latest run

What are we going to rebuild? In this Blog Post from my UI / UX Bits series, we will rebuild a nice hover animation for buttons or links from https://touchycoffee.com/. We going to rebuild this UI interaction: What do we see? We see a button element...
What are we going to rebuild In this Blog Post from my UI / UX Bits series, we will rebuild a nice hover interaction built by https://www.discoveroutpost.com/. We going to rebuild this UI interaction. What do we see? We see a hover effect on an elem...
What are we going to rebuild? In this Blog Post from my UI / UX Bits series, we will rebuild a nice navigation interaction built by Eric Van Holtz. You can find it at https://vanholtz.co/ We going to rebuild this UI interaction. What do we see? We s...
Signal vs. Store vs. Mutable and when to use what

Playwright allows you to save your test results in an HTML report.
The HTML report serves as a dashboard in which a list with the results of all your tests is available.
You can also click on each test to see more details of the test run, such as the video or the entire trace of the test run.
You need to add the reporter property in your playwright.config to enable your HTML report.
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
reporter: [ ['html'] ],
};
export default config;
Playwright's default HTML reporter settings creates a folder named "playwright-report" and saves the HTML report in this folder.
If you want to save the HTML report into a custom folder, you can change your playwright.config.ts to something like this.
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
reporter: [ ['html', { outputFolder: 'my-report' ] ],
};
export default config;
This code example saves your report into ./playwright-report/my-report
Now Playwright creates a folder with the name "my-report" and saves the report in this folder. The problem is that the report is overwritten every time you start the tests, so you only have the most recent report but not the one from the test runs before.
To prevent Playwright from overwriting the report, you can pass a dynamic folder name to the outputFolder property.
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
reporter: [ ['html', { outputFolder: 'playwright-report/' + (new Date()).toISOString()}] ],
};
export default config;
This code example will create a new playwright-report folder for every test run. The folder name will be the timestamp of the start of your tests.