Playwright extension for AI-driven browser automation
Top 46.0% on sourcepulse
This library enables the automation of Playwright browser tests using natural language prompts processed by OpenAI's GPT models. It's designed for developers and QA engineers looking to accelerate test creation and handle complex scenarios without writing explicit selectors, offering a potentially faster implementation and a TDD-friendly approach.
How It Works
The auto
function takes a natural language prompt and uses the provided Playwright page
object to interact with web elements. It infers whether to perform an action (like clicking or typing), query data, or make an assertion based on the prompt's intent. The core advantage lies in its ability to abstract away the need for CSS selectors or XPath, allowing AI to interpret the page structure and user intent, thereby simplifying test writing and maintenance.
Quick Start & Requirements
npm install auto-playwright -D
OPENAI_API_KEY
or in a .env
file). Azure OpenAI is also supported with specific configuration.auto
and use it with prompts, passing Playwright's page
and test
objects. See official examples.Highlighted Details
click
, fill
), queries (data retrieval), and assertions (boolean outcomes).debug: true
option or AUTO_PLAYWRIGHT_DEBUG=true
environment variable.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The project is positioned as an exploration of the underlying technology of ZeroStep and suggests ZeroStep for production environments due to its more robust implementation. Auto Playwright does not use screenshots, queues, WebSockets, implement parallelism, or allow scrolling, features present in ZeroStep.
3 weeks ago
1 day