UNPKG

veriqa-test-advisor

Version:

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

300 lines (234 loc) โ€ข 6.38 kB
# ๐Ÿš€ VeriQA Installation & Setup Guide ## ๐Ÿ“‹ Prerequisites - **Node.js 16+** ([Download here](https://nodejs.org/)) - **npm** (comes with Node.js) - **Git** (for commit analysis) ## ๐ŸŽฏ Installation Methods ### Method 1: Global Installation (Recommended) ```bash # Install VeriQA globally npm install -g veriqa-test-advisor # Auto-setup your project npx veriqa-setup # Start using VeriQA veriqa-test-advisor --help ``` ### Method 2: Project-Specific Installation ```bash # In your existing project npm install veriqa-test-advisor --save-dev # Setup project structure npx veriqa-setup # Use via npm scripts npm run test:ai ``` ### Method 3: Quick Demo ```bash # Try VeriQA without installation mkdir my-test-project && cd my-test-project npx veriqa-test-advisor --help npx veriqa-setup ``` ## ๐Ÿ› ๏ธ Auto Setup Details The `veriqa-setup` command automatically creates: ### ๐Ÿ“ Project Structure ``` your-project/ โ”œโ”€โ”€ tests/ โ”‚ โ”œโ”€โ”€ auth/ # Authentication tests โ”‚ โ”‚ โ””โ”€โ”€ login.spec.js โ”‚ โ”œโ”€โ”€ product/ # Product/feature tests โ”‚ โ”‚ โ””โ”€โ”€ search.test.js โ”‚ โ””โ”€โ”€ user/ # User management tests โ”‚ โ””โ”€โ”€ profile.spec.js โ”œโ”€โ”€ mappings/ โ”‚ โ””โ”€โ”€ module_test_map.json โ”œโ”€โ”€ scripts/ โ”‚ โ””โ”€โ”€ quick-start.js โ”œโ”€โ”€ .env # Configuration โ”œโ”€โ”€ playwright.config.js # Playwright setup โ”œโ”€โ”€ codecept.conf.js # CodeceptJS setup โ””โ”€โ”€ package.json # Updated with scripts ``` ### โš™๏ธ Configuration Files **`.env` (Environment Variables):** ```env PERPLEXITY_API_KEY=your_api_key_here VERIQA_FRAMEWORK=playwright VERIQA_ENV=local ``` **`package.json` (NPM Scripts):** ```json { "scripts": { "test:ai": "veriqa-test-advisor --ai", "test:smoke": "veriqa-test-advisor --run --tag smoke", "test:regression": "veriqa-test-advisor --run --tag regression", "test:dry": "veriqa-test-advisor --dry-run --tag smoke" } } ``` ### ๐Ÿงช Sample Test Files **Playwright Test (`tests/auth/login.spec.js`):** ```javascript // @module: auth const { test, expect } = require('@playwright/test'); test('Sample Login Test @smoke @regression', async ({ page }) => { await page.goto('/login'); await page.fill('[data-testid="email"]', 'test@example.com'); await page.click('[data-testid="login-button"]'); await expect(page.locator('text=Welcome')).toBeVisible(); }); ``` **CodeceptJS Test (`tests/product/search.test.js`):** ```javascript // @module: product Feature('Product Search'); Scenario('Sample Product Search @smoke', ({ I }) => { I.amOnPage('/products'); I.fillField('[data-testid="search-input"]', 'laptop'); I.click('[data-testid="search-button"]'); I.see('Search Results'); }); ``` ## ๐Ÿš€ Quick Start After installation and setup: ### 1. Configure API Key ```bash # Edit .env file nano .env # Add your Perplexity AI key PERPLEXITY_API_KEY=your_actual_api_key_here ``` ### 2. Test the Installation ```bash # Check version veriqa-test-advisor --version # Get help veriqa-test-advisor --help # Run demo node scripts/quick-start.js ``` ### 3. First AI Analysis ```bash # Make a commit first git add . && git commit -m "Setup VeriQA testing framework" # Get AI suggestions npm run test:ai # or veriqa-test-advisor --ai ``` ### 4. Run Your First Tests ```bash # Dry run to see what would execute npm run test:dry # Run smoke tests npm run test:smoke # Run all regression tests npm run test:regression ``` ## ๐Ÿ”ง Customization ### Update Test URLs **For Playwright (`playwright.config.js`):** ```javascript module.exports = defineConfig({ use: { baseURL: 'https://your-app.com', // Update this } }); ``` **For CodeceptJS (`codecept.conf.js`):** ```javascript exports.config = { helpers: { Playwright: { url: 'https://your-app.com', // Update this } } }; ``` ### Add Your Own Tests 1. **Create test files** in appropriate modules: ```bash # For authentication features touch tests/auth/signup.spec.js # For product features touch tests/product/checkout.spec.js ``` 2. **Add module tags**: ```javascript // @module: auth // @module: product ``` 3. **Use proper test tags**: ```javascript test('My test @smoke @regression', async ({ page }) => { // test code }); ``` ## ๐ŸŽฏ Integration with Existing Projects ### If you already have tests: 1. **Move existing tests** to module folders: ```bash mkdir -p tests/auth tests/product mv existing-login-tests/* tests/auth/ ``` 2. **Add module tags** to existing test files: ```javascript // Add this at the top of each test file // @module: your-module-name ``` 3. **Update configuration** files: ```bash # Backup existing configs cp playwright.config.js playwright.config.js.backup # Let VeriQA setup update them npx veriqa-setup ``` ## ๐Ÿ†˜ Troubleshooting ### Common Issues **1. "Command not found: veriqa-test-advisor"** ```bash # Reinstall globally npm uninstall -g veriqa-test-advisor npm install -g veriqa-test-advisor ``` **2. "No tests found"** ```bash # Check test structure ls -la tests/ # Regenerate mapping veriqa-test-advisor --run --verbose ``` **3. "AI suggestions failed"** ```bash # Check API key in .env cat .env | grep PERPLEXITY_API_KEY # Get free API key: https://perplexity.ai ``` **4. "Playwright not found"** ```bash # Install Playwright npm install @playwright/test npx playwright install ``` ### Getting Help - ๐Ÿ“– **Documentation**: [GitHub Wiki](https://github.com/kapilrathore/veriqa-test-advisor/wiki) - ๐Ÿ› **Bug Reports**: [GitHub Issues](https://github.com/kapilrathore/veriqa-test-advisor/issues) - ๐Ÿ’ฌ **Questions**: [GitHub Discussions](https://github.com/kapilrathore/veriqa-test-advisor/discussions) - ๐Ÿ“ง **Email**: support@veriqa.dev ## ๐ŸŽ‰ Success Indicators After successful setup, you should see: โœ… **File structure created** โœ… **Sample tests executable** โœ… **AI suggestions working** โœ… **NPM scripts available** โœ… **Test mapping generated** ```bash # Verify everything works npm run test:dry # Should show test plan veriqa-test-advisor --version # Should show version ls tests/ # Should show auth, product, user folders ``` --- **๐Ÿ‡ฎ๐Ÿ‡ณ Made with โค๏ธ in India | VeriQA Test Advisor**