After running the Playwright tests in command line (e.g. by command npx playwright test), it always shows
Serving HTML report at http://localhost:0000. Press Ctrl+C to quit.
How to avoid pressing Ctrl+C to quit and quit stream automatically? So I can use playwright in a pipeline (Azure).
You can pass open: 'never' in the config file:
export default defineConfig({
reporter: [
['html', { open: 'never' }],
],
}
...or just remove the entire reporter if you don't need the html report at all
I could figure it out.
In pipeline I added a variable CI=true.
Locally I fixed it by adding file .env and added CI=true there. In the config I added this reuseExistingServer: true to playwright.config.ts:
webServer: {
command: 'ng s',
url: 'http://localhost:4200/',
reuseExistingServer: true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With