veriqa-test-advisor
Version:
AI-powered regression test case advisor CLI tool with integrated Manual QA support
134 lines (107 loc) โข 5.37 kB
JavaScript
/**
* 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');