Rayrun

How do I disable the creation of 'trace.zip' files in Playwright?

Answer

Disabling 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.

References

Thank you!
Was this helpful?
Still have questions?

If you still have questions, please ask a question and I will try to answer it.

Related Discord Threads

Related Questions

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 luc@ray.run.