chore: pass outputDir to uimode (#30941)
Fixes https://github.com/microsoft/playwright/issues/30886
This commit is contained in:
parent
148d759a4c
commit
7b27fc3916
|
|
@ -46,6 +46,7 @@ export type TraceViewerRedirectOptions = {
|
||||||
reporter?: string[];
|
reporter?: string[];
|
||||||
webApp?: string;
|
webApp?: string;
|
||||||
isServer?: boolean;
|
isServer?: boolean;
|
||||||
|
outputDir?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TraceViewerAppOptions = {
|
export type TraceViewerAppOptions = {
|
||||||
|
|
@ -129,6 +130,8 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
|
||||||
params.append('timeout', String(options.timeout));
|
params.append('timeout', String(options.timeout));
|
||||||
if (options.headed)
|
if (options.headed)
|
||||||
params.append('headed', '');
|
params.append('headed', '');
|
||||||
|
if (options.outputDir)
|
||||||
|
params.append('outputDir', options.outputDir);
|
||||||
for (const reporter of options.reporter || [])
|
for (const reporter of options.reporter || [])
|
||||||
params.append('reporter', reporter);
|
params.append('reporter', reporter);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ export interface TestServerInterface {
|
||||||
headed?: boolean;
|
headed?: boolean;
|
||||||
workers?: number | string;
|
workers?: number | string;
|
||||||
timeout?: number,
|
timeout?: number,
|
||||||
|
outputDir?: string;
|
||||||
reporters?: string[],
|
reporters?: string[],
|
||||||
trace?: 'on' | 'off';
|
trace?: 'on' | 'off';
|
||||||
video?: 'on' | 'off';
|
video?: 'on' | 'off';
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
|
||||||
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : undefined,
|
reporter: Array.isArray(opts.reporter) ? opts.reporter : opts.reporter ? [opts.reporter] : undefined,
|
||||||
workers: cliOverrides.workers,
|
workers: cliOverrides.workers,
|
||||||
timeout: cliOverrides.timeout,
|
timeout: cliOverrides.timeout,
|
||||||
|
outputDir: cliOverrides.outputDir,
|
||||||
});
|
});
|
||||||
await stopProfiling('runner');
|
await stopProfiling('runner');
|
||||||
if (status === 'restarted')
|
if (status === 'restarted')
|
||||||
|
|
|
||||||
|
|
@ -313,6 +313,7 @@ class TestServerDispatcher implements TestServerInterface {
|
||||||
_optionContextReuseMode: params.reuseContext ? 'when-possible' : undefined,
|
_optionContextReuseMode: params.reuseContext ? 'when-possible' : undefined,
|
||||||
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,
|
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,
|
||||||
},
|
},
|
||||||
|
outputDir: params.outputDir,
|
||||||
workers: params.workers,
|
workers: params.workers,
|
||||||
};
|
};
|
||||||
if (params.trace === 'on')
|
if (params.trace === 'on')
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ const queryParams = {
|
||||||
workers: searchParams.get('workers') || undefined,
|
workers: searchParams.get('workers') || undefined,
|
||||||
timeout: searchParams.has('timeout') ? +searchParams.get('timeout')! : undefined,
|
timeout: searchParams.has('timeout') ? +searchParams.get('timeout')! : undefined,
|
||||||
headed: searchParams.has('headed'),
|
headed: searchParams.has('headed'),
|
||||||
|
outputDir: searchParams.get('outputDir') || undefined,
|
||||||
reporters: searchParams.has('reporter') ? searchParams.getAll('reporter') : undefined,
|
reporters: searchParams.has('reporter') ? searchParams.getAll('reporter') : undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -283,6 +284,7 @@ export const UIModeView: React.FC<{}> = ({
|
||||||
workers: queryParams.workers,
|
workers: queryParams.workers,
|
||||||
timeout: queryParams.timeout,
|
timeout: queryParams.timeout,
|
||||||
headed: queryParams.headed,
|
headed: queryParams.headed,
|
||||||
|
outputDir: queryParams.outputDir,
|
||||||
reporters: queryParams.reporters,
|
reporters: queryParams.reporters,
|
||||||
trace: 'on',
|
trace: 'on',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue