Skip to content

Commit

Permalink
fix: warn if PWT commands get executed without PWT (microsoft#26542)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored and Germandrummer92 committed Oct 27, 2023
1 parent eb240b4 commit 0ad6973
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions packages/playwright-core/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,16 @@ function printPlaywrightTestError(command: string) {
}
}

{
const command = program.command('test').allowUnknownOption(true);
command.description('Run tests with Playwright Test. Available in @playwright/test package.');
command.action(async () => {
printPlaywrightTestError('test');
gracefullyProcessExitDoNotHang(1);
});
}

{
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');
const kExternalPlaywrightTestCommands = [
['test', 'Run tests with Playwright Test.'],
['show-report', 'Show Playwright Test HTML report.'],
['merge-reports', 'Merge Playwright Test Blob reports'],
];
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);
gracefullyProcessExitDoNotHang(1);
});
}
Expand Down

0 comments on commit 0ad6973

Please sign in to comment.