This thread is trying to answer question "Why are trace files still being generated in Playwright despite being disabled in the configuration file?"
Sure
export default defineConfig({
use: {
baseURL: 'http://localhost:5173',
trace: 'off',
screenshot: 'off',
video: 'off',
},
fullyParallel: true,
forbidOnly: true,
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
},
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
},
{
name: 'Mobile Safari',
use: {
...devices['iPhone 12'],
},
},
],
})
Related Ask AI answer for "How do I disable the creation of 'trace.zip' files in Playwright?".
Yes, it's normal to see a 'test-result' folder with 'trace.zip' for each test run in Playwright, even after disabling trace in the config file. This is because Playwright is set up to create a trace.zip file for each test run by default.
However, you can control this behavior through the configuration options in the playwright.config.ts
file. If you want to completely disable tracing, you can modify this file accordingly.
Here's how you can do it:
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
trace: 'off',
},
});
By setting trace: 'off'
, Playwright will no longer generate trace.zip files for any tests.
Remember, if you have already executed tests with tracing enabled, disabling tracing will not remove those existing files. It only prevents new trace.zip files from being created during subsequent test runs.
So, to completely stop generating new trace.zip files, make sure to set trace: 'off'
in your playwright.config.ts
file.
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].