fix: warn if PWT commands get executed without PWT (#26542)

Fixes https://github.com/microsoft/playwright/issues/26541
This commit is contained in:
Max Schmitt 2023-08-18 18:26:34 +02:00 committed by GitHub
parent e15db7993a
commit 29fbcbee69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,20 +48,16 @@ function printPlaywrightTestError(command: string) {
} }
} }
{ const kExternalPlaywrightTestCommands = [
const command = program.command('test').allowUnknownOption(true); ['test', 'Run tests with Playwright Test.'],
command.description('Run tests with Playwright Test. Available in @playwright/test package.'); ['show-report', 'Show Playwright Test HTML report.'],
command.action(async () => { ['merge-reports', 'Merge Playwright Test Blob reports'],
printPlaywrightTestError('test'); ];
gracefullyProcessExitDoNotHang(1); for (const [command, description] of kExternalPlaywrightTestCommands) {
}); const playwrightTest = program.command(command).allowUnknownOption(true);
} playwrightTest.description(`${description} Available in @playwright/test package.`);
playwrightTest.action(async () => {
{ printPlaywrightTestError(command);
const command = program.command('show-report').allowUnknownOption(true);
command.description('Show Playwright Test HTML report. Available in @playwright/test package.');
command.action(async () => {
printPlaywrightTestError('show-report');
gracefullyProcessExitDoNotHang(1); gracefullyProcessExitDoNotHang(1);
}); });
} }