UNPKG

veriqa-test-advisor

Version:

AI-powered regression test case advisor CLI tool with integrated Manual QA support

134 lines (107 loc) โ€ข 5.37 kB
#!/usr/bin/env node /** * VeriQA Test Advisor - Clean Installation Experience * 100% Safe Installation - NO modifications to user's project */ const pkg = require('./package.json'); const chalk = require('chalk'); const fs = require('fs'); const path = require('path'); console.log('\n' + '='.repeat(70)); console.log(chalk.cyan.bold('๐Ÿš€ VeriQA Test Advisor - Installation Complete!')); console.log('='.repeat(70)); console.log(chalk.green.bold(`\nโœ… Successfully installed VeriQA Test Advisor v${pkg.version}`)); console.log(chalk.blue.bold('๐Ÿ‡ฎ๐Ÿ‡ณ Made in India with โค๏ธ for developers worldwide')); // Safe project analysis console.log(chalk.cyan('\n๐Ÿ” Project Scan (Read-Only):')); try { const currentDir = process.cwd(); let projectType = 'Generic Project'; let language = 'Unknown'; let framework = 'Not detected'; let hasTests = false; // Check package.json if exists const packagePath = path.join(currentDir, 'package.json'); if (fs.existsSync(packagePath)) { try { const packageData = JSON.parse(fs.readFileSync(packagePath, 'utf8')); const deps = Object.assign({}, packageData.dependencies || {}, packageData.devDependencies || {}); // Detect project type if (deps.react) projectType = 'React Application'; else if (deps.vue) projectType = 'Vue.js Application'; else if (deps.angular) projectType = 'Angular Application'; else if (deps.next) projectType = 'Next.js Application'; else if (deps.express) projectType = 'Node.js Backend'; else if (deps.typescript) projectType = 'TypeScript Project'; else projectType = 'Node.js Project'; // Detect language language = (deps.typescript || deps['@types/node']) ? 'TypeScript' : 'JavaScript'; // Detect test framework if (deps.playwright) framework = 'Playwright'; else if (deps.codeceptjs) framework = 'CodeceptJS'; else if (deps.cypress) framework = 'Cypress'; else if (deps.jest) framework = 'Jest'; else if (deps.mocha) framework = 'Mocha'; else framework = 'Will be configured'; } catch (e) { // Invalid package.json, use defaults } } // Check for test directories const testDirs = ['tests', 'test', '__tests__', 'e2e', 'cypress']; hasTests = testDirs.some(dir => fs.existsSync(path.join(currentDir, dir))); console.log(chalk.green(` ๐Ÿ“‚ Project Type: ${projectType}`)); console.log(chalk.green(` ๐Ÿ“‹ Language: ${language}`)); console.log(chalk.green(` ๐Ÿงช Tests: ${hasTests ? 'Directory found' : 'Will be configured'}`)); console.log(chalk.green(` ๐Ÿ”ง Framework: ${framework}`)); } catch (error) { console.log(chalk.dim(' ๐Ÿ“‹ Project details will be analyzed when you run VeriQA')); } // Quick start instructions console.log(chalk.cyan('\n๐Ÿš€ Quick Start (Zero Setup Required):')); console.log(chalk.white(' 1. Run immediate analysis:')); console.log(chalk.green(' veriqa-test-advisor --run')); console.log(chalk.white('\n 2. Configure for your project:')); console.log(chalk.green(' veriqa-setup')); console.log(chalk.white('\n 3. Interactive setup wizard:')); console.log(chalk.green(' veriqa-wizard')); console.log(chalk.white('\n 4. See live demonstration:')); console.log(chalk.green(' npm run demo')); // Available commands console.log(chalk.cyan('\n๐Ÿ“š Core Commands:')); const commands = [ ['veriqa-test-advisor --help', 'Complete command reference'], ['veriqa-test-advisor --ai', 'AI-powered test suggestions'], ['veriqa-test-advisor --smart', 'Smart test prioritization'], ['npm run veriqa:fast', 'Lightning-fast analysis'], ['npm run demo:cross-language', 'Multi-language demo'], ['npm run test:cross-language', 'Test multi-language support'] ]; commands.forEach(function(command) { const cmd = command[0]; const desc = command[1]; console.log(chalk.green(` ${cmd.padEnd(32)} # ${desc}`)); }); // Documentation console.log(chalk.cyan('\n๐Ÿ“– Documentation:')); console.log(chalk.green(' ๐Ÿ“‹ Complete Guide: docs/USER_GUIDE.md')); console.log(chalk.green(' ๐Ÿš€ Quick Start: docs/QUICK_START.md')); console.log(chalk.green(' ๐ŸŒ Multi-Language: docs/CROSS_LANGUAGE_SUPPORT.md')); console.log(chalk.green(' ๐Ÿ”ง Installation Help: docs/INSTALLATION_TROUBLESHOOTING.md')); // Pro tips console.log(chalk.yellow('\n๐Ÿ’ก Pro Tips:')); console.log(chalk.yellow(' โ€ข Start with "veriqa-setup" for optimal project configuration')); console.log(chalk.yellow(' โ€ข Use "npm run demo" to see VeriQA capabilities')); console.log(chalk.yellow(' โ€ข Try "npm run veriqa:fast" for rapid analysis')); console.log(chalk.dim(' โ€ข All setup is optional - VeriQA works out of the box!')); // What's new console.log(chalk.cyan('\n๐ŸŒŸ What\'s New in v1.7.0:')); console.log(chalk.blue(' โœ… Cross-language support (JS/TS, Python, Java, PHP, Go)')); console.log(chalk.blue(' โœ… Lightning-fast incremental analysis')); console.log(chalk.blue(' โœ… 100% dynamic analysis with zero hardcoded patterns')); console.log(chalk.blue(' โœ… Smart test mapping and execution')); console.log(chalk.blue(' โœ… Domain-aware test generation')); // Final message console.log('\n' + '='.repeat(60)); console.log(chalk.cyan.bold('๐ŸŽ‰ Ready to make testing smarter!')); console.log('='.repeat(60) + '\n');