microsoft / microsoft/playwright
[Feature] Configure web servers per project
- Dominant language
- TypeScript
- Stars
- 96.3k
- Forks
- 6.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 180
Description
I would love to have the possibility to configure local web servers per project.
In my use case, I have a full suite that runs against a local build of my application and a mock server, and a subset of those tests are used as smoke tests against production.
The problem is that playwright always executes the webservers configured when I run only the `smoke-tests` project.
If I had the possibility to configure the `webServer`s per project, I would be able to avoid waiting for the local applications to be instantiated, like:
```ts
export default defineConfig({
projects: [
{
name: 'functional-chromium',
grepInvert: /@smoke/,
use: { ...devices['Desktop Chrome'], baseURL: 'http://localhost:3000' },
webServer: [
{
command: 'yarn serve',
url: 'http://localhost:3000',
timeout: 380 * 1000,
reuseExistingServer: true,
},
{
command: 'yarn mock-server',
port: 3001,
reuseExistingServer: true,
},
],
},
{
name: 'smoke-chromium',
grep: /@smoke/,
use: { ...devices['Desktop Chrome'], baseURL: 'https://production.app.com' },
},
],
});
```
Contributor guide
Research direction
Start by tracing how the Playwright configuration handles the global webServer setting and how selected projects are resolved when running smoke tests. Compare that flow with the requested per-project configuration and the two example projects. Done means each selected project starts only its own configured web servers, while the smoke project can run against production without starting the local applications.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100