Skip to main content
Glama
verify-qa.ts•2.64 kB
import { browserManager } from './browser.js'; import path from 'path'; import fs from 'fs'; async function runDemo() { console.log('šŸš€ Starting QA Agent Demo...'); try { // 1. Navigate // Resolve path relative to the script location or CWD to be robust let testPath = path.resolve(process.cwd(), 'test-site/index.html'); if (!fs.existsSync(testPath)) { // Try looking inside qa-agent-mcp if running from parent testPath = path.resolve(process.cwd(), 'qa-agent-mcp/test-site/index.html'); } if (!fs.existsSync(testPath)) { throw new Error(`Could not find test file at: ${testPath}`); } const url = `file://${testPath}`; console.log(`\n1ļøāƒ£ Navigating to: ${url}`); await browserManager.navigate(url); // 2. Type Username console.log('\n2ļøāƒ£ Typing username...'); await browserManager.type('#username', 'TestUser_001'); // 3. Click Login console.log('\n3ļøāƒ£ Clicking login button...'); await browserManager.click('#login-btn'); // 4. Verify Result console.log('\n4ļøāƒ£ Verifying result...'); const text = await browserManager.getText('#result'); console.log(` Found text: "${text}"`); if (text === 'Welcome back, TestUser_001!') { console.log(' āœ… TEST PASSED: Login successful'); } else { console.error(' āŒ TEST FAILED: Unexpected text'); } // 5. Screenshot console.log('\n5ļøāƒ£ Taking evidence screenshot...'); const screenshotMsg = await browserManager.screenshot('evidence_success'); console.log(` ${screenshotMsg}`); // 6. Premium Feature: Mobile Simulation console.log('\n6ļøāƒ£ [PREMIUM] Testing Mobile Viewport (iPhone 12)...'); await browserManager.setViewport(390, 844, true); await browserManager.screenshot('evidence_mobile'); console.log(' šŸ“ø Mobile screenshot saved'); // 7. Premium Feature: Console Logs console.log('\n7ļøāƒ£ [PREMIUM] Checking Console Logs...'); const logs = await browserManager.getConsoleLogs(); console.log(' šŸ“‹ Captured Logs:'); console.log(logs); console.log('\n✨ Demo completed successfully!'); } catch (error: any) { console.error('\nāŒ Error:', error.message); } finally { // Keep browser open for a moment to see result await new Promise(resolve => setTimeout(resolve, 3000)); await browserManager.close(); } } runDemo();

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/samusilv/qa-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server