From 7f0763d789e6c61d17861222dc1eaabd9efd909c Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Tue, 14 Feb 2023 13:22:44 -0800 Subject: [PATCH] chore: hide watch mode, it is not ready (#20905) --- packages/playwright-test/src/cli.ts | 3 +-- tests/playwright-test/playwright-test-fixtures.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/playwright-test/src/cli.ts b/packages/playwright-test/src/cli.ts index ad1471e5fc..36233c0476 100644 --- a/packages/playwright-test/src/cli.ts +++ b/packages/playwright-test/src/cli.ts @@ -60,7 +60,6 @@ function addTestCommand(program: Command) { command.option('--project ', `Only run tests from the specified list of projects (default: run all projects)`); command.option('--timeout ', `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${defaultTimeout})`); command.option('--trace ', `Force tracing mode, can be ${kTraceModes.map(mode => `"${mode}"`).join(', ')}`); - command.option('--watch', `Run watch mode`); command.option('-u, --update-snapshots', `Update snapshots with actual results (default: only create missing snapshots)`); command.option('-x', `Stop after the first failure`); command.action(async (args, opts) => { @@ -167,7 +166,7 @@ async function runTests(args: string[], opts: { [key: string]: any }) { config._internal.passWithNoTests = !!opts.passWithNoTests; const runner = new Runner(config); - const status = opts.watch ? await runner.watchAllTests() : await runner.runAllTests(); + const status = process.env.PWTEST_WATCH ? await runner.watchAllTests() : await runner.runAllTests(); await stopProfiling(undefined); if (status === 'interrupted') process.exit(130); diff --git a/tests/playwright-test/playwright-test-fixtures.ts b/tests/playwright-test/playwright-test-fixtures.ts index cab6454a40..ef417c507f 100644 --- a/tests/playwright-test/playwright-test-fixtures.ts +++ b/tests/playwright-test/playwright-test-fixtures.ts @@ -195,7 +195,6 @@ function watchPlaywrightTest(childProcess: CommonFixtures['childProcess'], baseD const outputDir = path.join(baseDir, 'test-results'); const args = ['test']; args.push('--output=' + outputDir); - args.push('--watch'); args.push('--workers=2', ...paramList); if (options.additionalArgs) args.push(...options.additionalArgs); @@ -205,7 +204,7 @@ function watchPlaywrightTest(childProcess: CommonFixtures['childProcess'], baseD command.push(...args); const testProcess = childProcess({ command, - env: cleanEnv(env), + env: cleanEnv({ PWTEST_WATCH: '1', ...env }), cwd, }); return testProcess;