auto-playwright  by lucgagan

Playwright extension for AI-driven browser automation

Created 1 year ago
796 stars

Top 44.2% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

  • Install: npm install auto-playwright -D
  • Prerequisites: Node.js, OpenAI API key (exported as OPENAI_API_KEY or in a .env file). Azure OpenAI is also supported with specific configuration.
  • Usage: Import auto and use it with prompts, passing Playwright's page and test objects. See official examples.

Highlighted Details

  • Supports both standard OpenAI and Azure OpenAI endpoints.
  • Can execute actions (e.g., click, fill), queries (data retrieval), and assertions (boolean outcomes).
  • Leverages HTML sanitization to reduce payload size sent to OpenAI, aiming for cost efficiency.
  • Debugging can be enabled via debug: true option or AUTO_PLAYWRIGHT_DEBUG=true environment variable.

Maintenance & Community

  • The project is open-source, with no specific mention of core maintainers or community channels like Discord/Slack in the README.
  • It draws inspiration from ZeroStep, aiming to provide an open-source alternative.

Licensing & Compatibility

  • Licensed under the MIT License, permitting commercial use and modification.
  • Compatible with any browser supported by Playwright.

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.

Health Check
Last Commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
1
Star History
9 stars in the last 30 days

Explore Similar Projects

Starred by Travis Fischer Travis Fischer(Founder of Agentic), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
4 more.

open-operator by browserbase

0.4%
2k
Template for building web agents using Browserbase and Stagehand
Created 7 months ago
Updated 3 months ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
15 more.

stagehand by browserbase

0.5%
17k
AI browser automation framework for production
Created 1 year ago
Updated 1 day ago
Starred by Kevin Hou Kevin Hou(Head of Product Engineering at Windsurf), Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research), and
29 more.

browser-use by browser-use

0.6%
70k
SDK for AI agent browser control
Created 10 months ago
Updated 1 day ago
Feedback? Help us improve.