diff --git a/src/helpers/installPlaywright.ts b/src/helpers/installPlaywright.ts index 304f012..7f45f21 100644 --- a/src/helpers/installPlaywright.ts +++ b/src/helpers/installPlaywright.ts @@ -41,7 +41,7 @@ export function installPlaywright({ language }: InstallPlaywrightProps): Promise }); child.on('exit', () => { - load.stop(); + load.succeed(); }); }); case 'dotnet': @@ -66,7 +66,7 @@ export function installPlaywright({ language }: InstallPlaywrightProps): Promise }); child.on('exit', () => { - load.stop(); + load.succeed(); }); }); } diff --git a/src/helpers/languageHandlers/handleDotnet.ts b/src/helpers/languageHandlers/handleDotnet.ts index d1a33bf..da60d93 100644 --- a/src/helpers/languageHandlers/handleDotnet.ts +++ b/src/helpers/languageHandlers/handleDotnet.ts @@ -1,8 +1,11 @@ import path from 'path'; import fsExtra from 'fs-extra'; +import prompts from 'prompts'; import { CreateOptions } from '@/types'; + import { installPlaywright } from '../installPlaywright'; +import { exit } from '../exit'; interface HandleDotNetProps { createOptions: CreateOptions; @@ -22,7 +25,29 @@ export async function handleDotnet({ createOptions, root }: HandleDotNetProps) { await fsExtra.writeFile(path.join(root, 'appsettings.Testing.json'), secrets); + console.log(); // Create space + if (framework?.value === 'playwright') { + const installBrowsers = await prompts( + { + type: 'toggle', + name: 'value', + message: `Install Playwright browsers?`, + initial: true, + active: 'Yes', + inactive: 'No', + }, + { + onCancel: () => { + exit(0); + }, + } + ); + + if (!installBrowsers.value) { + return; + } + await installPlaywright({language}); } } diff --git a/src/inputs/apiKeyInput.ts b/src/inputs/apiKeyInput.ts index a9b3944..5de36c6 100644 --- a/src/inputs/apiKeyInput.ts +++ b/src/inputs/apiKeyInput.ts @@ -45,7 +45,6 @@ export async function apiKeyInput(isServerApiKey: boolean): Promise { if (isServerApiKey) { console.log(); // Creates space - console.log( pc.yellow( pc.bold(