mirror of
https://github.com/microsoft/playwright.git
synced 2024-10-26 21:33:38 +03:00
parent
bc27ca225e
commit
48db1b1663
@ -47,6 +47,7 @@ export type TraceViewerRedirectOptions = {
|
|||||||
webApp?: string;
|
webApp?: string;
|
||||||
isServer?: boolean;
|
isServer?: boolean;
|
||||||
outputDir?: string;
|
outputDir?: string;
|
||||||
|
updateSnapshots?: 'all' | 'none' | 'missing';
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TraceViewerAppOptions = {
|
export type TraceViewerAppOptions = {
|
||||||
@ -132,6 +133,8 @@ export async function installRootRedirect(server: HttpServer, traceUrls: string[
|
|||||||
params.append('headed', '');
|
params.append('headed', '');
|
||||||
if (options.outputDir)
|
if (options.outputDir)
|
||||||
params.append('outputDir', options.outputDir);
|
params.append('outputDir', options.outputDir);
|
||||||
|
if (options.updateSnapshots)
|
||||||
|
params.append('updateSnapshots', options.updateSnapshots);
|
||||||
for (const reporter of options.reporter || [])
|
for (const reporter of options.reporter || [])
|
||||||
params.append('reporter', reporter);
|
params.append('reporter', reporter);
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ export interface TestServerInterface {
|
|||||||
workers?: number | string;
|
workers?: number | string;
|
||||||
timeout?: number,
|
timeout?: number,
|
||||||
outputDir?: string;
|
outputDir?: string;
|
||||||
|
updateSnapshots?: 'all' | 'none' | 'missing';
|
||||||
reporters?: string[],
|
reporters?: string[],
|
||||||
trace?: 'on' | 'off';
|
trace?: 'on' | 'off';
|
||||||
video?: 'on' | 'off';
|
video?: 'on' | 'off';
|
||||||
|
@ -171,6 +171,7 @@ async function runTests(args: string[], opts: { [key: string]: any }) {
|
|||||||
workers: cliOverrides.workers,
|
workers: cliOverrides.workers,
|
||||||
timeout: cliOverrides.timeout,
|
timeout: cliOverrides.timeout,
|
||||||
outputDir: cliOverrides.outputDir,
|
outputDir: cliOverrides.outputDir,
|
||||||
|
updateSnapshots: cliOverrides.updateSnapshots,
|
||||||
});
|
});
|
||||||
await stopProfiling('runner');
|
await stopProfiling('runner');
|
||||||
if (status === 'restarted')
|
if (status === 'restarted')
|
||||||
|
@ -314,6 +314,7 @@ class TestServerDispatcher implements TestServerInterface {
|
|||||||
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,
|
_optionConnectOptions: params.connectWsEndpoint ? { wsEndpoint: params.connectWsEndpoint } : undefined,
|
||||||
},
|
},
|
||||||
outputDir: params.outputDir,
|
outputDir: params.outputDir,
|
||||||
|
updateSnapshots: params.updateSnapshots,
|
||||||
workers: params.workers,
|
workers: params.workers,
|
||||||
};
|
};
|
||||||
if (params.trace === 'on')
|
if (params.trace === 'on')
|
||||||
|
@ -61,8 +61,11 @@ const queryParams = {
|
|||||||
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,
|
outputDir: searchParams.get('outputDir') || undefined,
|
||||||
|
updateSnapshots: (searchParams.get('updateSnapshots') as 'all' | 'none' | 'missing' | undefined) || undefined,
|
||||||
reporters: searchParams.has('reporter') ? searchParams.getAll('reporter') : undefined,
|
reporters: searchParams.has('reporter') ? searchParams.getAll('reporter') : undefined,
|
||||||
};
|
};
|
||||||
|
if (queryParams.updateSnapshots && !['all', 'none', 'missing'].includes(queryParams.updateSnapshots))
|
||||||
|
queryParams.updateSnapshots = undefined;
|
||||||
|
|
||||||
const isMac = navigator.platform === 'MacIntel';
|
const isMac = navigator.platform === 'MacIntel';
|
||||||
|
|
||||||
@ -285,6 +288,7 @@ export const UIModeView: React.FC<{}> = ({
|
|||||||
timeout: queryParams.timeout,
|
timeout: queryParams.timeout,
|
||||||
headed: queryParams.headed,
|
headed: queryParams.headed,
|
||||||
outputDir: queryParams.outputDir,
|
outputDir: queryParams.outputDir,
|
||||||
|
updateSnapshots: queryParams.updateSnapshots,
|
||||||
reporters: queryParams.reporters,
|
reporters: queryParams.reporters,
|
||||||
trace: 'on',
|
trace: 'on',
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user