-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Closed as not planned
Description
🚀 Feature Request
Currently, if a webServer configuration emits stderr, it is only piped to the logs by default and the test execution continues.
In our test runs for our apps, we have encountered server exceptions which have been silently ignored for weeks, because the Playwright tests pass.
It would be useful to be able to configure webServer[number].stderr = 'fail' or a similar API, which would fail the currently running test if stderr is written to by the webServer process.
Possibly this should be also made the default value for webServer[number].stderr
Example
This configuration would result in test failure upon any stderr from either of the Frontend server or the Backend server:
import { defineConfig } from '@playwright/test';
export default defineConfig({
webServer: [
{
command: 'npm run start',
url: 'http://localhost:3000',
name: 'Frontend',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
+ stderr: 'fail',
},
{
command: 'npm run backend',
url: 'http://localhost:3333',
name: 'Backend',
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
+ stderr: 'fail',
}
],
use: {
baseURL: 'http://localhost:3000',
},
});Motivation
Described in the first paragraphs of Feature Request
Alternatives Considered
- A wrapper script which can be used around all servers which crashes the process of stderr is emitted (downsides: increased complexity of test runner script and setup, possible unknown problems with Playwright test execution when crash occurs)
Metadata
Metadata
Assignees
Labels
No labels