After running a test playwright produces a test-results folder, which I'd rather not have Just need the console output telling me if a test has passed or not. I've tried disabling workings, setting outputDir to nothing and I cannot find anything online about how to do this.
Is this even possible?
This thread is trying to answer question "How to disable the output of a test-results folder in Playwright?"
Related Ask AI answer for "How do I prevent Playwright from creating a 'test-results' folder after running a test?".
Yes, you can stop Playwright from creating a 'test-results' folder. This folder is where test artifacts are stored by default. But you can change this or disable it.
Use the --output
option when running Playwright tests from the command line. By default, it's set to test-results
. You can change it to any directory or an empty string to disable it.
Here's how to run tests without creating a 'test-results' folder:
npx playwright test --output ""
This command stops Playwright from creating any output directory for test artifacts.
If you're using a configuration file (playwright.config.ts
or playwright.config.js
), you can pass options directly in it. Define the reporter
property with an array containing 'html'
as the first element and specify additional options within an object.
Here's how to configure Playwright in your configuration file to disable the 'test-results' folder:
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [['html', { outputFolder: '' }]],
});
In this example, we set the outputFolder
option to an empty string (''
). This effectively stops creating any output folder for test results.
These methods let you customize where Playwright stores test artifacts or disable their creation. This gives you flexibility in managing your test results according to your needs.
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].