Vlad Filippov

Vlad Filippov

full-stack software developer / open source hacker

playwright-ai CLI tool

Recently open-sourced the playwright-ai project – a tool to generate LLM-based Playwright functional tests. Try it out via the docs at: https://github.com/vladikoff/playwright-ai

Still early, but it is useful for web projects that have zero functional tests! It has some fun stuff like support for OpenAI and Anthropic models in the CLI and self-healing tests through re-prompting. Hopefully more features soon…

Supported models:

  • Anthropic’s Claude – configure API key with an ANTHROPIC_API_KEY.
  • OpenAI’s GPT3 and GPT4 – configure API key with an OPENAI_API_KEY.

Quick start

npm -g playwright-ai
  • Obtrain the API key for the LLM model of your choice: Anthropic or OpenAI.
  • Execute the CLI from project directory:
playwright-ai --endpoint=https://example.com --model=claude --tests=1
  • After the CLI is done, it will generate the tests into the Playwright test directory. As the tests generate, the CLI will have both passing and failing tests. The failing tests will have to be manually fixed by the user of the tool.
playwright-ai demo

I suggested using either the GPT-4 or Claude 2 models to get better results. Try out the tool in your own projects and let me know if it generated useful tests!

© Vlad Filippov