Open alSergey opened 8 months ago
I have 4 projects. For 2 of them I need the webServer setting, but for the other 2 I don't need it. I would like to be able to add a setting only for specific projects, and not for all at once.
const isDevmode = (): boolean => process.env.TEST_TYPE.startsWith('devmode') || false const config: PlaywrightTestConfig = { use: { baseURL: 'https://example.ru', }, webServer: isDevmode() ? { command: 'npm run start', url: 'http://localhost:3000', stdout: 'pipe', stderr: 'pipe', } : undefined, projects: [ { name: 'def', testMatch: [/** **/], }, { name: 'devmode-def', testMatch: [/** **/], use: { baseURL: 'http://localhost:3000', }, }, { name: 'def-n3', testMatch: [/** **/], }, { name: 'devmode-def-n3', testMatch: [/** **/], use: { baseURL: 'http://localhost:3000', }, }, ], }
const config: PlaywrightTestConfig = { use: { baseURL: 'https://example.ru', }, projects: [ { name: 'def', testMatch: [/** **/], }, { name: 'devmode-def', testMatch: [/** **/], use: { baseURL: 'http://localhost:3000', }, webServer: { command: 'npm run start', url: 'http://localhost:3000', stdout: 'pipe', stderr: 'pipe', }, }, { name: 'def-n3', testMatch: [/** **/], }, { name: 'devmode-def-n3', testMatch: [/** **/], use: { baseURL: 'http://localhost:3000', }, webServer: { command: 'npm run start', url: 'http://localhost:3000', stdout: 'pipe', stderr: 'pipe', }, }, ], }
Need this!
I have 4 projects. For 2 of them I need the webServer setting, but for the other 2 I don't need it. I would like to be able to add a setting only for specific projects, and not for all at once.
How it works now
How I wish it worked