chore: pass outputDir to uimode (#30941)

Fixes https://github.com/microsoft/playwright/issues/30886
This commit is contained in:
Pavel Feldman 2024-05-21 14:36:31 -07:00 committed by GitHub
parent 148d759a4c
commit 7b27fc3916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 0 deletions

View file

@ -46,6 +46,7 @@ export type TraceViewerRedirectOptions = {
reporter?: string[];
webApp?: string;
isServer?: boolean;
outputDir?: string;
};
export type TraceViewerAppOptions = {
@ -129,6 +130,8 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
params.append('timeout', String(options.timeout));
if (options.headed)
params.append('headed', '');
if (options.outputDir)
params.append('outputDir', options.outputDir);
for (const reporter of options.reporter || [])
params.append('reporter', reporter);

View file

@ -92,6 +92,7 @@ export interface TestServerInterface {
headed?: boolean;
workers?: number | string;
timeout?: number,
outputDir?: string;
reporters?: string[],
trace?: 'on' | 'off';
video?: 'on' | 'off';

View file

@ -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,
workers: cliOverrides.workers,
timeout: cliOverrides.timeout,
outputDir: cliOverrides.outputDir,
});
await stopProfiling('runner');
if (status === 'restarted')

View file

@ -313,6 +313,7 @@ class TestServerDispatcher implements TestServerInterface {
_optionContextReuseMode: params.reuseContext ? 'when-possible' : undefined,
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,
},
outputDir: params.outputDir,
workers: params.workers,
};
if (params.trace === 'on')

View file

@ -60,6 +60,7 @@ const queryParams = {
workers: searchParams.get('workers') || undefined,
timeout: searchParams.has('timeout') ? +searchParams.get('timeout')! : undefined,
headed: searchParams.has('headed'),
outputDir: searchParams.get('outputDir') || undefined,
reporters: searchParams.has('reporter') ? searchParams.getAll('reporter') : undefined,
};
@ -283,6 +284,7 @@ export const UIModeView: React.FC<{}> = ({
workers: queryParams.workers,
timeout: queryParams.timeout,
headed: queryParams.headed,
outputDir: queryParams.outputDir,
reporters: queryParams.reporters,
trace: 'on',
});