🎉 LocatorPro for Playwright - Initial Release
Revolutionary Self-Healing Locator System for Playwright
Transform fragile selectors into intelligent, self-healing locators with automatic fallback strategies. Say goodbye to brittle test automation!
✨ Key Features
🔧 Self-Healing Locators
- 35+ intelligent strategies - CSS, XPath, text, attributes, roles, and more
- Automatic fallback system - When one selector breaks, others take over
- Pattern analysis - Smart alternatives for broken selectors
- Reliability scoring - Prioritize the most stable locators
🚀 Revolutionary Features
- 🔗 Related Text Location - Find buttons by nearby product names or context
- 🎯 Smart DOM Scanning - Intelligent element discovery with comprehensive analysis
- ⚡ Performance Optimized - Fast execution with efficient strategy generation
- 🛡️ Production Ready - 100% test coverage with comprehensive scenarios
💡 Developer Experience
- Drop-in replacement for existing Playwright locators
- Zero configuration - Works out of the box
- Comprehensive debugging - Detailed strategy logging and analysis
- TypeScript support - Full type definitions included
📦 Installation
npm install locatorpro-playwright
🚀 Quick Start
import { SmartLocator } from 'locatorpro-playwright';
const smartLocator = new SmartLocator(page);
// Find elements with intelligent fallbacks
const loginButton = await smartLocator.findByVisibleText('Login');
const usernameField = await smartLocator.findByTestId('username');
// Revolutionary: Find by related text context
const addToCartButton = await smartLocator.findByRelatedText('Add to Cart', 'iPhone 15 Pro');
// Auto-enhance existing locators with self-healing
const enhancedLocator = await smartLocator.enhanceLocator('#submit-btn');
🎯 Problem Solved
Before LocatorPro:
// ❌ Breaks when ID changes: #submit-btn-123 → #submit-btn-456
await page.click('#submit-btn-123');
// ❌ Breaks when classes change: .old-button → .new-button
await page.click('.old-button');
With LocatorPro:
// ✅ Automatically finds alternatives using text, attributes, position, etc.
const button = await smartLocator.enhanceLocator('#submit-btn-123');
await smartLocator.smartClick(button);
// ✅ Works across different layouts and DOM changes
const addToCart = await smartLocator.findByRelatedText('Add to Cart', 'iPhone 15 Pro');