glassqa-engine
v0.1.0
Published
Core engine for GlassQA - converts browser recordings into Playwright test code
Maintainers
Readme
@glassqa/engine
Core engine for GlassQA - Converts browser recordings into Playwright test code.
Overview
This package provides the test generation logic used by the GlassQA CLI and Chrome Extension. It takes recorded browser interactions and generates clean, maintainable Playwright test code with resilient selectors.
Installation
npm install @glassqa/engineUsage
import { generatePlaywrightTest } from '@glassqa/engine';
const steps = [
{
type: 'navigate',
url: 'https://example.com',
timestamp: Date.now()
},
{
type: 'click',
selector: { testId: 'login-button' },
timestamp: Date.now()
}
];
const testCode = generatePlaywrightTest(steps, {
suiteName: 'my-test',
testName: 'user login flow'
});
console.log(testCode); // Generated Playwright testFeatures
- 🎯 Generates Playwright-compatible test code
- 🔍 Multi-strategy selector fallbacks (test IDs → ARIA → text → CSS)
- 📝 Clean, readable test output
- 🛡️ Defensive coding with safe waits and error handling
Part of GlassQA
This is the core engine used by:
- GlassQA CLI (
glassqapackage) - GlassQA Chrome Extension
For recording browser interactions, use the GlassQA Chrome Extension and GlassQA CLI.
License
MIT
