cherry-pick(#30832): chore(testServer): accept video parameter when running tests

This commit is contained in:
Pavel Feldman 2024-05-15 12:45:57 -07:00
parent 5d2623030d
commit 32bde52512
2 changed files with 2 additions and 1 deletions

View file

@ -94,6 +94,7 @@ export interface TestServerInterface {
timeout?: number,
reporters?: string[],
trace?: 'on' | 'off';
video?: 'on' | 'off';
projects?: string[];
reuseContext?: boolean;
connectWsEndpoint?: string;

View file

@ -308,7 +308,7 @@ class TestServerDispatcher implements TestServerInterface {
reporter: params.reporters ? params.reporters.map(r => [r]) : undefined,
use: {
trace: params.trace === 'on' ? { mode: 'on', sources: false, _live: true } : (params.trace === 'off' ? 'off' : undefined),
video: 'off',
video: params.video === 'on' ? 'on' : (params.video === 'off' ? 'off' : undefined),
headless: params.headed ? false : undefined,
_optionContextReuseMode: params.reuseContext ? 'when-possible' : undefined,
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,