A lightweight DOM-based UI automation framework using Chrome DevTools Protocol
npm install super-pancake-automationA lightweight DOM-based UI automation framework using Chrome DevTools Protocol. Perfect for web testing, form automation, and UI validation.
``bashCreate a new automation project
npx super-pancake-automation@latest init my-automation-project
$3
`bash
Interactive project setup
npx super-pancake-automation setup
`$3
`bash
Launch interactive web UI
npx super-pancake-automation-ui
`$3
`bash
Install in existing project
npm install super-pancake-automationImport in your test files
import {
createTestEnvironment,
navigateTo,
getText,
assertContainsText
} from 'super-pancake-automation';
`๐ Available Commands
`bash
Project Management
npx super-pancake-automation init # Create new project
npx super-pancake-automation setup # Interactive setup
npx super-pancake-automation-ui # Launch UI interfaceTesting & Diagnostics
npx super-pancake-automation browsers # Check browser compatibility
npx super-pancake-automation check # Health check
npx super-pancake-automation --version # Show version
`๐ฏ Generated Project Structure
When you create a new project with
npx super-pancake-automation init, you get:`
my-automation-project/
โโโ tests/
โ โโโ sample.test.js # Basic UI functionality test
โ โโโ ui-website.test.js # Website UI test
โ โโโ api.test.js # API testing examples
โโโ screenshots/ # Auto-generated screenshots
โโโ super-pancake.config.js # Configuration file
โโโ package.json # Project dependencies
โโโ README.md # Project documentation
`๐งช Running Tests in Generated Projects
`bash
Run all tests
npm testRun with visible browser (for debugging)
npm run test:headedRun with UI interface
npm run test:uiRun specific test files
npm test tests/sample.test.js
`๐ง Configuration
Edit
super-pancake.config.js in your generated project:`javascript
export default {
headless: true, // Browser mode
port: 9222, // Chrome DevTools port
screenshots: {
enabled: true, // Enable screenshots
onFailure: true, // Capture on test failure
directory: './screenshots' // Screenshot directory
},
execution: {
sequential: true, // Prevent Chrome port conflicts
timeout: 30000 // Test timeout
}
};
`๐ธ Features
- โ
Sequential Test Execution - Prevents Chrome port conflicts
- ๐ฏ Chrome DevTools Protocol - Fast and reliable browser automation
- ๐ธ Automatic Screenshots - Capture on success and failure
- ๐ HTML Test Reports - Beautiful, detailed test reports
- ๐ Advanced Element Selection - CSS, XPath, and custom selectors
- ๐ Custom Test Runner - Optimized for UI automation
- ๐จ Interactive UI - Visual test runner interface
- ๐ง Environment Variables - Flexible configuration
๐ Examples
$3
`javascript
import { describe, it, beforeAll, afterAll } from 'vitest';
import {
createTestEnvironment,
cleanupTestEnvironment,
enableDOM,
navigateTo,
getText,
assertContainsText
} from 'super-pancake-automation';describe('Website UI Tests', () => {
let testEnv;
beforeAll(async () => {
testEnv = await createTestEnvironment({ headed: false });
await enableDOM();
});
afterAll(async () => {
await cleanupTestEnvironment(testEnv);
});
it('should load homepage and verify content', async () => {
await navigateTo('https://example.com');
const title = await getText('h1');
assertContainsText(title, 'Welcome');
});
});
`$3
`javascript
it('should fill and submit a form', async () => {
await navigateTo('https://example.com/form');
await fillInput('#name', 'John Doe');
await fillInput('#email', 'john@example.com');
await clickButton('#submit');
await waitForSelector('.success-message');
const message = await getText('.success-message');
assertContainsText(message, 'Form submitted successfully');
});
`๐ ๏ธ Development
For contributors and developers:
`bash
Clone the repository
git clone https://github.com/pradapjackie/super-pancake.git
cd super-pancakeInstall dependencies
npm installRun tests
npm testRun with UI
npm run test:ui
``- API Reference
- Configuration Guide
- Architecture Overview
- Setup Guide
- Examples
We welcome contributions! Please see our Contributing Guide for details.
MIT License - see LICENSE file for details.
- ๐ง Email: pradapjackie@gmail.com
- ๐ Issues: GitHub Issues
- ๐ Documentation: GitHub Wiki
---
Happy Testing! ๐ฅโจ