@toolstackhq/create-qa-patterns 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/index.js +31 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,3 +50,5 @@ The CLI checks:
|
|
|
50
50
|
- `npm` availability for install and test actions
|
|
51
51
|
- `npx` availability for Playwright browser installation
|
|
52
52
|
- `docker` availability and warns if it is missing
|
|
53
|
+
|
|
54
|
+
If `npx playwright install` fails because the host is missing browser dependencies, the CLI keeps the generated project and prints the recovery steps instead of treating scaffold generation as failed.
|
package/index.js
CHANGED
|
@@ -444,6 +444,26 @@ function getCommandName(base) {
|
|
|
444
444
|
return base;
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
function printPlaywrightInstallRecovery(targetDirectory) {
|
|
448
|
+
process.stdout.write(`
|
|
449
|
+
Playwright browser installation did not complete.
|
|
450
|
+
|
|
451
|
+
Common cause:
|
|
452
|
+
Missing OS packages required to run Playwright browsers.
|
|
453
|
+
|
|
454
|
+
Recommended next steps:
|
|
455
|
+
cd ${path.relative(process.cwd(), targetDirectory) || "."}
|
|
456
|
+
sudo npx playwright install-deps
|
|
457
|
+
npx playwright install
|
|
458
|
+
|
|
459
|
+
If you already know the missing package name, install it with your system package manager and then rerun:
|
|
460
|
+
npx playwright install
|
|
461
|
+
|
|
462
|
+
The template was generated successfully. You can complete browser setup later.
|
|
463
|
+
|
|
464
|
+
`);
|
|
465
|
+
}
|
|
466
|
+
|
|
447
467
|
function runCommand(command, args, cwd) {
|
|
448
468
|
return new Promise((resolve, reject) => {
|
|
449
469
|
const child = spawn(getCommandName(command), args, {
|
|
@@ -509,7 +529,17 @@ async function runPostGenerateActions(targetDirectory) {
|
|
|
509
529
|
const shouldInstallPlaywright = await askYesNo("Run npx playwright install now?", true);
|
|
510
530
|
|
|
511
531
|
if (shouldInstallPlaywright) {
|
|
512
|
-
|
|
532
|
+
try {
|
|
533
|
+
await runCommand("npx", ["playwright", "install"], targetDirectory);
|
|
534
|
+
} catch (error) {
|
|
535
|
+
printPlaywrightInstallRecovery(targetDirectory);
|
|
536
|
+
|
|
537
|
+
const shouldContinue = await askYesNo("Continue without completing Playwright browser install?", true);
|
|
538
|
+
|
|
539
|
+
if (!shouldContinue) {
|
|
540
|
+
throw error;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
513
543
|
}
|
|
514
544
|
} else {
|
|
515
545
|
process.stdout.write("Skipping Playwright browser install prompt because npx is not available.\n");
|